# Driving multiple LEDs with the Arudino and External Battery Pack

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.

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.

Marco,

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

Fennel Rye

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!

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.

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

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.

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!

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.

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.

Awesome. Thanks, Marco! I've got some reading to do.

Is this thread on the same project?

http://arduino.cc/forum/index.php/topic,106844.msg802513.html#msg802513

Looks like it!