Categories

Archives

Elsewhere

     
       

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.

 

11 comments to Wireless Sensor Battery Life 2 Years On

  • Luís

    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.

  • This is the code I’m using:
    https://github.com/nathanchantrell/TinyTX/blob/master/TinyTX_DS18B20/TinyTX_DS18B20.ino

    I’ve got quite a few that aren’t far behind the 2 year one, they are all on decent batteries but I wouldn’t have thought cheap ones would make such a big difference.

  • Luís

    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.

  • Johan

    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.

    Cheers,
    Johan

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

    Cheers,
    Nathan

  • Johan

    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 :D

    Cheers,
    Johan

  • Luís

    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…
    Thanks

  • Johan

    @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 :)

  • Luís

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

  • Johan

    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.

  • Luís

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

Leave a Reply


 


 


 

You can use these HTML tags
(links will be automatically marked with rel="nofollow")

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

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

By submitting a comment you agree that it can be reproduced under the same licensing terms as the rest of the content on this site.