1
\$\begingroup\$

I have a project with ESP8266. It will run with Li-Ion battery, solar panel to charge and a buck-boost 3.3V regulator.

I want to monitor the Li-Ion battery using ESP8266. It has an ADC with max voltage of 1.0V. So I'm thinking to use a voltage divider (see schematic). I set high value resistors to minimize power consumption.

Will that circuit work? Is there any sideeffect using so high values?

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
  • 1
    \$\begingroup\$ Your divider works, but you need to find the input specifications for the ESP8266 TOUT pin -- in particular the input resistance and input leakage current. I couldn't find this in the datasheet, but there may be app notes somewhere. Even if the DC specs are compatable with your high resistor values, some ADCs have a switched input capacitance that would require you to add a capacitor (to ground) at the divider output. \$\endgroup\$ – Paul Elliott Feb 3 '17 at 19:00
  • 1
    \$\begingroup\$ P.S. -- I enjoyed that spec sheet. Phrases like "TOUT must be dangled" are always entertaining. \$\endgroup\$ – Paul Elliott Feb 3 '17 at 19:02
2
\$\begingroup\$

Here's how to figure it out.

In the datasheet for your ADC, there should be two important specifications:

  1. Maximum source impedance.
    This is the highest resistance you can feed the ADC from. In your circuit, the source impedance is R1 and R2 in parallel, or about 80K. If the max permitted source impedance is less than 80K, you need to re-design.

  2. Minimum input impedance.
    This is the input circuit of the ADC, modelled as a resistance connected in parallel with R2. Let's say it is 10M. (In practice most ADCs will do better than the specification, but you can't rely on that). Calculate the ADC voltage for the most critical battery voltages, with and without thet input impedance in parallel with R2. It will be different ... but how different, and is that difference large enough to upset your calculations? If so, you need to re-design.

\$\endgroup\$
  • \$\begingroup\$ On the datasheed those information seems unavailable. I found this online in a forum: "The espressif data sheet does not give a specification but it says all inputs have a leakage current to maintain an input state of 50nA and you should expect input impedance of any ADC to be high" (esp8266.com/viewtopic.php?f=160&t=13435) \$\endgroup\$ – Noisemaker Feb 3 '17 at 19:22
2
\$\begingroup\$

The required information on the chip does not seem to be published. So you are in (officially) uncharted waters.

Many or most MCU ADCs have an input resistance that varies depending on how frequently you read them. There is also the leakage to contend with, but it's often a secondary concern.

A guess would be that if you keep the source impedance (R1||R2) less than 5K the accuracy will be little affected. Most microcontrollers in my experience are most accurate with between 2.5K and 10K maximum.

If you want to go higher (to reduce current) you can either perform tests to try to qualify the particular part you have under your expected conditions (a capacitor across R2 may help), or you could add a CMOS op-amp to buffer the voltage divider and go much higher in resistance (but you have to buy and power the op-amp). Or you could add a high-side switch to switch a low-resistance voltage divider 'on' just during measurements.

\$\endgroup\$
  • \$\begingroup\$ I found this online in a forum: "The espressif data sheet does not give a specification but it says all inputs have a leakage current to maintain an input state of 50nA and you should expect input impedance of any ADC to be high". \$\endgroup\$ – Noisemaker Feb 3 '17 at 21:18
  • \$\begingroup\$ @Noisemaker Please see above (no change). \$\endgroup\$ – Spehro Pefhany Feb 3 '17 at 21:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.