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].

The Linux Throwie: Powering A Linux Server With A 0.3W Solar Panel

Have you ever had one of those moments, when you’re rummaging through your spare parts heap, and have a rather bizarre project idea that you can’t quite get out of your head? You know, the ones that have no clear use, but simply demand to be born, of glass and steel and silicon?

This time, the stubborn idea in question was sort of like a solar-rechargeable LED throwie, but instead of a blinking light, it has a fully cloud-accessible embedded Linux server in the form of a Raspberry Pi 3 Model B+. Your choice of embedded Linux board should work — I just happen to have a lot of these due to a shipping error.

There were two main challenges here: First, it would have to combine the smallest practical combination of solar panel, power supply, and Li-ion cell that could run the Raspberry Pi. Second, we’ll need to remotely activate and access the Pi regardless of where it is, as well as be able to connect it to WiFi without direct physical access. In this article we’ll be dealing with the first set of problems — stay tuned for the rest.

Continue reading “The Linux Throwie: Powering A Linux Server With A 0.3W Solar Panel”

Wake Up! The Cat Came Back!

In order to get the most out of the batteries connected to your microcontroller, you’ll probably need to put it to sleep, the deeper the better. [Rgrokett] was curious about the nighttime habits of his cat, and came up with a nice little hack to get more battery life out of the ESP8266 that he was using.

[rgrokett]’s cat enters and leaves through a cat-door. He figured a PIR sensor would let him know when there was movement around the door. He could then tell if the cat was around. Leaving the PIR sensor and the ESP8266 microcontroller (an Adafruit Huzzah) on all the time drained the batteries pretty quickly, so [rgrokett] decided to try putting the Huzzah to sleep.

The trick in this build is that the PIR sensor is used to reset the Huzzah when it triggers. The Huzzah requires the reset switch to go from high to low, but the PIR trigger goes from low to high, so a transistor is used to invert the PIR sensor’s trigger signal. When the Huzzah wakes up, it connects to the WiFi network and sends [rgrokett] an email via IFTTT ([rgrokett]’s description goes over the steps to set up a secure connection to IFTTT.)

It’s a pretty simple hack, but it increases [rgrokett] system’s battery life from a couple of days to more than a month (he’s still waiting to see how long they’ll last) and all that was needed was the microcontroller, the sensor and a couple of parts. We have a couple of older hacks about putting the ESP modules into deep sleep, such as this one, and check out this tutorial on PIR sensors.

ESP8266 Lullaby

The ESP8266 is certainly a versatile device. It does, however, draw a bit of power. That isn’t really surprising, though, since you would expect beaming out WiFi signals to take a little juice. The trick is to not keep the device on all the time and spend the rest of the time in deep sleep mode. [Marco Schwartz] has a good tutorial about how to use this mode to run for “years” on a battery.

[Marco] notes that even using a 2500 mAh LiPo battery, he only gets about 30 hours of operation without sleep. By putting the chip in sleep mode, the current consumption drops from about 88 mA to just over 8 mA. That’s still high, though, because the board has a power LED! By removing a jumper or cutting a trace (depending on the board), you can drop the current draw to about 0.08 mA (80 uA) when it’s not doing anything.

Continue reading “ESP8266 Lullaby”