Chat freely about anything...

User avatar
By aphlox
#96593 Hi,
I have designed a Temp-Hum sensor for my homeassistant. I am using ESPHOME I have got issues with the battery life using a 18650 2200 mah Li-on battery. It last about a month and then need to recharge it. Any ideas to improve the life of the battery? Is there any improvement to be done or is this what I should be expecting running ESP on a battery?
ESPhome conf:
power_save_mode: none
update_interval: 1s
run_duration: 30s
sleep_duration: 10min

I'm using
    TP4056 Type-C 1S 3.7V LiPo charging board bms integrated.
    XC6203E332PR LDO regulator Output Current: 400 mA, Quiescent Current: 8 uA


Any help is appreciated.
User avatar
By btidey
#96600 I don't use EspHome myself but looking at documentation it would look like the run_duration in the config means that it will re-enter deep sleep 30 seconds after waking up. As you are waking up to measure and report every 10 minutes this means the esp8266 is awake for 5% of the time. Assuming 80mA current consumption while it is awake this would give an average consumption of 4mA. That will drain your battery in about 550 hours.

To get much better battery life you need to reduce the duty cycle of the wake to sleep time. Does it really need to be awake for 30 seconds to take the measurement and report it? If for example, you can reduce that to 5 seconds then you will reduce your average current by 6 times and get 6 times longer battery life.

Ignoring ESPHome for the moment it is possible to do a fast wifi connect, take a measurement, and report it in under 2 seconds which would give over a year of operation.