controling hundreds of LED


I know that questions how to control x LED via arduino were asked many times before, I couldn't find any reply that satisfied my needs though...

So... my qestion is how to control 400 to 800 LED independently in the most efficient way. Important thing is that I can't use any pre assembled LED matrices since the layout of LED has to be flexible. PWM control would be nice but it's not vital, especially if it would complicate things too much.

Could anyone recommend what method / components should be used ? I would be grateful !


controlling that many LED's is a challange.

I would approach it in a modular way. Design som kind of module that could handle a subset of the LED's and then duplicate that.

Maybe even a bunch of modules each with it's own Arduino , everything controlled by a master Arduino. A minimum Arduino can be built for a few $$$.

Each module could use shiftregisters or charlieplexing to control a number of LED's. Or if PWM is needed some of the (expencive) PWM controller IC's

Two major issues you are facing: wiring and power.

800 LED's using 20mA each is 16Amps!! (if they are on at the same time) and that is just the LED's then theres the rest of the circuitry.

Can't rainbowduinos do that sort of modular stuff? Each module is an arduino, with 64 leds.

Maybe you could use one of the small arduinos (like the breadboard mountable ones) and have a 4*4 matrix on each, for extra flexibility.

I have seen 512 LEDs independently driven with some degree of brightness control using shift registers. See ben hecks videos for BBP Screens on youtube

Hi, it is possible with a MAX7221 or MAX 7219. They don't do PWM but driving 500 Leds should be possible. Check out these pages : Don't get misled by the word LedMatrix, its nothing but a special kind of wiring for Led's.

The LedControl-lib can drive up to 8 Max7221 (512 Leds)


You have to make some decisions, which might mean some experiments.

The most basic question you have to answer is what "duty cycle" an individual LED has to be on for. If it's 100%, then you need a mechanism that maintains an individual controllable output for each led.

In most cases, you have less than 100% duty cycle, and that lets you share circuitry. You might get away with 1/10 or even less duty cycle.

If you can, then you drive the array with a row/column kind of driver, where you have one "common" side. Let's say you use common cathode. If you can handle 1/10 duty cycle, 10 sets of leds have their cathodes tied together and you have a driver for that set of cathodes.

Let's use simple numbers. Suppose your array was 100 Leds, and 1/10 duty cycle was okay.

You then need 10 sets of 10 leds. You have 10 cathode drivers. Each of them have to be controlled by one bit that software can drive.

For this array, we connect each of the 10 anodes in a "row" together, and we have 10 "columns" tied together. That means we have 10 + 10 bits that drive the array.

One way to use an Arduino is to have the 10 anode rows driven by the arduino, with the 10 columns driven by a shift register which is driven by the arduino. The pattern in the shift register is a single '1' and 9 zeros, and we shift the '1' around the pattern. This drives one "column" at a time. We then drive the 'row' with the arduino pins. The code would a) shift the '1' to the next column b) drive the 10 rows for this column with the correct LED state c) wait 1/10 of a cycle d) repeat for the next column

when you get all the way through the 10 columns, you start on the first one again. You might have a cycle be 1/100 of a sec, so each step is 1 ms.

Now, you can't drive 10 cathodes or 10 anodes directly with the arduino pins, you need something that has more current. So you need a driver. If you are using a low duty cycle, you probably want to drive your LEDs close to their max current to get the max brightness. You need a "driver" that can sink/source 10 times whatever 1 LED needs. You can use external transistors, or ICs that are designed for high current drive.

You have to get the polarity of all of this right (one side of the array has to be driven high to turn on, the other side has to be driven low to turn on), and you may very well need series resistors for the driving. This forum has lots of info on series resistors. They will set the current level.

Your software will of course need a bit in memory for every LED. You need to write code that extracts the right 10 bits at a time, and sends them to the right 10 output pins.

You could use ShiftBrites if you want all the LEDs to be RGB and have 10-bit PWM for each color. They chain together instead of run in a matrix. Of course, it's more expensive than single color LEDs, especially if you don't need PWM. 800 ShiftBrites would be about $2800 though I could probably give you an extra discount. We don't have 800 in stock right now, but should have 3000 in a few weeks.