I have an ESP32-C3-MINI-1U dev board with a 1.28" round display (ESP32-2424S012C-I from AliExpress: https://www.aliexpress.us/item/3256806865394281.html?gatewayAdapt=glo2usa4itemAdapt). It mainly stays in light sleep mode, with the display backlight off. It wakes up with the push of a button (connected to GPIO pin, with internal pull-up) and once an hour (as I read elsewhere that if you set the sleep timer longer than 90 minutes, it fails). This whole thing is connected to a 500mAh LiPo battery. I'm getting only about a day and a half of runtime on a full battery. From the listed draw on the ESP32 in light sleep mode, I would have expected this to last a lot longer, even with the current draw of the input pullup resistor. I'm not sure what the display driver and touch driver use when not active.
Have you tried measuring the total current draw of your project when the chip is in sleep mode ?
If it stayed asleep all the time it should last about 160 days but what does it do when it is awake and how long is it awake.
On the hourly timed wakeup, it checks some internal variables and goes back to sleep. When I push the pushbutton (I did this maybe a total of 3 times for about 5 seconds each) it gets the time from the RTC and updates the display.
There is no way of knowing how much power it uses everytime you push the button but lasting only one and a half days does seem quite short.
I'm currently investigating the possibility that it's the display controller and capacitive touch controller. The TfT_eSPI and CST816D libraries don't have sleep commands, but I did see that the chips can take them over SPI and I2C respectively... I've found the specific commands and have added them to the libraries. I'm going to re-charge the battery, and try the test again...
I can't find specs on the current usage of the GA9A01 itself when active, but for the CST816D it seems to be about 2mA
You really really really need to measure the current in sleep mode and running modes that will identify possible issues within a couple of minutes.
You could spend days and days using the alleged capacity of the battery (500mAhr) as the measuring device.
Some tips here;
https://stuartsprojects.github.io/2018/09/09/measuring-low-currents.html
Why do you use light sleep?
If you fail to measure current consumption of the device in sleep mode, then there is nothing to do here.
Also, you are not giving enough information about the battery. Model, brand, output voltage (you have to measure this, over the time would be great, once per hour or something like that). You dont provide information about the full charge voltage, neither the power off voltage.
You also state that the screen backlight is off, but it is still powered on. Maybe you need to turn it off.
Sometimes these kind of boards, while having built in battery management , are not anyhow optimized for battery life. They might have inefficient boost converter boosting battery voltage to 5V and then inefficient voltage regulator dropping it to 3.3V.
How long does the display backlight stay on after you push the button?
Actually, this sounds like a perfect candidate for powering down the entire circuit, then having an RTC turn on the power once an hour. Or the pushbutton could turn it on. Then the ESP32 would turn off the power when it's done what it needed to do. You would need an external RTC (DS3231) powered by a coin cell, a P-channel mosfet, and an NPN transistor.
Edit: Well, you don't really need the NPN.
The system is only active (including backlight) while I'm pressing the button. When i release the button, it goes out immediately. I added the code I found to put the display driver and capacitive touch controller into sleep mode, and wake them when the button is pressed, and that took me to 42 hours total... Withe the ESP32 in light sleep mode, the backlight set to zero, and the display controller and touch controller in sleep mode... Out of the about 42 hours that the battery lasted (given the last time I checked it) I had the button pushed for a total of 90 seconds. The rest of the time it was in sleep mode (other than the 5 - 6 milliseconds it was awake from the timer each hour, adding maybe another 0.2s tops)
I'll be getting a CrowPanel 1.28 round display soon, with an external I2C RTC and hopefully better battery controller / DC-DC converter. Luckily, the display driver and touch controller are the same as this one I have now. Maybe I can get it to last longer.
Firstly, I'm using light sleep so that the RTC continues to function and keep time. Deep sleep would turn that off too.
Other than disconnecting the battery I can't measure it. I also don't have an ammeter hooked up between the board and the battery, so I can't really tell you that either. Battery is KBT 3.7V 500mAh Li-Polymer Battery: 503035 Lipo Rechargeable Lithium-ion. As for the backlight, the LED for the backlight is controlled only through a GPIO pin that goes to a MOSFET. I set the GPIO output to zero. I don't see any other means to turn it off.
Do you have a suggestion for an inexpensive voltage and current monitor that can be plugged in with this board & battery and can monitor without interfering with the board? The board and battery use a JSP 1.25mm 2-pin connector.
I ordered a set of alligator clips for my small (and very cheap) multimeter. I'll see if it can accurately measure the current while the board is in sleep mode. I don't have an expensive one (as in the suggested article above)
Is the hourly wakeup only done to make sure the RTC in the ESP32 continues to work properly? If you didn't have to worry about that, would you have it turn on just when you're pressing the button?
Do you recall what mosfet you are using for the backlight?
Oh, on this particular board, I can't do that... the ESP32 "properties" library isn't saving any of the data that I would like persisted, and it doesn't have an external RTC. The CrowPanel I'm getting will have SPI Flash, and an external RTC, so I could power down the whole thing if I could figure out how to tie into the RTC to power it all back up again at a configured interval.
So, the CrowPanel uses a TP4054 for the charge controller, and to output 5v and a RT9013-30PB to convert that to 3v. The FET for the display on that one is a HXY2102EI. I have no clue how those compare to the current board I have. I do know that the RTC (a BM8563EMA) on the CrowPanel only has (from what I can see) I2C lines as output. No GPIO. It does have an INT line, but that's not connected to anything.
Could you connect to the INT pin (solder a wire to it)? Can you link to a schematic of this CrowPanel?
Well, here is an example of a circuit that uses the INT output of an RTC to switch power on and off:
But that would require that the RTC be powered separately - usually by a coin cell.
I know the CrowPanel has a cell battery as backup. it connects to the VDD pin through a pair of diodes. One diode going to the cell battery, the other going to the 3.3v VCC for the ESP32 (from the 5v - 3.3v DC-DC converter). To turn everything "off", with INT and a switch, the source of the P-FET would need to be connected to the VDD_RTC (so it's either the cell battery, or the 3.3v VCC. the gate of the FET to the INT pin of the RTC and the switch (again with diode to prevent reverse current into the INT of the RTC), and drain to the EN pin of the 3.3v voltage regulator. So, either INT is low, or the switch is low enables the system. I'd have to cut the pin or the trace of the EN pin, Same with the INT on the RTC, and then do some drilling and really fine soldering... Here's the schematic of the CrowPanel...
CrowPanel ESP32 Display 1.28(R) Inch_V1.0_240507.pdf (324.0 KB)

