ESP32 and monitoring battery voltage

Thread Starter

DJ_AA

Joined Aug 6, 2021
304
Hi

I will be powering the ESP32 using a Li-Poly battery.

I would also like to measure the voltage to give an estimate on the battery level, it does not need to be as accurate as a gauge.

I am thinking about adding a simple voltage divider circuit with 47K resistors.

Would this be sufficient?
 

ericgibbs

Joined Jan 29, 2010
18,766
hi DJ,
So that is 1.2V change, so using two 47k series would give 2.1V down to 1.5V change, which is only 0.6V.
That will be a very 'coarse' measurement of the battery voltage, is that OK for you.?

A 740 Bit change at 4096 for the ADC at 3.3v

E
 

sghioto

Joined Dec 31, 2017
5,380
If using the internal reference the voltage divider would need to reduce the voltage to or slightly below the reference when the battery is at 4.2 volts
 

Thread Starter

DJ_AA

Joined Aug 6, 2021
304
hi DJ,
So that is 1.2V change, so using two 47k series would give 2.1V down to 1.5V change, which is only 0.6V.
That will be a very 'coarse' measurement of the battery voltage, is that OK for you.?

A 740 Bit change at 4096 for the ADC at 3.3v

E
Well a Li-Poly Battery is active from 4.2V to maybe about 3.5V. Anything after that could damage the battery
 

Thread Starter

DJ_AA

Joined Aug 6, 2021
304
If using the internal reference the voltage divider would need to reduce the voltage to or slightly below the reference when the battery is at 4.2 volts
I agree I need to look at the datasheet again to confirm the reference voltage and then adjust resistors.
 

MrSalts

Joined Apr 2, 2020
2,767
Since ADC only outputs a ratio of 0 to Vcc, a voltage divider between supply and ground will be read as 127 no matter how you slice it unless you have a voltage reference, zener, or other some non-linear device in your circuit to act as VRef.
 

sghioto

Joined Dec 31, 2017
5,380
Since ADC only outputs a ratio of 0 to Vcc, a voltage divider between supply and ground will be read as 127 no matter how you slice it unless you have a voltage reference, zener, or other some non-linear device in your circuit to act as VRef.
The ESP has an internal reference of 1100 or 1200 mV depending on the model from what I have read
 

ericgibbs

Joined Jan 29, 2010
18,766
Hi,
As the ESP32 ADC is ratio metric when using the Vss as the Vref, it means the ADC will not show any change in battery level, so a fixed internal Vref must be used.

E
 

Thread Starter

DJ_AA

Joined Aug 6, 2021
304
Hi,
As the ESP32 ADC is ratio metric when using the Vss as the Vref, it means the ADC will not show any change in battery level, so a fixed internal Vref must be used.

E
This makes, sense, as long as the battery when I am reading is always about 3.3V, then wouldn't the VCC be adequate?
 
Top