One ESP8266, One Battery, One Year… And Counting.

There are times when a sensor is required that does its job without the need for human attention over a long period, and for those applications a minimal power drain is a must. [Dave Davenport] had an EPS8266-based moisture sensor, and became disappointed in having to replace its AA batteries every few months. With an 18650 Li-ion cell and a bunch of power-saving tricks that time has been extended so far to over a year and still going, so he’s written a blog post detailing how he did it.

Some of his techniques such as turning off the sensor or using a better LDO regulator than the stock Wemos one are straightforward. Others though are unexpected, such as using the memory associated with the on-board RTC to store the WiFi connection info and channel number during sleep. The normal ESP8266 connection sequence involves a network scan, by hanging onto what it found last time the extra time and thus power expended by it can be avoided. Similarly switching from a DHCP lease to a fixed IP address cuts the time the device waits for a lease and thus the time it has to stay awake.

We might not all have ESP8266 moisture sensors to build, but we’re many of us on a quest to sip less power in our projects. Let us help you with a previous sojourn into that arena.

ESP8266 image: connorgoodwolf [CC BY-SA 4.0].

23 thoughts on “One ESP8266, One Battery, One Year… And Counting.

  1. “The normal ESP8266 connection sequence involves a network scan, by hanging onto what it found last time the extra time and thus power expended by it can be avoided. Similarly switching from a DHCP lease to a fixed IP address cuts the time the device waits for a lease and thus the time it has to stay awake.”

    Switching off crypto would also save some battery?

  2. DHCP vs static IP, there are plenty of options to make DHCP lean and mean: use higher lease time (globally or by mac), disable arp pings, disable any extensions, set local dhcp server as authorative, and probably more..

    1. Even though multiple people asked for it (code, schematics); they got no replies.
      Author has right to keep hard work to himself, but (s)he should say so, not just not reply, and maybe it shouldn’t get on hackaday.

      1. There’s good reasons people may not want to share the code (poor quality. Integrated with other code, contains passwords, security holes, …), and it doesn’t mean it’s not worthy of being on HAD. Particularly when the main part of the project is hardware.

  3. Why the negativity? that is not very motivating! This is one of the reasons I don’t often blog stuff.

    Maybe I was still considering it? (I need to clean it up, remove credentials, etc.) and that is gonna take time. Something I am very low on and I have still lot of work to do on other (open source) projects I provide.

    1. Mate, good work for getting as far as posting what you have. I’ve got a number of projects I’ve never got round to posting at all.
      Don’t let the negativity get to you.
      And good work on the battery life! I used some similar tricks to get months out of a battery… never found the actual battery life as it was a plant monitor and the plant died before the battery :(

    2. This is unfortunately the internet. But hey, if you get haters you had an idea that made said haters expel energy to hate. Still a win. I call it the ‘Marilyn Manson’ effect; and it’s a damn good marketing property to have!

  4. Or just get a cheap xiaomi humidity sensor for less than $10, that lasts years on a single CR2032 and that updates many times per day… And it only measures something like 35x35x9mm..

  5. Looks like the battery is below the recommended range for those. Generally you’ll stop somewhere around 3.2-3.4v to not over discharge. This is great though, was just looking into a mailbox notifier and this post is perfectly timed. Thanks for sharing!

Leave a Reply to Grayson Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.