Sensor Board Power

The board takes power from a JST-XH connector, up to a maximum of 6v, which is currently provided by 3 x AA cells. I've got a number of batteries under test to see how each type works out.

Current, running, boards use an AP2112K-3.3TRG1 LDO but this has a quiescent current of 55uA. This is due to be swapped out on new board with the Holtek HT7833 which has a much lower quiescent current of 4uA.

There's another option, to go for a LiFePo4 battery which would bypass the need for the LDO completely. this requires some investigation.

Current Measurement

Measuring the current usage with my cheap multimeter highlights a problem. Burden voltage of the multimeter. Manual switching sometimes works (with some meters) but a much more useful piece of measuring equipment is the Nordic Power Profiler Kit II.

As it stands this is the current consumption when using the AP2112K-3.3TRG1 LDO

Operational Mode Current Consumption
Wake 106mA
Hibernate 79.5uA

Code Matters

One of the considerations for the ESP32 in low power modes is the state of the GPIO pins. Taking measurements from the board while it was in hibernation mode revealed a current consumption of 156uA which is excessively high. It appears I'm not the only one who has had this problem, Toby Jaffey directed me to a post on Stack Exchange Electrical Engineering.

Toby Jaffey

The post goes into detail about how SDwarfs got to their final conclusion and implementing the result suggestion there reduced the current consumption to around 79.5uA. This is a somewhat astonishing amount, and for almost zero effort. Couple that with the expected reduction of around 51uA from swapping out the LDO and we're really making some headway on this.

// gpio_reset_pin(GPIO_NUM_2); // Issues with NOTIFY_LED

I needed to ignore GPIO2 and not reset it because I have a notify LED attached to that.

In addition the this I'm still using DHCP and DNS for configuration and returning the IP address of the MQTT server but in all honesty these functions are perfomed on a local router that's more than capable of responding in the sub 10ms range. I'll test with fixed IP addresses but I'm not convinced this will make a difference and the trade off between configurability and speed isn't worth it for me, at least right now.


Having swapped out the AP2112K-3.3TRG1 LDO for the Holtek HT7833 the results below are better than the expected 30uA and I suspect that I could improve on that by around 12uA if I didn't monitor the battery. I'll look at ways to enable and disable the voltage divider so that it can still be used but draws no current when disabled.

Operational Mode Current Consumption
Hibernate 23.5uA

That's a nice reduction of 55uA. I need to verify but my measurement for the wake time does appear to have dropped too.

Swapping out the LDO is straight forward and is a pin-for-pin swap. Nothing to worry about other than putting the new LDO on the board, instead of using the old one.


AP2112K-3.3TRG1 LDO [SHA256 ef8d376f2ec356e29172eb9e053819a0ebdcc576dba7fc9ab0505c568427920f ]
Holtek HT7833 [SHA256 9da877e5b50e6901609c34e5c6a592cbe31dd70bcbbbbd64b5b44e3b293f0e08 ]