Go Down

### Topic: Driving multiple LEDs with the Arudino and External Battery Pack (Read 2014 times)previous topic - next topic

#### Fennel Rye

##### May 19, 2012, 02:29 am
Hey guys,

Just a quick warning: This will seem like a very basic question but I am really having a hard time understanding how to remedy it.  I have 14 LEDs that have the following specs:

Ultraviolet LEDs 5mm High Brightness
FW Current: 20mA
FQ Supply: 3.3V (typical), 4.0V (max)

I want each LED to be controllable by a pin on the Arduino (so they can do a chasing light pattern that gets faster and faster).  This also needs to be portable, so I need to power the Arduino with a battery pack.  Now, the basic question:

How much power will I need for this project? (Volts?) I know this is a super basic question but I am having trouble understanding. I know I need to do my basic electronics homework, but this is a rushed project.  I promise I will study afterwards. Thank you in advance.
Fennel Rye

#### marco_c

#1
##### May 19, 2012, 04:43 am
You will need to add up the current for the following:
1. the number of LEDs that will be on at the same time (say 3 for this example)
2. what the Arduino needs (no idea, but guess at 30mA)
3. Any other devices that will be running (seems none)

So (3*20)+30 = 90mA. You power supply must be able to supply 100mA.

You will need resistors to drop the voltage 'across' the LED to 3.3V. So if your Arduino is running at 5V, you need to drop 1.7V for the LED to see the right voltage across its terminals. Using Ohms law V=IR or R= V/I =1.7V/20mA = 85 Ohm. Pick something bigger like 120 and you will should be fine.
Arduino Libraries http://arduinocode.codeplex.com
Parola for Arduino http://parola.codeplex.com
Arduino++ blog https://arduinoplusplus.wordpress.com

#### Fennel Rye

#2
##### May 21, 2012, 08:45 am
Marco,

Perfect response. Thank you so much for making it so clear and understandable.  Really appreciate it!

Fennel Rye
Fennel Rye

#### Fennel Rye

#3
##### May 22, 2012, 12:42 am
I have a few more questions:

What I'm essentially building is a ring of these LEDs. There will be 14 of them in all. They will operate in a chasing lights fashion (one goes on, then the one next to it goes on asthe previous one shuts off). This will get faster and faster. Once it has reached a certain speed, 6 of the lights will remain on fading in and out (PWM outputs).  Does this mean that I should only have to provide enough mA for the LEDs that will be on at the same time, or is it better to provide enough for them all to be on at once (because they will be blinking on and off at a very rapid pace)? If it is better to provide enough for them all to be on at once, that will mean I need 310 mA? (14*20)+30 = 310mA.  Is this correct?  If so, how could I provide this amount of power using batteries?  I have several 9 volt adaptors and a 8 AA battery holder. Would either of these be an okay choice? I am having trouble getting an answer as to how to provide a needed amount of mA through battery packs.  Apologize for my n00bness.  Thanks in advance!
Fennel Rye

#### marco_c

#4
##### May 22, 2012, 12:50 am
Yes, if you plan to have them all on at once you need to plan power enough for that.

The other consideration is how long you need to run this for? With 9V (square) batteries, you don't get much current.  At the very least you will need to investigate alternative battery technology. You may be better off using the rechargeable battery packs of the type used in RC cars - they can provide 1.2A for about 10 minutes when running a car.
Arduino Libraries http://arduinocode.codeplex.com
Parola for Arduino http://parola.codeplex.com
Arduino++ blog https://arduinoplusplus.wordpress.com

#### Fennel Rye

#5
##### May 22, 2012, 01:23 am
Marco,

It's a movie prop, so it'll be on an off several times, but never fully on for more than a few minutes.  Looks like you're right on about the RC batteries.  Those seem perfect.  They offer several different V's (6V, 7.2V, 9.6V). When looking for the right voltage, do you just make sure that it's enough for the LED with the highest FW supply?  So, since these are 3.3V LEDs, a 9.6V would be fine as long as I install the correct resistors to drop the voltage across the LEDs?  I see an RC battery at Radioshack that is 9.6V/800mAH, so does this mean that this battery would power my unit (if all LEDs were on, so 310mA) for approx. 2.5 hours (800mAH/310mA)?   Thanks again for your help, Marco.

Fennel Rye
Fennel Rye

#### marco_c

#6
##### May 22, 2012, 09:42 am
You should probably feed the 9.6V into a voltage regulator and get out a stable 5V output and build your circuits for 5V. This will make sure that the battery voltage can drop to about 7V before you see the effect on the display. Also remember that the Arduino does not take 9.6V. There are lots of circuits for chips like the 7805 which make building this power supply really easy.

800mAh does mean 800ma for 1 hour.

Arduino Libraries http://arduinocode.codeplex.com
Parola for Arduino http://parola.codeplex.com
Arduino++ blog https://arduinoplusplus.wordpress.com

#### Fennel Rye

#7
##### May 22, 2012, 09:58 am
Quote
There are lots of circuits for chips like the 7805 which make building this power supply really easy.

Can you direct me to something like this that you are referring to? Thanks, Marco!
Fennel Rye

#### marco_c

#8
##### May 22, 2012, 10:22 am
www.epanorama.net/circuits/psu_5v.html

The article states 100mA max but it can handle a lot more. Your input side is the battery.
Arduino Libraries http://arduinocode.codeplex.com
Parola for Arduino http://parola.codeplex.com
Arduino++ blog https://arduinoplusplus.wordpress.com

#### marco_c

#9
##### May 22, 2012, 02:29 pm
There's a similar thread in the project guidance section on battery life. You may want to look at this article http://www.gammon.com.au/forum/?id=11497 referred to in that thread.
Arduino Libraries http://arduinocode.codeplex.com
Parola for Arduino http://parola.codeplex.com
Arduino++ blog https://arduinoplusplus.wordpress.com

#### Fennel Rye

#10
##### May 22, 2012, 09:22 pm
Awesome. Thanks, Marco! I've got some reading to do.
Fennel Rye

#11
##### May 22, 2012, 09:29 pm
Is this thread on the same project?

http://arduino.cc/forum/index.php/topic,106844.msg802513.html#msg802513
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### marco_c

#12
##### May 22, 2012, 09:48 pm
Looks like it!
Arduino Libraries http://arduinocode.codeplex.com
Parola for Arduino http://parola.codeplex.com
Arduino++ blog https://arduinoplusplus.wordpress.com

#### Fennel Rye

#13
##### May 22, 2012, 09:57 pm

Ya, I apologize for it becoming two threads.  The one I posted over at the General Electronics board began as me trying to figure out how the Arduino handles various power supplies, so it was a different question.  Then, as people began to answer, I felt I needed to clarify and explain the project. Sorry if I made things confusing.
Fennel Rye

#14
##### May 23, 2012, 06:36 am
If I had better moderator know-how, I'd merge them, but that would be too confusing now I think.
Why don't you pick the one you want to stay with, add a note saying "see the other thread" and then Lock Topic.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up

Please enter a valid email to subscribe