Controlling the brightness of ~50 leds.

What should I use to control the brightness of ~50 single colour leds? I just need a large range of brightness values to create smooth fades.

Should this be done with a multiplexer such as a the Mux shield, or is there a another method more suited.


Controlling all of them at once (all LEDs are the same brightness) or each LED individually?

all indiviudally, at the same time. So to create a start up like sequence all fading to 100%, but with a delay along the line.

Sounds like a job for TLC5940. 16 LEDs per device, PWM control on each one. 3 would drive 48 LEDs. Check the playground for a library to use them. Datasheet at

The PCA9685 also controls 16 LEDs this one has the advantage of being I2C controllable so it is easier to locate them further away from the arduino. Its disadvantage is that it is a surface mount device.

Thanks for the tips guys.

I started building a prototype with a multiplexer, but I could start see some visible flickering on 20 Leds - probably my poor code than anything else.

No issue having the chips close to the arduino, since it is planned that after the prototype each led will be fed into an amp to power a load of them.

started building a prototype with a multiplexer,

A multiplexer is not the way to do this with you wanting to control the brightness.

probably my poor code than anything else.

No it is the overhead of using a multiplexer.

So I have a related Project, I join the thread…
We rebuild the rooms of our kids and par of that is to have -at least- one room, which should be illuminated mainly from indirect lights in the corners. To have an idea, something like this:
I think we end up in about 10 “lamps”. Each of it should have the possibility to fade from 0 to 100% brightness and fade to all the colors. So I will have to control RGB in each.
Most likely I will have different number of LEDs in each lamp (think of lamps for light and lamps for ambient light e.g.)

Something like this:
-one controll for the lamps: ALL, Lamp1, Lamp2,…
-1 controll for each color brightness (moving all controls simultaneous should than be the brightness of white light, I think)
-nice to have: brightness separately

First I thought of doing this by controlling all LEDs (40, at least) directly from a arduino, but I think there are better ways
As long, as the lamp control isn’t switched to “ALL”, each lamp should stay in the last status chosen before.

control is switched to lamp1, I choose 50% blue for that. Than I switch over for Lamp2, an choose a 70% yellow for that, while Lamp1 stays in 50% blue.
Until I switch to “ALL” and illuminate the room with e.g. 100% white by raising all color controls to 100%

Well looks like TLC5940 is definitely the answer. thanks!

mclien: Maybe Shiftbrites might be a solution? -

maybe. Some questions, reulting from my beginners state and non-native english (I'm german). The sample code is just for one Shiftbride. Does the "SB_CommandMode" address the divice and register of it? (is there a sample code for at least 2 devices)

So I would need a "data" bus of 4 lines as signal and a 2-wire "powerline" to run an "unlimmeted" number of ShiftBrites, right? And I'd like to find a distributor for them in germany (to avoid "tax-office terror")