- Sun Jan 06, 2019 10:39 am
#79897
In my first reply I said that there are real problems with the ESP8266's A/D. That if I were to use a thermistor I would use an external A/D converter.
The A/D produces poor results because it is affected by what the chip is doing at the time. Take a look at this issue.
https://github.com/esp8266/Arduino/issues/2070 From what I remember, it is best to have the WiFi turned off when doing a sample. In my projects. where I am running off a battery, I do my battery voltage reading first, and only at the start, then I complete the rest of the code.
With many processors applications Vcc is used as the positive reference for the A/D converter. This is fine when what you are measuring has it's output proportional to that same Vcc supply. (as with a thermistor with a resistor to Vcc) But if you needed to measure a voltage of something that was not related to Vcc then the result will be affected by what the reference voltage is (Vcc) and what changes it is seeing.
If you had to measure a specific voltage, lets say 0.722 volts, and the A/D reference voltage was 3.30 volts, you would get reading of 224 from a 10 bit converter. But if the voltage reference was 3.15 volts the reading when measuring 0.722 volts would be 234. This is an issue I have with products that must measure a voltage that is not proportional to Vcc.
Almost always, when I use thermistors in an application, the A/D converter is connected to Vcc and the resistor in series with the thermistor is also connected to Vcc. If Vcc is high, or if it is low, that will change the value of each step in the reading. But since the thermistor's voltage is also dependent on Vcc the output will track the A/D' reference changes.
Now in the case of the ESP8266 the reference of the A/D is not directly proportional to Vcc. It has a poor reference. It is not a consistent voltage from chip to chip, and it also is affected by changes in current consumption of the chip. If you use Vcc to provide the voltage for the resistor/thermistor divider the changes in Vcc will not be the same as what the A/D is using for the reference. And this will produce variable readings.
I was very disappointed with the issues with the ESP8266's A/D converter. I only use it if I can tolerate low accurate readings. If I need something more accurate I use either an external A/D or a coprocessor with it's own A/D.