Lots of independant LEDs

A friend of mine is interested in having me make him an LED face for the front of his music equipment box thingy. It would be a pattern of LEDs that would mostly be controlled independently, although if necessary it could be wired up so that many share the same pins. I've only ever gotten as far as using 595's to shiftout to a few LED's so this is quite a step up for me, but something I'd really like to try.

I think we would be looking at a hundred or two LED's. My first question is, would it be a bad idea to daisy chain a whole lotta 595's? would I have to worry about lag or anything else? Is there an alternative to the 595 that provides more output pins so as to be more economical?

Another question is what are my options with PWM? Are there shit registers that support it? Or would it be possible to simulate PWM myself by shifting out rapidly? That seems a bit unlikely.

Anyway, he seems pretty flexible so I just want to get an idea of that could be done, and how I could approach it. I would really appreciate any info.


Are there shit registers that support it?

No not even a shift register supports this. :)

Shift registers are cheap but for lots of LEDs why not wire them in a matrix to get more for you interface pins.

Haha, whoops....

Anyway, I'm looking for maximum brightness. At least for the brightest ones. Then a few levels darker if possible. Sortof to create a comet trail look. I wouldnt want to split them up into more than 4 columns/rows because it seems like they would begin to get pretty dark after that. so maybe 4x32? Can I shiftout to 32 registers quickly enough for a matrix? And even better, could I cycle the matix quickly enough to fake PWM some of the LED's? For instance have four cycles, 1 LED High for all four, 1 for 3/4, the next for 2/4 and last 1/4....Could I shiftout 32 bits 4 times and have the 1/4 LED not appear to strobe?


Here is some code that helps use the 585 shift register for PWM. Don’t think your going to hit 100 or 200 leds with that setup, I ran 44 on my house but hit distance issues. If you are doing lots close to each other - maybe 100.

100 - 200 LEDs with individual control is not a trivial task. If you have the funds, using LEDs that have a chip built in (i.e. LPD6803 or WS2801) will change the effort needed to do the build by an order of magnitude. Having to wire all the LEDs back to a central control box requires (as you know) many wires. Having daisy chain capable LEDs means … only 4 wires in and 4 wires out of each led and you can get them pre-wired.

If you have the funds for strips like this, it can make a night / day difference in time take and looks of your project.

In my mind, this is the cream of the crop of what is available today. Individual control, 5v, 16 million colors … in modular 1m strips with connectors - sweet. I deal factory direct normally, but did order one of these on ding and dent from sparkfun. This is the only strip I have found yet that I would consider using. The other 12v varieties generally have one chip per 3 LEDs per chip. Make sure any strip you get has LPD6803 or the WS2801. Some strips say individual control but they suck - namely the 1606 style chip.

While on the sparkfun subject …
To make it play with the music, check out http://www.sparkfun.com/products/10306
This is another product I use regularly and can say it is easy to use and works great.

So if money is a major consideration - raw leds is most likely the route to go and you may want to limit to 100 at first. If not - use a soldered solution and concentrate on the fun stuff.

Best of luck

I have been selling a 32 channel interface for my Arduino compatible boards. http://wiblocks.luciani.org/NB1/NB1A-LED-index.html

The LEDs can be wired with old IDE cables. You can also split the ribbon and press on 2x1 connectors.

I have a backplane so that multiple cards can be connected to one uC board.

Even with the backplane and multiple cards I think you will need some sort of a matrix arrangement. Maybe 4x64 or 8x32.

(* jcl *)

Thanks guys. Unfortunately, a lot of these seem to be a bit out of my price range so I may have to just stick with the 595s. However I think I've got it mostly figured out. I can matrix 4x32 AND use that to get my low resolution PWM. I only need four levels of brighness so I just have to code them to only go high on ever certain number of scans. I'm going to check out that code when I get a chance though. Then, since I'm not looking for a ton of complexity, I can just have each side mirrored. That means 32 pins with 4 matrix scans split to 2 LEDs each. That's 256 LEDs with all the flexibility I need. I just need to make sure that 16 LEDs on one 595 is not too much current. Can I just use NPN transistors on each 595 pin to ease it's load?

Since you are planning on a 4x32 matrix you may want to consider the 5940 (or other LED current-sink) rather than the 595. The 5940 outputs sink 60mA with a 3.3V supply and 120mA with a 5V supply which will give you more flexibility with higher brightness LEDs. It will only cost you a few dollars more.

(* jcl *)

Since each scan on my matrix will have 64 LEDs wouldn't I need something much higher wattage to sink them?

Not sure. What LEDs are you using? What drive current? What temperature will the LED driver see during operation?

You need to check the power dissipation of the 5940 (or other current sink). There is also a maximum current specification. The PWM and peak current is adjustable on the 5940.

(* jcl *)

I just need to make sure that 16 LEDs on one 595 is not too much current.

Depends on how it is wired but probably yes.

Can I just use NPN transistors on each 595 pin to ease it's load?


Or get a shift register that can do higher currents, such as 74AC299PC from Newart, 56 cents each, 24mA capability.

I havn't actually chosen specific LEDs yet. I'm just going off the assumption that they will be approximately 20mA and that 16 LEDs on each 595 will have a load of approximately 320mA at max and each scan of my matrix will have approximately 20mA * 32 pins * 2 LEDs = 1.28A. It seems to me like the easiest way to sink over an amp would be a PNP transistor. Are my math and logic correct? Or should I approach this differently?

The thing about the 5940 is that I don't need full PWM. I just need a few levels of brighness which I can do with the matrix pretty easily. I'm afraid using PWM in a matrix would slow down the shiftout(requires mire info, right?).

I really only have a pretty basic understanding of all this so please forgive the difficulty I'm causing. I really appreciate all of everyone's help.

to sink over an amp would be a PNP transistor

No sinking requiresvan NPN. As a matrix is scanned you only need to consider the maximum number of LEDs on at any one instant of time

256 LEDs in total, 64 on at a time. 64* .020A = 1.28A for each scan.

So you're going to have each '595 output drive the base on an NPN transistor to connect the bottom of an LED string to ground? Or use a high current-high voltage capable part like TPIC6B595 to drive the LEDs directly?

If you are using a 16 channel driver (like the 5940) the current and power dissipation is divided between 4 ICs. If you keep the LED source voltage close to the Vf(max) you will not dissipate much power in the current sink.

(* jcl *)