Sunday, 15 January 2012

Home Wireless Sensor Network - Battery Life

In my last post I mentioned building some battery powered wireless sensors. There are several choices to make about what kind of batteries to use.
  • Rechargeable or non-rechargeable.
  • CR2032 (~220mAh) or 3xAA (800 - 3000+mAh depending on price).
  • Battery brand - there are so many, argh!

It seems likely that for battery life reasons I will go with the 3xAA approach. What kind of battery life will this give me? This requires that I work out the current use of my planned circuit. Time to consult some datasheets!

If all of these components were active I would need 8.35mA. Lets round that up to 9mA. Lets also assume that I use a 2500mAh battery. This gives the following battery life.

  • 2500 / 9 / 24 = 11.5 days

I don't want to change batteries every 11 days - I can do better by putting the components to sleep when they aren't being used.

Let's assume that I only wake up the circuit to transmit a reading every 5 minutes and that the wakeup lasts for 30 seconds - I will need to transmit the reading 3 times to try and ensure that it gets through. This means every 60 minutes the circuit is at full current 12 times for a total of 6 minutes. The remaining 54 minutes the power usage will be as follows.

  • ATTiny85 - 0.0001mA (sleep mode)
  • TMP36 - 0mA - assume I can disconnect from PWR e.g. with a transistor
  • RF Transmitter - 0mA - assume I can disconnect from PWR e.g. with a transistor

This gives an idle power usage of 0.0001mA. The overall mA/hour requirement is as follows.

  • (54/60) * 0.0001 + (6/60) * 8.35 = 0.84mA
  • 2500 / 0.84 / 24 / 7 = 17 weeks = 4+ months

Much better!


  1. Don't bother using a transistor to switch the external components.

    Assuming that they run at the same voltage as the tiny, then just connect their power to a GPIO on the tiny, and switch on / off with digitalWrite.

    Remember to allow for settle time after powerup though - especially for the temperature sensor.

  2. They all run at the same voltage. Do you know the max current that an ATTiny can drive out its pins? I couldn't find that in the data sheet.

  3. See section 21.

    Roughly: 10mA source or sink per pin, 60mA max total (@ 5V).