While the ESP8266 has made its way into virtually every situation where a low-cost WiFi solution is needed, it’s not known as being a low-power solution due to the amount of energy it takes to run WiFi. [Alex] took this design constraint as more of a challenge though, and with the help of an ATtiny microcontroller was able to develop a weather station using an ESP8266 that only needs new batteries every 2-4 years.
While the ESP8266 module consumes a bit of power, the ATtiny excels in low-power mode. To take advantage of this, [Alex] designed the weather station using the ATtiny to gather data every two minutes, store the data in a buffer, and upload all of it in bursts every hour using the ESP8266. This means that the power-hungry WiFi chip can stay off most of the time, drastically limiting the power demands of the station. [Alex] mostly details the setup of the ATtiny and the ESP8266 on his project page, so this could be applied anywhere that low power and network connectivity are required.
As for the weather reporting capabilities, the station is equipped to measure temperature, light, and humidity. Presumably more could be added but this might increase the power demands for the weather station as a whole. Still, changing batteries once a year instead of once every two years might be a worthwhile trade-off for anyone else attempting such an ambitious project. Other additions to the weather station that we’ve seen before might include a low-power display, too.
38 thoughts on “Weather Station Needs Almost No Batteries”
This is the only way to use an ESP8266 in a battery-powered IoT device.
Depends a lot on the application. If you cannot make the compromise of sending a lot of data at once because you want real time values, then this approach does not help you much. Unfortunately WiFi is power hungry and the ESP processor itself is quite inefficient as well.
Even longer if it is possible for your use case:
Andreas Spiess has a number of esp8266 videos around power usage. his channel is a must watch for everything esp8266 related.
Not much use nowadays for 1 hour old weather data… is it?
If an extra micro is added, why not use some more efficient radio modules between the micro and the esp which can go inside the home?
Or the classical weather station approach…solar power!
Yeah, if you aren’t getting any readings, you know the weather is shit
I imagine the goal here is more to have historical data of weather conditions throughout the day, since it’s actually measuring and storing data every 2 minutes, but only pushes it upstream on the hour.
This could be a very interesting but simple use-case for so called edge-computing (or maybe fog-computing if I have understood my IoT buzzwords). If the temperature is normal (within normal bounds for the day of year, time of day), store it and send it later. If the temperature falls outside of the norms, send it now. (or maybe send it n times to get attention).
The array of “norms” could be pushed to the device, say, weekly. This way you are pushing some degree of autonomy to the edge device, saving battery and still performing as a real time alerter . What do you think?
I’m no buzzword expert, but a pre-processing stage on the raw data is never a bad idea. And if radio time is a scarce commodity, doing it up-front sounds like a winner to me. Good idea.
Good application for e-ink displays. Wonder if any will survive the elements. Maybe wrapping the display in plastic wrap is enough
Be interesting to try something similar on the ESP32 which has funky multi-processor set-up (and BLE).
You can probably just cut out the attiny and use the ULP coprocessor in the ESP32, as long as your sensors are i2c or analog. The ULP can read the i2c bus and ADC and access memory while the two main cores are sleeping.
I was having high hopes for that ULP coproc, but it is very limited and very difficult to program. It would have been cool it if was say…an complete 8 bit core that could do anything slow and low power, like having that attiny inside the esp.
I want to see some projects that use the ULP unit. Anyone know of any?
I’m trying out tpl5110 in the adafruit breakouts.
Little power switch timer you can use between 1.5 and 5V to cut power.
35nA in standby but you have to set the time to sleep with a resistance. The sleep time varies with the resistance to ground at power up.
When you want it to sleep you set a pin from low to high , it cuts power and sleeps for the period set.
ESP8266 has a deep sleep mode which works very well – you can set the interval, and have it wake by tying reset pin to D0/wake pin. You can also power up just the processor, excluding the radio modem. It would be interesting to compare such an implementation with the separate tiny even if only on paper.
But you also need to deep sleep any peripherals or sensors as well.
The attiny method above could cut power to everything.
The TPL5110 im using does just that, Ive got it set up so that even the voltage regulator has the power cut.
Also the voltage divider Im using to keep an eye on the batteries. Sensors or peripherals would be using power if I had just used the deep sleep of the ESP8266. Also there seem to be issues with the ESP8266 and DHT22 Im using that can cause the deep sleep to fail and the ESP83266 to lock up. As the TPL5110 cycles the power completely it hasnt been an issue.
My electronic skills are somewhere around “putting something together and hoping that it works”, but shouldn’t you be able to power the peripherals from the GPIO, if they are less than 12/20mA each?
I have a ESP8266 with 5 x DS18B20’, 1 x light sensor from a garden light, and 1 x DHT-something in my greenhouse which have been sending data to Azure every 30 minutes (15 in the beginning) for +1 years now, on a single set of batteries, where I power them (sink) through the GPIO.
I’m going to replace it this winter, but only because I’m connecting the greenhouse to the grid, so I can switch to hydroponics.
I think you are optimizing in the wrong place. Sure, the ESP takes 25uA to sleep which is a lot, but the biggest inefficiency is when it is active. If you really want low power, use other radios. I am using RFM69 + micro in my projects, in best case scenarios i can wake up, measure, send and receive ACK within 10ms. In that time the ESP does not even get to open its eyes from sleep mode…
I do wish that the programmable NRF chips would be more popular, the 8051 CPU on the NRF24LU1+ is interesting, evn without that I’m partial to nrf24l01 myself. Though both RFM and NRF chips are mostly used in a setup that’s similar to this ATtiny+ESP way but with an extra radio module somewhere.
I used to want that and started my first deigns with NRF24l01 (actually RFM75). Never managed to get the range reported by others within the house – maybe the >30 WiFi networks i can see has something to do with that. Went to RMF69 and i have no problems now, >99% of packets go through the first attempt over even longer distances.
TSL2560 sensor used for luminosity is obsolete. I tried two other I2C sensors w no luck. Can anyone recommend an I2C luminosity sensor?
there are more similar sensors to that one. if you go to mouser for example “Light to Digital Converters” will have plenty.
There are also analog versions, photo diodes designed to have the same response as a human eye, so you don’t use crappy LDR. I like them more because they come in 3mm LED packages which makes it easier to install in a case.
That’s my usual mode of operation – except I’m more of a digikey guy, sorry Grant Imahara lol. Anyways, I first tried this one because it was texas instruments and they document pretty well
but couldn’t get a response, so I tried this one because the datasheet looked more simple:
I get a response but can’t pull data :/
I’m using an ESP32 so I’m looking for one someone has already tested on that or at least the esp8266.
I have other I2C sensors on the same board that work great (temp/hum and power). You can check out my project here: https://www.digikey.com/product-detail/en/ams/TSL45315CL/TSL45315-CLCT-ND/3095326
Oops I meant you can’t check out my project here: https://github.com/physiii/liger
Can I not edit my previous post? What gives?
The TSL2561 was the replacement and it has worked great with my ESP8266 projects. Then – last year maybe? – an even newer version came out with significantly improved dynamic range (which allows me to pretty much leave the gain settings alone now), the TSP2591. I think I picked up a breakout for it from Adafruit.
I can’t find TSP2591 on mouser or digikey, everything is about the Adafruit which I don’t want.
I’ve been using an ESP8266 as MQTT doorbell. It also sends it’s voltage on every press and runs on 2 AAA alkaline batteries. It’s has been pressed 540 times in 7 months of time and the voltage is now around 2.55V, it started at 2.93V. So you can use an ESP alone on batteries. Key is to not use DHCP and use a static IP configuration,
yeah, however even with those measures, when you swap the button for a temperature sensor that updates every minute, the battery life is poor. You can get into more tricks – start without wifi, check if temperature has changed and update only if the difference is high enough. But this might get you 2X improvement.
How are you reading the voltage Andre? Is this a feature on the ESP8266 ?
I figured this was going to use the anemometer to recharge the battery. That would have been pretty neat. You’d have to monitor the charging load though so that you could compensate for it when you read out the wind speed value.
or just stop charging when you take a reading then resume charging. only requires one (extra) transistor
Where is the link to the image?
What is this wordpress?
https://mzkaga-dm2305.files.1drv.com/y4mKG-V8BUBoFpWJzdjfUzRZ35RL_rTlquw4sdthib55UpWqsMxPHbpf4UX-fOSMHhKfyhy8dOMG_y5FR8Z3GMEMlt3CqnEk9Q6HXI-vtN3A2msWBzfIxZDHjvn8ecsz40_IrS0m9TiaC6Apm5b0wM7rpyj4KJYBUG0ceC4evnZQtNJ8iwrr286R0gr0I55qv9Owrp3k-MfpRzJGc_Wp_5vDg?width=1280&height=800&cropmode=none” width=”1280″ height=”800″
Maybe, this will work
If I could interface my 1-wire weather station to work with an ESP in realtime, that would be a nice one. 1-wire isn’t power hungry and the extra consumption of the ESP can be obtained from solar panels or even a small wind driven generator.
My weather station has been running for almost one year and the battery is still nearly full. Gotta’ love solar panels.
Here is a comprehensive introduction to the weather station and maybe it is useful for you.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)