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:
Does this sound like the right approach?
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).
What other projects similar to this have you built?
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:
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)
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.
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.
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.
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.