5847

ESP32 is great. However, when need power by battery, the sleep current is still high. I'll explain here how I did to reduce to low as 0.5ma in deep sleep with extended input battery voltage.

For another application I'll detail later in another article, I have to find some ways to improve the power mechanism for the  ESP32 module. 
Most of the ESP32 module are using embedded USB port and powers the core ESP32 through a linear regulator type AMS117 3.3v (version of LM317). This regulator has the following spec:
- Dropout is 1.2V max 1.3v
- Quiescent current is 10mA
 In case of power by Lithium battery, it cannot really work as the input voltage must be 3.3v+1.2v = 4.5v
Moreover, the 10mA Quiescent current is a way too much for a permanent power under small battery.

The proposal hereafter will have the following specification:

- Provide up to 1A 3.3v with a lithium battery from 4.2v to 2.7v
- Protection against deep discharge (lower than 2.7v)
- Low consumption: under deepsleep mode, 0.5mA with EXT0 wake up mode
- Simple recharge battery by small 5v solar call with a stop charging at voltage 4.15v 

The proposal is based on the Buck-Boot IC from TI: TPS63070 and voltage comparator TPS3780 (both datasheets added in the document).

Buck-Boost power supply:

First, need to remove the AMS1117 from the ESP32 module with an hot air gun. Then, I use a slide switch to connect the 5v from either the USB (5v pin from the ESP32 module for debug) or from a battery connector. This switch is connected to the input of the Buck-Boost module (one position it will connect the 5V from USB plug or, in the other position, to a JST connector for an external lithium battery). 

The TPS63070 is a perfect candidate for that function. Quiescent current 50uA. Input 2-16v, output 2.5-9v. Max 2A.
The only issue is the packaging which is QFN and I cannot manage soldering it. So, I bought a module with that IC.
At first test, with the module, the current was not the expected one. I found that they put some pullup resistor (for the PD signal or Enable) too low. I have to change these pullup to 1M.
The module PS need stay in power save mode.
On my module (but not all the module has it), I remove the entry protection diode and the protection for polarity inversion as well.
After all of these modifications, the module was at 0.5mA without charge and 0.6mA with the ESP32 in deepsleep mode.
The output 3.3v of the module is connected to the 3.3v of the ESP32 module.

Solar charge and deep discharge protection:

For these functions, I used a voltage comparator TPS3780. It is hysteresis comparators, 2 in one IC, and the hysteresis is defined when you buy it: A is 0.5% / B is 5% / C is 1% / D is 10%.
It is quite tricky to solder with the pitch 0.65mm. On my mockup, I used a board with pitch 0.5mm...
TPS3770 is push-pull output, TPS3780 is open drain.
For this application I choose TPS3780 D which is 10% hysteresis.

One comparator is used for the deep discharge protection: Lower than 2.7v, it must switch off the power, more than 2.9v it will enable the power. The calculation following the datasheet gave: R1= 1.07M R2 = 750K
The output (open drain) is 0 when Vsense < Vit- and open when Vsense > Vit+. So, this signal need to be inverted with a N mosfet to enable the power P mosfet A3401 which connect the battery to the Buck-boost module.

The second comparator is for stopping the solar cell to charge the battery if the battery level is more than 4.15v (secure regarding the 4.2v) and the charge will restart when the Vbat is lower than 3.8v.
So, R3 = 2.155M / R4 = 620k.

Another mosfet with a diode in serial will drive the current from the solar cell to the battery.

Conclusion:

I have now an ESP32 cam with very small consumption. It stays most of time in deepsleep mode, and under one day of sunshine, the small 5v solar panel recharge 140mAh. The average current of the ESP32 + an external module is 1.3mA so one day gives around 4 days of autonomy.

Update January 2026:

- On another ESP32 cam, even with these modifications, the deepsleep current was stable at 18mA. I spent quite some time to find the root cause. It was the tantalum capacitor on the 3.3v which was defective and had strong leakage current (measured 300 ohm). I replaced it with 2 ceramic 47uF in //. Good to know... 

- There is a mistake on the schematic I did by hand: The switch transistor on the solar panel line cannot be a mosfet due to internal reverse diode. In fact, on my mockup, I put a PNP like 2N2907 with 10k on the base and 100k pull up between Emitter and Base... Sorry for that.