Wireless Sensor Battery Life 2 Years On

2 Years and still going strong
2 Years and still going strong

Back in November 2011 when I made my first ATmega328 based wireless temperature sensor node I did a rough calculation estimating that it would last 2 years or more on a couple of AA batteries. That first node was decommissioned after a few months but the second version, also based on an ATmega328 is still running and on the original set of batteries since 29 December 2011, exactly 2 years ago today.

That’s with an ATmega328P running at 16MHz with a RFM12B radio and DS18B20 temperature sensor powered from 2 x Energizer alkaline AA batteries (essentially the same as the new SMD Tiny328 nodes but built on stripboard) and is transmitting once a minute. The battery voltage is now down to 2.71V which is well out if spec for a 328 running at 16MHz but the datasheet specs seem to be very conservative and it is still ticking along fine. Previous tests showed that it should be good down to around 2.6V with the DS18B20, below that the sensor’s readings start to become erratic. Again, that’s a good margin less than the minimum of 3V stated in the data sheet.

Two plus years is inline with my original predictions but it is good to see it actually happen in the real world, particularly as this node started out on code that wasn’t quite as optimised for low power use and since I enabled ACKs at the end of August 2012 it makes quite a few retries (it is the furthest from the base station) so in reality it often sends more than once a minute.

My first ATtiny84 based node (the original stripboard prototype for the TinyTX) with a TMP36 sensor is also still going strong after 22 months and is currently at 2.97V, this one is running at 8MHz using the internal oscillator and also running from 2 x Energizer AA batteries. The analogue TMP36 sensor is obviously better for low power compared to the DS18B20 but I found it was a nuisance to calibrate so I’ve stuck with the DS18B20 in all my other temperature only nodes as they are so much nicer to use and 2+ years battery life is plenty, in fact I never even bothered to reduce the sensor resolution I mentioned here, leaving them all at 12 bit.

Here is the graph over 2 years for the 328 based node, I think you can see the slightly steeper decline start once the ACKs were added at the end of August 2012.

Battery voltage over 2 years
Battery voltage over 2 years

Good result I think.


13 thoughts on “Wireless Sensor Battery Life 2 Years On

  1. Hi Nathan,

    I’ve built a couple of TinyTX v2 in March/April 2012 following your post about it. They also have a DS18B20 and an Atmega328P-PU and are mounted on a stripboard. I am also using two AA batteries (mine’s are cheap ones not Energizer) and they’re running quite well since then but, not for more than 6 months for each couple of batteries…

    This post lead me to think what can possibly be wrong with my circuit or code since the running time difference is quite large.
    I can do the test but a difference of 18 months seems too big to me to give the culprit to the cheap batteries I’m using…

    Can you point me what is exactly the code you’re using on that sensor?
    I’m pretty sure that the code I’m using in my TinyTX v2 already have all the energy consumption savings running…
    Definitly, I need to investigate.

  2. Humm,

    I think I have some unnecessary clutter on my code (my own imagination).
    I’ve ordered some PCBs for the Tinyv3 (thanks for the Gerbers) and I will work on a couple of new nodes with the DHT22.
    I’ll stick only to the strictly necessary and use some good batteries, to see the difference.
    Thanks for your input.

  3. Hi Nathan,

    When running on 2xAAs, are you bypassing the 3V3 regulator? I cannot see a “raw” VCC input in the schematics. The reason I am asking is that I am thinking of building a pair of your boards and would like to run on 2xAA.


  4. Hi Johan,

    Are you looking at the Tiny328? The TinyTX I was referring to in this post is the ATtiny84 based board and doesn’t have a regulator.

    On the Tiny328 I’m connecting to the 3V3 pin when using batteries which bypasses the regulator. The regulator I used was chosen specifically because it doesn’t cause a drain when bypassed in this way, unlike say the MCP1702.


  5. Thanks. I found out after reading the schematics which I should have done in the first place 🙂 I have gotten my Tiny328 boards from Seeed (thanks for the gerbers!) and have figured out how to do hot plate SMD mounting. In all I currently have four nodes (one acting as a Raspberry Pi gateway) and this stuff is amazingly fun 😀


  6. Hello,

    Sorry the off-topic, but @Johan can I ask you how are you using these on the Raspberry Pi? I would love to convert my Pi to act as the gateway…

  7. @Luís: I first used a breadboard to connect the Tiny328 to the Pi expansion header but just this week I got the PCBs of my own design from Seeed so now I have a board pretty much like the RFM2Pi board Martin Harizanov et. al. designed. You can get one of those at openenergymonitor.org. I designed my own as I wanted to learn basic PCB design in Eagle 🙂

  8. @Johan,

    Can I ask for the ping wiring between the Tiny328 and RPi and how are you receiving the data at the RPi side? Storing locally or uploading to emoncms/xively.
    Thank you.

  9. Have a look at the pinout for the RPi connector. Connect 3.3V, GND and UART TXD/RXD (RPi pins 1, 6, 8 & 10) to the corresponding pins on the Tiny328, there is enough juice in the RPi to power it. Next you want to prevent the Linux kernel from hogging the RPi UART for kernel printks, have a look at https://github.com/lurch/rpi-serial-console. Next step is to get the data into emoncms, I use a python script, running on the Pi, that uses ‘pyserial’ to connect to the UART, decode the prints from the Tiny328 and the uploads it to emoncms using the python package ‘requests’ and the emoncms API. I am rather sure you could grab the source for the RFM2Pi board and run it pretty much unmodified on your Tiny328 and I am also sure everything on the Pi side is available in the Open Energy Monitor project. I just have not had a chance to look at it.

  10. i am pretty sure that with your pointers I can manage to get it working.
    Thank you very much Johan.

  11. Do you estimate this would have lasted about 1 year with the DHT22? I think I remember reading here that it turns off at ~2.8v.

  12. When I tested one with a DHT22 on a variable supply it stopped working at around 2.96V so you might just make 12 months, maybe a little less, I had one running that way for 6 months but added a boost converter after that so never got to see how long it would have lasted just with the batteries.

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.