Powering through Lipo batt but also charge through

Started by hakolsound, August 05, 2022, 01:27:33 PM

Previous topic - Next topic

hakolsound

Hi all,
Kinda new here, just bought and successfully implemented irisdown timer on a couple of esp32 boards.
I would like to power those up with a lipoe batt but at the same time to be able to connect a 5v power supply in case the lipo batt is empty to power the board and charge the batt.
Can you help out with what goes where?
Cheers,
Ron

LubOlimex

Which board do you have? Most Olimex-made ESP32 boards have Li-Po battery charger implemented and it allows to have 5V attached at the same time. If 5V external or USB power are present the board gets powered from it and the battery gets charged, if 5V are missing the board gets powered from the Li-Po battery.
Technical support and documentation manager at Olimex

laskov

Hello,

is there example for power monitoring - 5V_Presence and Battery_level ?

ESP32-EVB-EA-Ind

LubOlimex

First you need to set the hardware to enable "Battery Measurement".

By default the function "Battery Measurement" is disabled by the state of an SMT jumper. The jumper "BAT/BUT1" is responsible for "Battery Measurement". This is done because the function uses one GPIO/ADC pin and not everyone needs this function, so we have disabled it by default but left the option to enable it relatively easy. You need to change the state of "BAT/BUT1" - by default the position is BUT1 so you need to separate that connection (cut between the pads) then solder the other position GPI34/BUT1 position.

This will set the voltage divider to GPI34.

To understand better the jumpers I would recommend checking the "Power Supply" section of the schematic:

https://github.com/OLIMEX/ESP32-EVB/tree/master/HARDWARE

About the code, it is not something special, there are hundreds of examples on how to use ADC pin and voltage divider to measure battery.

Notice that ESP32-EVB has no battery sense option. This is due to lack of free pins. Such option is present in our other ESP32 designs like ESP32-PoE, ESP32-PoE-ISO, among others.
Technical support and documentation manager at Olimex