Batterylife

I've just completed a simple temperature measurement project. As there's no power source like a wall plug, I'm using a 9V battery.

My first try was a Duracell MN1604, my second one was a rechargable Varta HR 6F22 (200mAh). Unfortunately I could not even power the project for 12 hours. After 12 hours the temperature sensor (SHT15) does not get enough power to work, leds don't light and so on. Only the power control led on the arduino board is glowing very dim. When I connect the project to a new battery or USB, everything works well.

So I suspect that the battery life of my Arduino project is only a few hours.

Is this a normal condition or could it be that my circuit has some sort of leak?

How much current does an Arduino draw if I run just the board itself? If, for example, it would draw 20 mA then the reason why it stops working after 10-12 hours would be clear as the Varta I tested has a capacity of 200 mAH. So the solution would be a larger battery pack!?

20mA for a fully running arduino is about right and as you’ve discovered 9v batteries are low on capacity. You could put the arduino into one of several sleep modes and wake it up periodically which would much improve battery life or get a bigger battery pack or run it on ‘real’ power.

Maybe consider a lithium backpack?
http://www.liquidware.com/shop/show/BP/Lithium+BackPack

@afhaque89: thanks. I was looking for a lithium pack anyway. This one looks awesome!

@pluggy: running on real power is not possible at the moment as there's no power supply around. However, I'm very interested in the sleep mode you suggested.

What I would need: The normal program flow: Measure the temperature, store it (on the eeprom or SD card on the ethernet-sd shield) sleep for 30 minutes. The not-so-normal program flow: Run an interupt method when a Button is pressed.

So I would have to put the Arduino to sleep mode and wake it up after 30 minutes in the loop method. An interupt should wake it up too, but this should not affect the 30 minute pause between two measurements. In other words, the temperature measurements should happen every 30 minutes, irrespective of whether the button was pressed or not (i. e. the interupt method ran or not).

Is this possible at all? If not, is there a way to make it possible somehow? If yes, do you know any tutorials on how to do this?

thanks in advance!

It is possible to do watchdog wake-ups from deep sleep at a maximum period of about (and it is very 'about') 8 seconds. In 30 minutes, there are roughly 225 eight second periods. So, just keep a count of how often you've been woken, and when you counted enough wakeups, take a reading.

A button attached to an interrupt should also wake the processor.

(when are people going to stop using 9V batteries for projects?)

You can get the MCU to go deep sleep to achieve uA current range for the MCU alone. But the regulator used in most of the Arduino boards design itself has quiescent current in the mA range.

"when are people going to stop using 9V batteries for projects?" me: now. ;-)

is the mechanism behind the millis() method working during a sleep?

@48X24X48X just to be sure I understand: the regulator is not affected by the sleep as it's not a part of the mcu?

just to be sure I understand: the regulator is not affected by the sleep as it's not a part of the mcu?

The regulator is not affected in this case. So even at light loads (MCU sleeps), the regulator still consume some mA to provide the necessary output voltage. But, this is not true for all regulator. Some more advance regulator has very low quiescent current; something in the uA range. In this case, it doesn't contribute much to the overall current consumption of the board. So, when the MCU enters deep sleep, the board really goes down to uA range. :)

If you do go for Lithium batteries, be aware you need to monitor the voltage and shut off the load if the voltage drops too low or it will permanently damage the cells in the battery.

If space isn't a problem, you could go for a lead acid car battery, a clapped out one from a scrap car would probably run an arduino for a month without sleeping. ;)

a car battery would really work? a colleague and I bantered with this idea, but didn't think it would actually work.

how could I monitor and shut off the voltage of a lithium battery?

thanks for the hints, by the way!

Providing you're not pulling much more than the load of the arduino through the voltage regulator, you could plug it into the DC Jack on the arduino. Its good up to 20 volts for low currents. If you had more than say 50mA load the heat generated by the regulator might get to be a problem if the battery voltage were much higher than 12v. I've fed an arduino long term with 15 volts, but the higher the current, the higher the power dissipated by the voltage regulator. I'd put a fuse in line, since short circuits with car batteries can be 'fun'.

You could use an analogue pin to monitor battery voltage and arrange some circuit to shut off the power to the arduino. A latching relay would be the obvious solution - effectively have the arduino commit suicide by turning off its own power.

You could use an analogue pin to monitor battery voltage and arrange some circuit to shut off the power to the arduino. A latching relay would be the obvious solution - effectively have the arduino commit suicide by turning off its own power.

I could just connect the vin to an analogue pin (without frying it ;-))? Are there any other components which have to be connected in between (e. g. resistors)? Do you mean a relay like this? http://en.wikipedia.org/wiki/Relay#Latching_relay I did in fact know that there are those for lighting current, but I didn't know that there are low-current versions too.

Do you know any projects that use this mechanism, so I could take a look at the specific circuit? I guess, in principle, it depends on the power source I use.

Go to pololu.com and get one of their switching regulators that handles wide input voltage ranges and puts out 5V. Will run much cooler than trying to keep a 7805 from overheating.

thanks. nice gadget! So with this, is it definitely no issue to connect vin with an analogue input? Would it be a problem if I used other current source and no regulator in between?

any ideas about the latching relay?

Are you saying using a boost regulator to create 5V for Vin, and then monitor the battery itself (which would be up to 3.7V for a single Li Ion battery) on an analog pin? Yes, that is ok.

If you wanted to monitor the car battery, that is different. You will need a voltage divider to bring the max voltage to <5V on the analog pin.

Other current source? Ok, as long as Vin stays under 5V.
I have a 5V wall-wart that I am driving a board with on the Vin pin, with one of the pololu 2A boost regulators to make the 12V I need to drive some columns of LEDs.

So let's say I wanted to use this battery pack: http://www.sparkfun.com/commerce/product_info.php?products_id=8484

with the battery alone, I'm not able to run my arduino as it outputs 3.7 V and the Arduino (Duemilanove) needs at least 6V. Additionally, I risk to overheat it as the voltage regulator of the Arduino can handle up to 1A.

With the regulator I could 'turn up' the voltage to say 9 V and limit the current to say 800 mA. Is that correct?

The Deumilanove will run just fine on 4.5V (3 AA batteries, go try it - mine were measuring 4.25 & it was still going okay), as long as you provide it on the 5V Pin, and not thru the power connecter (you are bypassing the onboard regulator that way). Just make sure you get the battery+ on Vin and the battery- on the arduino GND. May even work on 3.7V.

There was another discussion quite recently on latching relays, with some specific parts discussed that can be switched with lower control voltages. Do a search, see if you can find that.

You may be able to boost the battery to 5V and power the arduino and the relay from the same voltage, or at least drive a mosfet (like IRF3707Z) with an arduino output pin to drive the relay instead. I had found a nice part that I think ran off 5V and didn't need lot of current to drive it. I think it needed three connections; +V on one pin to set relay, +V on a second pin to reset the relay and a common to both.

off to bed ...

May even work on 3.7V.

My problem is that I should know that allready. I'm going to order some stuff at sparkfun the next days and don't have a LiPo battery to give it a try. The lithium backpack mentioned above would be great, but it would be even greater if I could order erverything from one store since shipping cost to Europe is an issue.

sparkfun does have 5V step-ups too, but only up to 300 mA :(. So my two possibilities are a) two 3.7 packs and connect them in series or b) use a 5 V step-up and use the 'workaround' you mentioned.

a) is uncomfortable if it comes to recharging (two at once - how-to?) b) i'd really like to use the power connector (i'm just a coward, but as I'm yet a beginner when it comes to electronics, I would like to go the idiot-proof way. But I appreciate your suggestion!) But maybe i'm just misunderstanding. If I ordered this one http://www.pololu.com/catalog/product/784 I had to do your 'workaround'. If doing so, am I just skipping the 7805 and using the boost regulator instead? However, if I ordered this one: http://www.pololu.com/catalog/product/799 which is adjustable, could I use the power connector?

good night, btw ;-)

Okay, First thing, update your profile so folks know you're in Europe, with a country. There are suppliers there also, and the other European folks can tell you who they are. That will help you a lot on shipping costs.

If you are going to go in via the power connector, I would go with the 2nd one.

Two batteries in series going to the power connector would also work, with no outside regulator. 7.2-7.4V regulated on board down to 5V would not pose a problem.

The battery whose -terminal is connected to the power plug -terminal could be monitored on an analog pin as discussed so you can have an idea of when to disconnect your batteries and charge them occasionally.

You might also want to google LiPo battery chargers. You don't sound like you're ready to build up your own just yet.

good morning. profile updated ;-)

The shops in Europe :D... the second step-up is ~21 EUR = ~28 USD plus shipping. If I ordered in the US I'd make a better deal. That's the reason why I order at sparkfun (or makershed,...). But that's off-topic.

You are right. I'm not yet experienced enough (nor willing enough) to build my own charger. I allready had a look at pre-assembled ones.

If I connected two LiPo batteries in series, I would have to recharge them one after the other, right? That's a little bit inconvenient, but it's likely the most idiot prove solution except for the lithium backpack or good old AA batteries. What if I connected both to a single charger?

It's exciting that there are so many possible solutions for just a single problem.