Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By hundsmiachn
#60886 Hi

Im using the ESP-12F...
Because the DS18B20 sensor is too big for my needs, I want to use the MF52AT 10k thermistor the measure temps. But I want to use 3 of them on the ADC pin. My thought is now to use the digital pins to switch 3 BC336 transistor on an off, on after another and every thermistor is in serial with one of the BC336. I want to use a simple voltage divider with a 64k resistor and the 3 thermistors( and BC336). Temp range is from 0 to 90 C. So I calculated the max resistance of every thermistor is about 28k and the min resistance is 1,2k.
In the software I want to switch on Digitalpin 1 (maybe GPIO12), read thermistor 1, then switch off D1, switch on D2, read thermistor 2 etc. In theory this should work I think, but how do I protect my ADC from getting a higher voltage than 1V ??? That is my major concern, because at bootup all 3 transistors are switched off and then the ADC would be pulled up to 3.3V.
How could I implement a simple overvoltage protection for the ADC??
Is there a simpler solution for reading multiple analog values from one ADC pin ?

thanks in advance
regards
Erich
Last edited by hundsmiachn on Thu Jan 12, 2017 9:48 am, edited 2 times in total.
User avatar
By warwick
#60890 Erich - it may be better to use resistive switches (such as a mosfet - eg 2N7002 or similar) for connecting each thermistor to GND, as BC337 or other NPN transistor will introduce an offset (maybe 50 to 100mV) into the measurement. 2N7002 has only a few ohms resistance, so will have negligible impact on the measurement.

To solve your startup issue, you could bias all three mosfets on (ie connect their gates to 3.3V via resistors) as well as connecting their gates to the GPIO to control them. On reset the GPIOs will be inputs, so all mosfets will be turned on and all three thermistors will be connected in parallel, so the voltage to the ADC converter should be well below 1V. Then you just need to set two of the GPIOs as outputs (and low) at a time to turn off the corresponding mosfets and leave the remaining thermistor connected to GND.
User avatar
By warwick
#60896 A better solution could be to make a resistor divider to the ADC using fixed 23k and 10k resistors from 3.3V to GND, with the 10k NTC thermistors connected one at a time in parallel with the fixed 10k resistor via three mosfets switched by GPIOs. This will allow the NTC thermistor resistance to vary from 0 to infinity while the ADC input will remain in the range of 0 to 1V. Greatest measurement resolution (a/d counts per degree) will be around the NTC thermistor nominal 10k resistance point and will reduce as the NTC resistance increases or reduces from 10k,
User avatar
By trackerj
#60905 I would suggest you to start reading from here: ESP8266 Internal ADC and continue also with this one: ESP8266 Internal ADC Part 2 - the easy way example.
Also take a look at :
- ADC input frontend example
- ACS712 input module

The last one is giving you also a very basic & simple idea on how can be designed a DC VLSAM (Voltage Level Shifter and amplifier module) for your ADC.

Happy breadboarding,
TJ.