2025-06-22

Battery life

I am doing well learning my way with battery based circuits. But it has taken some time to get the hang of it.

ESP32 deep sleep

The first thing is the ESP32 can go deep sleep, with controls of some GPIOs that can have set states and be used to wake from sleep, or a timer. Using this with a simple LDO regulator from a 3.7V LiPo I know I can make a device that lasts for several weeks on a charge from a pretty small battery because the Watchy does this. The nice thing is this is deep sleep most of the time, with timed wake to update display every minute. It works, and I have made similar circuits myself.

Leaks

However, some of my designs are not as long lasting, maybe a few days of idle/off time. The reason is that the idle current needs to be very very low, a few uA. Deep sleep on the ESP32 is that low, which is ideal.

Well, except you can set GPIOs in some states and that could use current. If careful though, e.g. week pull on a GPIO input to a button which is not normally pressed, you can indeed keep the current that low.

But there is one annoyance that has led to standby times of more like a day, and that is the nice WS2812 style status LED I use. Its idle current when off is still typical 350uA, which, by comparison to the CPU is huge! There can then be other devices that use power, and even the LDO will leak some.

The solution was a simple pair of FETs to switch the LED off, though for a single status LED I could probably power directly from a GPIO, which may be a neater solution.

This has led to many days standby - well probably indeed the few weeks as I measured on the Watchy.

More LEDs

Once example where this was a lot more of a problem, leading to standby times of more like a few hours at most, was the IronMan glove with 88 LEDs, so idle was more like 30mA. That was a mistake, and one reason I wanted to improve things a lot.

Point of load / power distribution ICs

Whilst a simple pair of FETs works well for controlling power to LEDs, there are some devices really intended for this, which are very cheap, and really quite clever. An example is the TI TPS22916. It is tiny (0.78mm x 0.78mm), has power in and out, GND, and a control input, and that is it.

Its job is to switch power input to output, simple as that, but it has a slew rate to reduce input current surges, and the control input is a simple logic level, active high, that will switch from as little as 1V, so will work directly from a GPIO, no other external components at all. It also has thermal cut out.

This makes it much smaller and neater than a dual FET, plus two resistors, and better and safer (the slew rate and thermal cut out). It also has a standby of typical 0.1uA, so basically nothing.

This makes it ideal to control the LEDs, even when only one status LED.

But there is more

I think I can do better. The idle ESP32 has some current and the LDO will have some even when idle. What if I could eliminate almost all power usage when off.

This is my plan...

I'll explain...

This idea is the LiPo (the connector at the top) feeds in to two of these switch ICs. It could be just one if all I wanted was an on button. This idea is the button links the battery to the switch IC control - the switch IC even has a built in pull down so no extra component needed. When button is pressed power comes on.

Then a GPIO (PWR) is driven from the processor - if I only had one switch IC it would be linked to the button to logically hold it pressed. This keeps the power on until the processor commits suicide by lowering that GPIO level.

By using two switch ICs I can still keep things on from a GPIO, but by linking the button to a GPIO input, I can still detect the button pressed when on. Button press does nothing for power when power is already on, but the CPU can tell the button is pressed, and use that, including using it as a power off switch if wanted.

The concept is that when logically off (and this means no wake up on timer, properly off), the only leaking current is of the order of 0.1uA (x2) through the switch ICs. Not even leakage via the LDO or the deep sleep processor applies. This should allow the battery to last a long time, e.g. even a tiny 150mAh should last decades in idle, with the batteries own internal leakage being more of an issue.

So, ordering some sample boards to test.

No comments:

Post a Comment

Comments are moderated purely to filter out obvious spam, but it means they may not show immediately.

Faikin board ATE

The Faikin boards are a development board, a component to fit in to your Daikin air-con as your own project. However, I do try and make sur...