Determining power consumption with Arduino and JeeLib I built a basic LED blinker to serve as a car theft deterrent. Originally I was using a 9V battery and delay() but I've refined my approach to consume less power. Here's my code, utilizing the JeeLib library:

#include &lt;JeeLib.h&gt;

int led = 13;
ISR(WDT_vect) { Sleepy::watchdogEvent(); }

void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     
}

void loop() {
  blink_quick();
  blink_quick();
  Sleepy::loseSomeTime(8000);
}
void blink_quick() {
  digitalWrite(led, HIGH); 
  Sleepy::loseSomeTime(250);
  digitalWrite(led, LOW);    
  Sleepy::loseSomeTime(250);    
}


It just blinks twice every 8 seconds. I also used 4 AA batteries as they have a higher amperage rating. How long should this system work before I need to replace the batteries?

My thinking is that AA batteries offer 2000mAh and an Arduino typically consumes about 45mA on average. If I were running the above code with delay() instead of the JeeLib functions, it would last for 44 hours. Let's call one cycle the two blinks and the following 8 seconds of rest. I am confused about how long I should factor in for the digitalWrite(led, HIGH) and the corresponding 'low' call, because the rest of the time, the circuit is using JeeLib. I am just interested in figuring out how long I can let this run without changing the batteries, and admittedly I am not experienced enough to tell definitively. 

Thanks!
What board are you using? For example, the Uno has a lot of other components that will consume power, even if you sleep the main processor. Instead use something like a Pro Mini. 

You can bypass the voltage regulator, and just supply 4.5v by using 3 AA batteries. You can even use just 2 AAs if you have the 3.3v version. The lower the voltage the less current the ATMega uses. 

Most importantly, measuring the power consumption using a multimeter. Measure the current the led uses. Disconnect the led, and measure how much the arduino uses. Use this handy Battery Life Calculator, and just fill in those numbers.

Run the led with the lowest current, where the led is still visible enough. Running a power-led at just 1mA will still give a decent amount of light.

In your situation, if coded correctly, power usage of the ATMega is negligible. The only real power user is the led. If you run the led at 1mA, and use a set of AA batteries, you get around 3.5 years of running time, no problem.