using more than 8 leds

hey im new to working with circuits and the arduino, so bare with me. I want to drive multiple leds with the arduino. I'm told that using more than 8 leds can burn the arduino board because it draws too much power. I tried searching on the forums, but there is just so much. I found this tutorial on the Arduino site, Serial to Parallel Shifting-Out with a 74HC595, but I was wondering what if I wanted to do more than 16 leds? and I wanted to power the leds seperate from the arduino board so that the board wouldnt be in danger of burning out. Thanks for any help you guys can provide.

The main questions are...

  • How do I drive Multiple LEDs without burning out the Arduino Board?
  • Up to how many LEDs can be supported by the Arduino?

According to the datasheet, (pages 304+) each pin can source 40mA. As for maximum current for the whole chip, I can't tell. :expressionless:
If you want to drive the LEDs from a constant power source rather than the Arduino but still control them, you can use some transistors and use the Arduino's I/O pins to switch the current flow through the LEDs on and off. You'd be looking at wiring them up as illustrated here: Arduino Playground - HomePage
Of course, you don't need to have 4 LEDs, or you can have more... It's up to you - and how much current the transistor you use is able to handle without bursting into flames. :stuck_out_tongue:

To handle more than 16 LEDs, you're going to have to either purchase I/O expanders, like the Microchip MCP23008 (one I'm using) that will add more I/O lines to your Arduino, or do some tricky multiplexing as illustrated here: Arduino Playground - DirectDriveLEDMatrix Though it shows you how to use an LED matrix, you can wire up your LEDs in a similar way to achieve the same end.

EDIT: Seems I missed a part of the datasheet... Seems the total output current for the analog pins (which can double as output pins), plus pins 0-4 should not exceed 150mA, and the total output current for pins 5 - 13 should not exceed 150mA. I'd try to stay below that as much as possible though, but that's just me, and I'm paranoid. ;p

Hi,
read this : Arduino Playground - InterfacingWithHardware
it has a link-section on "LED Lights and Displays"

Eberhard

Have a look at ModernDevice's 8x8 display, if 8x8 sounds like it would be fun. You can even drive multiple 8x8 panels.

http://moderndevice.com/8X8display.shtml

Look at the price! (But note that you also need a power supply... I'd take one from inside one of my old PCs!... and the LEDs. They aren't included in the kit because there's such a range of price/performance/color choices out there.)

And look at the .pdf document....

http://moderndevice.com/Docs/8x8LED_Instruct_0.3.pdf

(I have no interest in ModernDevice.... just a happy customer, and an experienced hobbyist who likes their apporach and support.)

===
The answer to your question was in two parts...

a) The power demands of multiple LEDs... already answered

and

b) How can I drive more LEDs than I have pins for.

Assuming you meant more than driving 32 LEDs by connecting two to each of 16 pins, the answer is "multiplexing".

And there are two basix answers to multiplexing....

i) Software intensive

ii) Hardware "intensive".

In the latter, you add some electronics, chips, between your Arduino and the LEDs. Not hard to do, or expensive, and the wheel has already been invented... the 8x8 board mentioned above is one of several examples. It's the way I would go, for a bunch of reasons.

In the former, you would be doing what I'm about to explain, but probably on a larger scale....

You'd still need a little external electonics... transitors to drive the LEDs, to get past the power drain problem.

You'd fix up, say, four rows of five LEDs. In a crude system it would take 9 outputs from the Arduino to control the 20 LEDs. The "trick" is that you use four wires to control WHICH row of LEDs the other five wires are turning on or off at the moment. You then cycle rapidly between the rows...

First 10th second: switch the right LEDs in row 1 on or off,
Second 10th second, switch the right LEDs in row 2 on or off,
Next 10th second, switch the right LEDs in row 3 on or off,
Next 10th second, switch the right LEDs in row 4 on or off,

On the NEXT 10th second, you go back to row 1 again....switch the right LEDs on or off,
Next 10th second, switch the right LEDs in row 2 on or off,
etc,
etc

Because of "persistance of vision", your brain will not will "see" the LEDs flicker. Same thing that makes movies "work".