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!

CrossRoads,

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.

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.

NOTE: For a more in depth look into this topic, see http://arduino.cc/forum/index.php/topic,106844.0.html

There is a consideration not addressed here and that is the regulator. Theory say's a linear regulator (7805) is a voltage controlled resistor. So you have X load current(batt) @ Y Votlage ACROSS the Regulator 9.6V? - 5V = 4.6 V X total load current, one figure I saw was 180 mA... .18 A X 4.6 volts = ,8+ watts wasted heat in the regulator and it takes Battery Power to make that heat, power that doesn't get used in the load but wasted, What's worse is it is your available current going up in heat. There is a simple and easy to implement answer that will waste less than 5% instead of the nearly 100% loss you have now. Several stores on Ebay sell Adjustable 1 - 2 A Buck mode switching power supplies that are about 25 mm on a side and are capable of 95+% efficiency and not a lot more than a 7805... I bought 3 @ $1.80 Ea You can also buy adjustable boost mode type switchers that would let you run your project from 3 Alkaline "D" Cells It is the method I use exclusively the parts are too cheap and too easy to use, require no output bypassing and are stable until the batteries are exhausted. The benefits are obvious, almost twice the available battery life and no need for Big battery packs. IMO

Doc

And if you don't have 3 weeks to kill, Digikey has modules in stock http://www.digikey.com/product-detail/en/OKI-78SR-5%2F1.5-W36-C/811-2196-5-ND/2259781