TTGO ESP32 Read the LiPo Battery Voltage

Hi all,

I have a TTGO ESP32 that has a plug on the bottom of the board where you can plug in a LiPo battery to power the ESP32:
>>>>This is not quite the same as mine but it is very similar!<<<<

My question is can I read the battery voltage via software while the battery is plugged into the ESP32?

Thanks,

Zeb

I am also open to modifying the ESP32 so that I can read the battery voltage. (Like connecting a resistor from the (+) of the battery to a GPIO pin of the ESP32)

Thanks,

Zeb

Looks like, without actually having one in hand to examine, that the Vbatt+ would have tapped and put through a resistor divider and then the voltage read by an A:D and so on and so forth. I'd use one of the GPIO pins on the B port of the ESP32. All pins on the A port of the ESP32 can be configured as input/output. GPIO0 to GPIO32 are on port A, Port B are GPIO 33+ and are only configurable as input only, without pull ups/downs. Thus the GPIO pins 33+ are best used for A:D.

Using Arduino macros to access the A:D on an ESP32 will work but not as well as using the ESP32 A:D API Page not Found - ESP32 - — ESP-IDF Programming Guide latest documentation.

1 Like