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].
thanks Jenny, keep ’em comin’
#esp32 #esp8266 #lowPower
“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?
And maybe reduce the TXpower to 1dbm, there is no need to shoot messages at 18dbm.
You will not save much, the vast majority of time the ESP is in RX mode anyway.
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..
Or even better, just use a static IP.
I think the ultimate option is to craft your own wifi frame with some values in there:
https://arduino.stackexchange.com/questions/49241/send-custom-802-11-data-frame-with-esp8266
CNLhor did it in his video “Aggressively Low Power with the ESP8266”:
https://www.youtube.com/watch?v=I3lJWcRSlUA
ESP-NOW is the answer if you want to drop the power significantly. It reduces the ON and Wifi time a lot. As always, there is a good video about it https://www.youtube.com/watch?v=6NsBN42B80Q
Bigger and more expensive battery + slower updates is not that impressive.
Wow I had very very similar challenges for my https://trandi.wordpress.com/2019/11/25/esp8266-temperature-logger/ but I could only manage 3-4 weeks before recharging the battery, even after sleeping and the RTC memory, etc. …
It’s probably because I’m checking for WiFi every 5 mins when I do the measurements, I should reduce that to a few times a day, as that is by far the biggest power usage…
Great article, thanks very much!!
Interesting, but I don’t see the code and schematics on the blog. Maybe it shouldn’t make it to Hackaday without those.
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.
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.
In this case the main part is the software though. ESPs are well known.
From the article’s comments: Sampled every 15 minutes for the entire year.
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.
Amen. You’re sharing & others are bitchin’. Tsk, tsk.
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 :(
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!
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..
Yes… that’s the hacker spirit… why have what you need when you can have what’s available…
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!
Replace the ldo with a 0.7v forward bias diode. Gives 3v to 3.5v
I have almost the exact same setup only powered by three AA cells. If you have two ESP8266 units and switch from WIFI to the ESP-Now protocol (one usb powered receiver and battery powered sender units) you can bring the duty cycle to under 500ms. I would imagine this would give you at least a 30% boost to battery life. It did for me when I switched from WIFI to ESP-Now.