I want to create a temperature and event logger that I can stick in my attic, or attach to my steam boiler, to collect data for a week or more. I have a semi-functional prototype, but so far I've been deploying it using the wall wart from ladyada's starter pack. Does anyone have any advice about the best way to power an Arduino by battery, and whether it's even practical to think about having an Arduino project run for a week or two on batteries? From what Limor wrote in the MintyBoost design article, it sounds like a 9V battery would be a poor choice for this,and that a MintyBoost with a 'B' style plug would last longer. Would that work? Are there any other alternatives worth considering?

ladyada wrote:you can never go wrong with a 6V lantern battery :) stick a 1N4001 in series and boom, now you've got it down to 5.3V...safe for your arduino.

That's a nice simple idea. Thanks! A related question is, can I just attach the polarized power jack from my dead 9V battery holder to the battery/diode supply and plug it into the Arduino? I assume it's going to go through the 7805 if I do that, and I don't know whether to expect it to do anything wonky if it gets just 5V in.

Over in the Arduino forums, I just saw someone mention Rob Faludi's recent summary of Arduino battery lifetimes - using different batteries, sleeping or not, without or without a XBee, ... He apparently got 178 hours from 4 2500mAh NiMH AA batteries, even without sleeping, vs only 19hours from a 2AA MintyBoost-type supply.

So if 4 AA cells ran it for a week, a lantern battery should last a month.

If you can get the processor to go to sleep between measurements, it would probably last a year.

I wonder how he hooked up the 4AA pack.
Reading the power supply recommendations here: http://www.arduino.cc/en/Main/ArduinoBoardDiecimilaI see the following:
"If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may be unstable."

Me too. Maybe he used the USB port? Otherwise, I guess you'd have to solder special power connections to the board, to bypass the regulator - personally, I wouldn't want to do that.

"If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may be unstable."

Those are restrictions created by the 7805 regulator. I hadn't looked at the datasheet before, but I see now that the output current apparently drops to zero unless there's a reasonable input-output voltage difference. So, it sounds like plugging a 5.3V supply into the power socket probably wouldn't work. It also probably wouldn't fry anything, so maybe I should just try it and see? :)

"Yes, the Arduino board needs at least 6 V to get 5 V out the other side of the regulator. However it turns out that giving it less than 5 V is just fine. The ATMEGA168 runs even if you only get it maybe 2.7 Volts,* so it's possible to use the barrel connector with lower voltages. Or you can bypass that and hook up directly to the pin labeled +5V. Just don't put anything more than 5V into that pin!"

Time to start doing some experiments...

* FWIW, I think the ATmega168 datasheet (sec 28.3) actually indicates that you need to supply at least 3.8V to run the chip at 16Mhz.