Multiplexing 81 LEDs with Arduino Due - Advice for a Noob?

I’m just looking for a bit of advice to get started.

I have 81 LEDs to control individually from a sketch. These will be RGB LEDs and as bright as I can afford. I have the Arduino Due (actually it is an UDOO Duel, with an Arduino Due built into it).

Can anyone recommend a multiplexing approach to start me off? To my understanding, the selection of four-pin RGB LEDs may complicated things. If this makes the task impossible I would consider switching to two-pin LEDs.

r4gt4g: I'm just looking for a bit of advice to get started.

I have 81 LEDs to control individually from a sketch. These will be RGB LEDs and as bright as I can afford.

I'd recommend 10-12mm LEDs for brightness. Clear plastic if you want to shine them on something to light it up, diffused if you're going to be looking directly at them.

Go on eBay and look for "LED pixels", although I'm not sure they do them in clear plastic.

If you need clear plastic you can make your own:

http://www.ebay.com/itm/111126383189 http://www.ebay.com/itm/111086321121

Just add wire.

(nb. auctions picked at random)

You could also get a WS2811 LED strip and chop it up into individual LEDs. That would be cheaper but not so bright (although still much brighter than multiplexing).

You could drive those with any Arduino, even a Tiny85.

r4gt4g: Can anyone recommend a multiplexing approach to start me off? To my understanding, the selection of four-pin RGB LEDs may complicated things. If this makes the task impossible I would consider switching to two-pin LEDs.

Four pins doesn't make a difference. Buying common-cathode instead of common anode would

(common cathode=bad, mmmkay).

Muliplexing? Far more difficult for very little gain (and a decrease in brightness)

Multiplex & high brightness are contradictory. If you want bright, the LEDS need to be on all the time, not turned on & off & on & off to be on 1/8 the time or similar. Look at some of the LEDs here: http://www.dipmicro.com/store/index.php?page=1&act=viewCat&catId=511 Individual LEDs will always be brighter than RGB LEDs, mostly due to how much heat can be dissipated in a given package size. If you really want bright, then go with high output LEDs with discrete drivers. If you can live with just blindingly bright, than 8000-10000 mcd LEDs are pretty dang bright!

I have 81 LEDs to control individually from a sketch. These will be RGB LEDs and as bright as I can afford.

So that is actually 81 * 3 = 243 LEDs then. Just having them on or off will simplify the design but you will be limited to just seven colours.

the selection of four-pin RGB LEDs may complicated things.

Not very much, you are just restricted to current sinking drivers that's all.

I'm just looking for a bit of advice to get started.

Start with trying just 8 RGB LEDs to get the hang of what you are doing. Scaling up is not simply a matter of just repeating what you have done, other factors come into play. Also over what distance do you want them to be spread out. The power supply requirements are going to be quite steep also.

As CrossRoads said multiplexing is not the best way if you want them to be bright. That will be best with a shift register. However until you give more detail about what you actually want and why it is difficult to give good advice.

CrossRoads: If you can live with just blindingly bright, than 8000-10000 mcd LEDs are pretty dang bright!

The 10mm RGB LEDs in that auction I mentioned are 12000/24000/20000mcd Wear sunglasses... :-)

Grumpy_Mike: However until you give more detail about what you actually want and why it is difficult to give good advice.

Yep. How the LEDs will be viewed is critical to choosing the right ones.

Thanks people!

To clarify, I am just looking to be able to turn on and off 81 LEDs individually and control their color, preferably. Preferably I'd be able to turn them on and then dim them to off. So I'm not committed to multiplexing, it's just the only method I was aware of to control so many LEDs with just one Arduino Due.

As CrossRoads said multiplexing is not the best way if you want them to be bright. That will be best with a shift register.

So a shift register is a good bet that would not result in dimming?

Also over what distance do you want them to be spread out

I'd be controlling these LEDs in pretty close proximity to the Arduino.

To clarify: I'm going to be hooking these LEDs up to 2 or 3 mm fibre op so the LED's would need to provide directional rather than diffuse light. The fibre op is just going to be crudely taped to the LEDs - just a proof-of-concept. Since the fibre op is just 2 or 3mm, it limits how big I can go with the LEDs, too.

r4gt4g: To clarify, I am just looking to be able to turn on and off 81 LEDs individually and control their color, preferably. Preferably I'd be able to turn them on and then dim them to off. So I'm not committed to multiplexing, it's just the only method I was aware of to control so many LEDs with just one Arduino Due.

If you use something with the word "WS2811" in the name then you can control any number of LEDs with one Arduino pin.

r4gt4g: So a shift register is a good bet that would not result in dimming?

No.

r4gt4g: To clarify: I'm going to be hooking these LEDs up to 2 or 3 mm fibre op so the LED's would need to provide directional rather than diffuse light. The fibre op is just going to be crudely taped to the LEDs - just a proof-of-concept. Since the fibre op is just 2 or 3mm, it limits how big I can go with the LEDs, too.

To me the WS2811 boards still seem the best way to do that. Each board can control one common-anode RGB LED. All you need is those, some LEDs and some wire to join them together.

http://www.ebay.com/itm/111126383189

First of all though, you need to find a LED that works for you.

WS2811 is pretty much a 3-bit shift register; just has a constant current driver output.
Better bet might WS2803, can drive 6 LEDs.
81/6 = 14 parts.
Can find on e-bay, ship from Niagara Falls.
I have a tube of them at home, will get around to using them eventually.

WS2803-preliminary-En.pdf (437 KB)

CrossRoads: WS2811 is pretty much a 3-bit shift register; just has a constant current driver output.

No, it does 24-bit color.

How many output pins does it have? 3. The color mix is determined by the PWM control of each pin.

Thanks fungus,

I'd like to consider using the OctoWS2811 with LED strips. http://www.pjrc.com/teensy/td_libs_OctoWS2811.html

Using the WS2811-type boards with a lot of LEDs sometimes draws too much power for an Arduino like the Due, correct? In these cases I understand that a transistor with a separate power supply to the controller can be used? I ask because the complications that gearing up a separate power supply with LED strips and OctoWS2811's might mean I try to make lower-power LEDs work.

CrossRoads: How many output pins does it have? 3. The color mix is determined by the PWM control of each pin.

Oh, I see...

Those little WS2811 boards will be easier/cheaper than a big chip+PCB+discrete components. You can solder the LEDs directly to the PCB then all you need is wire to connect them together.

I used to think big chips were better, too. They still are for matrices, etc., but IMHO the world has changed as far as individual RGB LEDs go. YMMV.

r4gt4g: Using the WS2811-type boards with a lot of LEDs sometimes draws too much power for an Arduino like the Due, correct?

No need to guess, it's basic math.

81 x 3 x 20mA is 4.86 amps. Far too much for a Due, yes. You need an external power supply (about 6A would be good).

Make sure you join Arduino GND and power supply GND before connecting anything else. Magic smoke may escape if you skip this step (also if the ground wire falls out of the Arduino connector - I usually solder the GND wire to the metal USB socket on the Arduino to be sure this doesn't happen).

Really depends on the planned layout. Use as a strip was added late in this discussion. Single controller could be good there.

Use as a strip was added late in this discussion. Single controller could be good there.

The layout of the LEDs doesn't matter for the project - could be a grid or a strip.

81 x 3 x 20mA is 4.86 amps. Far too much for a Due, yes. You need an external power supply (about 6A would be good).

Just to confirm - that 'x 3' is because those are RGB LEDs?

r4gt4g: Just to confirm - that 'x 3' is because those are RGB LEDs?

Yes.

RGB LEDs have three separate LEDs inside them.

If you can live with the brightness of existing WS2811 LED strips, then strips would be be a good way to go. If making your own with seperate LEDs, then price out both methods, check out space required, factor in time savings from 1 set of power/gnd/control with 1 WS2803 for 6 LEDs vs 6 sets of power/gnd/control for 6 WS2811 for 6 LEDs, etc. It's engineering - everything becomes a tradeoff.

Thanks Crossroads,

check out space required, factor in time savings from 1 set of power/gnd/control with 1 WS2803 for 6 LEDs vs 6 sets of power/gnd/control for 6 WS2811 for 6 LEDs

I'll give that some consideration!

CrossRoads: factor in time savings from 1 set of power/gnd/control with 1 WS2803 for 6 LEDs vs 6 sets of power/gnd/control for 6 WS2811 for 6 LEDs, etc.

The trick is in the word 'set'.

"1 set" for WS2803 isn't the same as "1 set" for WS2811.

I bet I can connect up 6 WS2811 LEDs before CrossRoads can build his PCB setup for WS2803 chip+LEDs. I think the WS2811s will be slightly cheaper too (six boards is about $1.50 and that's all you need - no PCB, no chip socket, no decoupling capacitors, etc).

CrossRoads: If you can live with the brightness of existing WS2811 LED strips, then strips would be be a good way to go

It's probably not easy to attach a fiber optic to a 5050 LED. You can attach it to a normal LED with a bit of heat-shrink tube.