ESP8266 Battery Voltage Monitor Simple

Real time graph – Warning may appear to freeze your browser as it downloads data points from Thingspeak – assuming the system is still running – started 2016-9-1 😉 This is a small 110AH 12V lead acid battery charged by about 200W solar panels – the spikes in charging are from clouds going by + the cheap PWM charging regulator 🙂

Since initially creating this page I have realized that the D1 Mini NodeMcu I used contains a built in voltage divider so as to make the A0 pin compatible with 3.3V full scale input… Hence all the values below have a 3x margin built in and could be used with 3 times the voltage input. Here is the schematic of the D1 Mini.

Using internal 220K/100K divider with an additional 10Mohm resistor in series with the input the formula for the ESP Easy is:  %value%*0.1093
And the input voltage can go up to 100Volts.

Original Values:

For 20V max input (12V battery system) Calculator + another Calculator

Divider = 22K and 1.3K resistor

ESPEasy formula for analog input: %value%*0.0606

12V = 12V

13.7V = 13.7V

Ideas for future improvement:

Resolution with the ESP8266 10bit 0-1V input ADC with my current resistive divider comes to about .06V – good enough for battery monitoring but could be better

One way to improve resolution would be to use a 10V Zener diode in series with the 12V input measurement voltage, this would remove any voltage below 10V which is not necessary for 12V lead acid battery monitoring.

DIODE ZENER 10V 250MW SOT23 – for 12V battery monitoring.

DIODE ZENER 43V 250MW SOT23 – for 48V battery monitoring – keep in mind the DC-DC and voltage divider need to support 60V max input

Second Iteration using DC-DC converter draws only 1/2 Watt.

First Version using 7805 linear regulator draws 1W power

This is a static image of the data when the older dying batteries were replaced with a brand new lead acid on Sept 5th. The straight lines on the left side are when no data was being generated because the battery had dropped below the low voltage cutoff.

7 thoughts on “ESP8266 Battery Voltage Monitor Simple

  1. Thanks for the info. If I wanted to measure a fully-charged lipo (4.2 volts) what would I need to add in line (series) with the wemos d1 mini A0 pin?

  2. Hi Nick,
    To figure out what resistance you need you can use this calculator :
    You would fill in the values like this:
    Input voltage = 4.2V
    Output Voltage = 1V
    R2 as 100K because the D1 has 100K to ground as shown in its schematic here:

    The output should give you 320K for R2 ohm and since the D1 mini already has 220K ohm as R2 you only need to add an additional 100K in series with A0 pin to have 4.2V full scale. You may want to add 120K ohm to have a little bit more leeway on the max votage measurement.
    Let me know if you have any other questions.

  3. Chester thank you so much for this post. I took your suggestion and used a 10Mohm resistor on my D1 mini to measure the voltage of a car battery. once fired up I get 8 as a readout with nothing connected (before any correction or math) Then when I apply a 12V connection to the resistor i get a 24-26 Read out. with your math suggestion of %value%*0.1093 this doesnt get me close to the 12v I was hoping for. Any ideas? Thank you again.

    1. Hi Ryan, I am not sure what the problem is.. maybe your board has a different internal resistor? you could check that, or try a divider that makes sense for you, like .5 – and test it at different voltage inputs to see if it is valid.

Leave a Reply

Your email address will not be published.