Pages: [1]   Go Down
Author Topic: How long can arduino run off a 9v battery?  (Read 7725 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
like I know what I'm doing...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I was wondering if anyone has used an arduino off a 9v (using instructions off of the playground for soldering the correct power plug) and has any observations about about how long it lasts.  

Currently I have the original USB model Arduino and I'm using it in a halloween costume.  Basically it's being incorporated to a helmet with a piezo disk that will cause LEDs to flash whenever I speak.  The LEDs will normally be off and only turn on when I talk, so they will not be a constant drain on the battery.  Although depending on responses here, I have LED's I was going to wire to a seperate battery for the eyes but may attach to the Arduino and make flash also if the results here are encouraging enough.  

There are about 12 red LEDs of a normal size (not counting the 2 for the eyes that I'm not sure I'm adding yet) and I'm trying to find out if anyone had any idea how often I'd be changing the battery.  
Logged

watch me break things! http://krylon.blogspot.com

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 5
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This is very difficult to say anything about.

Different LED's draw different amounts of current, and the processor on the Arduino board will probably use more or less current depending on how your program is written.

You can try to meassure the current it draws when "idling" and when the LED's are on by inserting a mA meter i seriers with the battery.  If you know the capacity of the battery in mAh you can do a qualified guess.

You could also wire 2 or 3 batteries up to get a much longer battery life time.

Or you could use 6 AA batteries in a suitable holder, they will give you 9V, but last much longer than a single 9V block cell.
Logged

london
Offline Offline
Full Member
***
Karma: 0
Posts: 148
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

it also depends how much you talk!

only sure way is to test it. If its a one off have a couple of spare batteries with you.

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
like I know what I'm doing...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

it is going to be a one off kind of deal (or 2 off, Saturday and Halloween proper) but wiring up six AAs might actually be a good idea.

the code, in case you're curious, is basically the knock tutorial with the serial code removed and an IF statement for the lights. Maybe I should put in a delay to slow it down a little.

Thanks for the tips!!
Logged

watch me break things! http://krylon.blogspot.com

0
Offline Offline
Full Member
***
Karma: 0
Posts: 111
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My own project gets somewhere over ten hours -- but it's only burning one LED (plus writing to a MIDI port).

But, I added a cute little routine for my peace of mind;

Positive lead of the 9v battery connected through two 1 meg resistors in series to ground.  Lead from where the resistors met to one of the analog inputs on the Arduino (aka a simple voltage divider).

Then the routine;

batLevel = analogRead(batteryIn);
if (batLevel < 720){
lowPower++;
}
if (lowPower > 10000){
lowerPower = 0;
}

And in the middle of the code that set the color for the multi-purpose indicator LED (red is power on, green is transmitting);

if (lowPower < 1000){
digitalWrite(LEDgreen, LOW);
}
else{
digitalWrite(LEDgreen, HIGH);
}


In essence, once the battery voltage fell below a preset point, the variable "lowPower" would begin counting up.  When enough cycles had passed to be certain the battery is below threshold, the power LED turns off.  The counter continues to increment until it rolls over, thus the power light will in fact blink -- until power falls so low the entire circuit fails.

(As explanation, a bicolor LED is tied across two digital outputs.  Thus writing "HIGH" to the green side will permit the green "transmitting" state to work but turns off the red "power" state.)
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
like I know what I'm doing...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow.  That's freaking awesome.  I kind of think that worthy of a playground entry.  
Logged

watch me break things! http://krylon.blogspot.com

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 5
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I agree.  Letting the Arduino monitor it's own power is smart.
Do a little write up and put it in the playground. Many people could benefit from a design like that.
Logged

Brisbane, Australia
Offline Offline
God Member
*****
Karma: 1
Posts: 593
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

*Drool*

Now to figure out something I can run off a battery to try it with. smiley-wink
Logged

Pages: [1]   Go Up
Jump to: