Using a large number of distinct LED's

Hello all.

I'm starting a new project that will utilize a large number of LED's that will only have two lit at any one time. I'm taking my existing "junk" in the basement and building an electronic forest in an empty aquarium. The LED's will be 'sprites' that play and chase each other in the forest. An UNO plus some additional circuitry to control the lighting and then later add sensors to modify the behavior of the sprites as people approach, night falls, etc.

The LED's will be RGB's with a common anode. Each color leg will run to a common ground (for that color only) controlled by an NPN transistor cycled using PWM. The individual LED being lit is controlled by I2C I'm thinking. With this method I should be able to use the UNO's A4/5 pins to control which two specific LED's are being lit and then PWM to control the color. I figure if I use a 50/50 duty cycle I should be able to have them be individual colors and it not be noticeable except for brightness.

So my two questions at this point are:

  1. Does this sound like the right approach?

  2. What would you recommend using and why?

I ask the second question because I've tried doing some preliminary searching and quite frankly there's just a lot out there. I'd also like to learn about possible alternative methods as well (they may fit other projects).

Thanks everyone.


The individual LED being lit is controlled by I2C I'm thinking.

How? Are they on some sort of I2C controller?

No, I think he's just imagining some fancy design in his head...

My two questions at this point are:

  1. What other projects similar to this have you built?

  2. How good are you at software?

I don't think your approach will work because:
a) Three transistors per LED? That's an awful lot of transistors to control (Arduinos have limited legs).
b) There's no planning for current regulation (amps) - LEDs need it.
c) The sheer amount of wires you'll need. Four wires from each LED back to the Arduino adds up to a whole lot of cable.

You could fix those problems by having several LED controller chips (eg. TLC5940) spread around the tank but if it was me doing this I'd get one of these and cut it up into individual LEDs:

If you do that you'll only need two wires from the Arduino to the first LED then three wires from each LED the next LED in the chain.

Whichever method you choose, understand that the software side will be non-trivial, hence my question 2.

I do hope you build something, because it sounds interesting, there are really many ways to blink an LED, using a micro-controller makes things even more robust.

how about doing the aquarium with many different ways of blinking an LED. use shift registers, and different types of driver chips. Maybe you could have varied amounts of sinking and sourcing too. It could also serve as an example of many ways of solving one specific problem (blinking leds)

This post describes how I wired up 32 LEDs with 4 shift registers. The number of wires from the Arduino was small (4). With suitable programming you could make individual ones come one, or sequence.

I would organize the leds into a matrix and use switches for row/column to pipe pwm signal to those things.

I would organize the leds into a matrix and use switches for row/column to pipe pwm signal to those things.

The big problem with that is that you will then have to synchronise the matrix scanning with the PWM signals. That is not an easy thing to do.

Okay. So after some searching this is what I’m thinking.

The PCA9685 seems to answer a lot of my problems. With 4 PCA9685 per LED I can individually control on/off/intensity plus the RGB hue as well (RGB via transistor). It has a built in 220 ohm resistor (easier to wire) and at 5 volts would make an RBG LED use 10ma with all 3 legs at 100% (within the 25ma rating per channel of the controller). Each one is capable of PWM so I can control the hue and the intensity as well. No shift register to use, just have to make sure everything is named properly. Coding will be lots of fun for sure. :wink:

My thought is to have a few shields or rapid prototyping circuit boards stacked like a parking garage with each layer controlling a different function. One for on/off, red control, blue control, green control. This could even be incorporated directly into it as a castle type structure.

First draft wiring diagram attached.

Specific controller from Adafruit:

Why not use two WS2803 to control the 12 RGB LEDs? Be way simpler.

[Edit - correct datasheet attached]

WS2803-preliminary-En.pdf (437 KB)

So after some searching this is what I'm thinking.

Something like that stands zero chance of actually working: it is more complicated than it needs to be and it has numerous errors.

Think simple.

16 x Basic Stamp? Whoa.

After thinking about it, I can just run a common power to all the LED's and control the individual legs on the ground side. Reduce cost and complexity. Run it with an old 250W PSU from a pc and I'll have a regulated voltage plus more amperage then I'll ever need. Just gotta get those resistors right.

Thanks for the suggestion Crossroads. After realizing that I don't really need to control much amperage I think I'm going to search out some more options. I'll just have a lot of transistors to wire up, but no biggie.

"Something like that stands zero chance of actually working: it is more complicated than it needs to be and it has numerous errors.

Think simple."

Uhm, thanks for the help. I think. I want to have 30+ LED's and be able to control any of them individually to be off or on and their color as well. If you have a simple suggestion on how to do that, I'm all ears.

"16 x Basic Stamp? Whoa"

That's why I like doing projects like this. Hearing people say that.

Thanks again everyone.

Still looking this over btw.

I can light up 64 RGB LEDs with an arduino and no other parts, but that may not be whats best for you, I thought you wanted to use lots of parts.

The 2x WS2803 will control the 36 cathodes for you with PWM control on each for fading & color mixing. No transistors needed.
Couple dollars each from guys out by Niagara Falls
Then look at WS2801 library for controlling them.

To put my remark into context:

For my sins , I am making some prototype displays that use 840 LEDs each.

Because of availablilty here, I am using SAA 1064 chips that can drive 16 LEDs at a time latched, or 32 at 50% multiplexed.

For the proto I am wiring by hand :frowning: but later ones will have a pcb.

Its I2C driven and has 4 addresses, so you can have 128 LEDs driven by 4 chips from 2 pins of the Arduino .

I am using 7x5 matrix displays, but you can change any LEDs as you wish.

Heres a shot of whats been keeping me busy this holiday season .
This is for one of the chips ( which havnt arrived yet, hence the socket )

Seems you need to look into etching boards at home for future projects when your PCB suppliers are not available John.