Pages: [1] 2   Go Down
Author Topic: Controlling 12~ RGB LEDs with an Arduino  (Read 1489 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everyone,
I've seen this project: and I'd like to build something similar but be able to control each LED individually.
Basically I'd like to control approximately 12 RGB LEDs(20mA each color, 60mA for a LED) using an Arduino and avoid multiplexing of any kind.
What would be the cheapest/easiest way to get the job done? I'm planning on using a computer PSU to power it all.

Thank you.
Logged

Montreal
Offline Offline
Faraday Member
**
Karma: 27
Posts: 2573
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It looks like there is no brightness control, just on/off combination of colors.
Should be pretty easy to do with 74HC595 and ULN2803 , as 36 digital pins required you need 5 pairs of chips (8x5 = 40) .
For arduino-mega 74HC595 not necessary.
 http://www.elcojacobs.com/shiftpwm/ for more information.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you, it's very useful.
I am interested in brightness control, won't I be able to dim the LEDs by changing the PWM frequency somehow(Is it ven possible with the shift registers?)?
Logged

Yorkshire England
Offline Offline
Sr. Member
****
Karma: 2
Posts: 267
Arduino good init
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd use some of these http://www.ti.com/lit/ds/symlink/tlc5940.pdf
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks interesting but I can't figure out what current they can handle.
The 60mA(For Vcc<3.6V) or 120mA(For Vcc>3.6V) refers to the current for one channel or all 16 channels?
If the 120mA limit is for all channels it means I can only use 6(I need 20mA per channel) channels at the same time which won't be enough.
Logged

Dubuque, Iowa, USA
Offline Offline
Edison Member
*
Karma: 45
Posts: 2474
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That is 120ma per channel.

This is also an overall limit due to thermal dissipation which is listed in the second table on page 3. Without a complete description of your project it's impossible to say that you'll hit that limit, but if your LEDs are only 20ma it's pretty doubtful. Worst case scenario you just buy a second chip and offload some of the outputs to it.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for your reply.
I'll be using a 5V power source and use all 16 channels.
I'll add a ~2k ohm resistor on the IREF pin so I'd get 20mA output(According to Page 5, Table 1, Equation 3) on each channel.
Assuming all 16 channels would be operating there's going to be at least 320mA. 320mA*5V = 1600mW which is less than the power rating for the PDIP version (http://www.sparkfun.com/products/10136 this is PDIP right?) on the table you were referring to(At 25 deg C).
Is my calculation correct? does it mean I'm in the clear?
Logged

Montreal
Offline Offline
Faraday Member
**
Karma: 27
Posts: 2573
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
320mA*5V = 1600mW which is less than the power rating for the PDIP version (http://www.sparkfun.com/products/10136 this is PDIP right?)
Wrong, power dissipated in LED's as well, more than half for 5V .
Correct formula:  P = 20 * (5 - Vled-red) * Nled-red + 20*(5 - Vled-green) * Nled-green + 20*(5 - Vled-blue) * Nled-blue;
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's even better. That means that if I use 2 LEDs(Each requires less than 2.5V of course) instead of 1 for each channel I can decrease the power dissipated on the TLC5940 substantially.
Thanks everyone!
Logged

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1001
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Just an added bonus.

The TLC5940 has a supporting library for the arduino.
http://code.google.com/p/tlc5940arduino/

It makes them super easy to use.
Logged

Accelerate to 88 miles per hour.

Montreal
Offline Offline
Faraday Member
**
Karma: 27
Posts: 2573
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
That means that if I use 2 LEDs(Each requires less than 2.5V of course) instead of 1 for each channel I can decrease the power dissipated
Well, it's true, the problem only red led's fall in this category, may be green produced via old technology (low brightness). Blue require about 3 V, on some occasions up to 4V. If you need more leds, you could increase a voltage and stack 3 leds in series (for 12V) the same way RGB led strip made.
 
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just an added bonus.
The TLC5940 has a supporting library for the arduino.
http://code.google.com/p/tlc5940arduino/
It makes them super easy to use.
I did note this library but never bothered to check it's website, they have a useful explanation about the power dissipation.

Quote
That means that if I use 2 LEDs(Each requires less than 2.5V of course) instead of 1 for each channel I can decrease the power dissipated
Well, it's true, the problem only red led's fall in this category, may be green produced via old technology (low brightness). Blue require about 3 V, on some occasions up to 4V. If you need more leds, you could increase a voltage and stack 3 leds in series (for 12V) the same way RGB led strip made.
You're right about that, if I do need more power I'll just use 12V(Will be using a computer PSU anyway).

Thanks again for your kind replies  smiley
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 604
Posts: 33448
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
if I do need more power I'll just use 12V
No you won't.
Power and voltage are two different things.
Logged

Atlanta
Offline Offline
Full Member
***
Karma: 4
Posts: 128
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
if I do need more power I'll just use 12V
No you won't.
Power and voltage are two different things.
if op uses common-anode and a drive transistor, might work though?
Logged


SF Bay Area
Offline Offline
Edison Member
*
Karma: 11
Posts: 1244
Arduino Ninja
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If they need more light output power, they can add more LEDs in series, and then use a 12V supply to handle the increased forward voltage. I think that was the thought behind the statement.  smiley-lol
Logged

Unique RGB LED Modules and Arduino shields: http://www.macetech.com/store

Pages: [1] 2   Go Up
Jump to: