How to power 128 LEDs for music-synced PWM?

I'm working on making two 8x8 grids of 10mm RGB LEDs to be synced to pulse with music and I've hit a wall in my planning process. I have all the code down for getting a single LED to pulse correctly and everything, but I don't know how I could provide external power to expand the effect to all 128 LEDs since the 5v Arduino won't power all that by itself. How could I go about wiring external power to all 128 LEDs without overriding the PWM audio signal from the Arduino to the LEDs or frying anything?

I'm not trying to wire the LEDs like a matrix, I'm just going to probably use shift registers to extend my number of PWM outputs, separate LEDs into groups, and set them to react to different audio frequency bands from an MSGEQ7 (tedious, yes, but I'm trying to keep the whole system as basic as possible). I've seen tutorials where people use amplified audio signals from old stereos and speakers, could I use something like that?

So far I'm anticipating needing: God knows how many shift registers (or http://www.sparkfun.com/products/10136 if that'll be more suited for what I'm going for) Boat[edit]loads of resistors and capacitors (I don't know what kinds or how many, that's one part of what I need to figure out) 128 LEDs (haven't ordered them all yet because I need to figure out what combinations of common anode/cathode LEDs can make the system more efficient)

Here's a really rough diagram that I hope illustrates the basic principle behind what I'm trying to accomplish: http://i.imgur.com/G5QUX.jpg Is there a more efficient way of achieving this?

Any help would be greatly appreciated!

First, watch the language please. Then look into TLC5490 driving common anode RGBs. Each one has 16 outputs, so you'd need 24 of them if you're not into multiplexing. One resistor for each to set the current limit, and power pin decoupling capacitor for smooth operation. Can daisy chain them, send out a bunch of via SPI.transfer to update everything at one time.

Wow, thanks! That's a lot more PWM drivers than I expected, is there a way to map a small group of LEDs to one pin if I want them to all do the same thing (to avoid having to supply every LED with 3 of its own pins)? If not, how could multiplexing make this job easier? I've never done it before, so I don't really know where to start. But if it'll keep me from having to buy 24 PWM drivers, I might just want to look into that...

Also, where in the circuit would the external power need to be added? I'm worried I'll plug it into the wrong place and make all the magic smoke escape from the Arduino lol

My apologies about the language

is there a way to map a small group of LEDs to one pin if I want them to all do the same thing (to avoid having to supply every LED with 3 of its own pins)?

Have you considered led strip? Cutting to small pieces you will have a group of 3 or 6 leds pre-wired, making assembly easier. This what I did in my project: http://coolarduino.wordpress.com/2012/06/21/tears-of-rainbow/

I had another response typed up, forum froze up on & I lost it.

What I was going to suggest was WS2803, has 18 PWM outputs, so each can drive 6 RGB LEDs.
Perhaps use them to drive ULN2803s for PWM control of LED strips.

http://www.noodlehed.com/ebay/datasheets/WS2803.pdf

Hmm, TLC5940 can do 17V, so maybe those with LED strips are the way to go.

TLC5940 PWM driver.pdf (1.06 MB)

Hi,

Theres also the lm3914, lm3915 and lm3916, they are vu meter ic commonly used to drive leds in response to audio, look them up on your favorite video site. If you add some filters using opamp, you might be able to acheive your aim in pure hardware.

Duane B

rcarduino.blogspot.com

Magician: Have you considered led strip? Cutting to small pieces you will have a group of 3 or 6 leds pre-wired, making assembly easier.

Yeah I've looked into that and it would make it easier to wire up, but it would limit my ability to customize the designs/layouts of the different LED groups. Even if I have to rearrange all the wires in the back, I think it'd be worth having the customizability.

DuaneB: Theres also the lm3914, lm3915 and lm3916

Awesome, thanks! I can see myself ordering a couple of these in the near future

CrossRoads: What I was going to suggest was WS2803, has 18 PWM outputs, so each can drive 6 RGB LEDs. Perhaps use them to drive ULN2803s for PWM control of LED strips.

How practical would it be to follow this guide (http://n00bsys0p.co.uk/comment/163) and have those digital out pins going to LED groups using several WS2803s and ULN2803s instead of straight to single LEDs or LED strips?

The Arduino read the audio DEC level from the EQ part for a chunk of spectrum: spectrumValue[ i ] = analogRead(analogPin);

and maps it to a level: // Constrain any value above 1023 or below filterValue spectrumValue[ i ] = constrain(spectrumValue[ i ], filterValue, 1023);

// Remap the value to a number between 0 and 255 spectrumValue[ i ] = map(spectrumValue[ i ], filterValue, 1023, 0, 255);

The Arduino then has to write those levels spectrum[ i ] out to the WS2803s or whatever part that controls the LEDs using the appropriate interface protocol for the chosen part. You coud make your own version of LED strip using individual LEDs wired in series from 12V with a current limiting resistor. Couldn't do RGB that way, with the common anode, but you could place the 3 LEDs right next to each other and achieve similar effect.

I haven't used the other drivers although I'm pretty framilier with the TLC5940. Now when you say 128 LEDs, you must mean 128 RGB Leds since you mentioned RGB. That corresponds to 384 leds total. Even if you were to get common anode, the arduino library for the TLC5940 can drive up to 256 leds when you have a full 16 of them daisychained. You can still add more after that point, but I'm not sure what happens, I've never gotten to that point mainly because once you get up to that point, it becomes super expensive.

The TLC5940 is more so for smaller PWM applications and isn't too well suited for RGB LEDS since each one needs 3 of the output pins from the 5940.

Now it is extremely easy to use so if you need that, try it out, but if you can figure out another way, I would suggest taking that route.