Go Down

Topic: RGB LED lighting fixtures (Read 4730 times) previous topic - next topic

shockeymonkey

Sep 28, 2011, 06:41 pm Last Edit: Sep 28, 2011, 06:45 pm by shockeymonkey Reason: 1
this is my LED light project for my home.

I am building a 4 RGB LED stars per fixture, and for each of their RGB levels to be controllable.  I have enough LEDs presently to build 4 fixtures, all controlled by a single arduino.

I took some circuit-building and basic electronic classes in high school 6+ years ago, but I've forgotten most of it. :(

my arduino duemilanove firstly, does not have that many outputs, it only has 5 pwm outputs.
I need 4 LEDs * 3 colours (rgb) * 4 fixtures = 48 PWM outputs.  This seems relevant and awesome: http://www.elcojacobs.com/shiftpwm/ and http://www.arduino.cc/en/Tutorial/ShiftOut

the specs for the LEDs I have are:
Red: 2.5V ~ 3.0V, 350mA
Green: 3.2V ~ 3.8V, 350mA
Blue: 3.2V ~ 3.8V, 350mA

lastly, my arduino duemilanove is powered by 5v 2.5amp wall wart via the barrel plug. no idea if that'll meet my needs for the project goal.

What components do I need to drop the 5v supplied power from Vin on the arduino to meet the desired 2.5v and 3.2v?  How do I control how much current is flowing?

As well, I can't just plug one of these LEDs into my Arduino, it needs way more current than the pin can safely supply.  I have been doing a lot of reading, and MOSFETs seem like my answer, specifically this one (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=497-2765-5-ND); however it seems overpowered for my needs, and I'd need 48 of them.  Is there something else that is more appropriate for my needs?

Thanks for reading my thread, and if you have any constructive criticism or tips please post!  I'd love to read them.

Grumpy_Mike

Quote
What components do I need to drop the 5v supplied power from Vin on the arduino to meet the desired 2.5v and 3.2v?

You don't power LEDs by applying the forward volts drop to them.

Quote
How do I control how much current is flowing?

For each LED you have a constant current supply, there are many circuits out their for this. You control each one of these with a PWM output.
Most constant current supplies also dissipate a lot of heat so you need good heatsinks.

High power LED discussion & useful links off these pages
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1234273497
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1258412419

To drive 4 fixtures each with 3 LEDs taking 350mA each you need a supply at least capable of providing:-
4 * 3 * 0.35 = 4.2 Amps

GuitarBuilder

I highly recommend you look at the Macetech approach:

http://macetech.com/blog/

Their ShiftBar (http://macetech.com/store/index.php?main_page=product_info&products_id=10&zenid=fa1e90cc33bb34a3ee673c3a321016eb) and Satellite Module (http://macetech.com/store/index.php?main_page=product_info&cPath=1&products_id=16) seem to be a good fit for your project.

majordecibel

Sounds like a cool project - always fun to see how people put these kinds of things together :) Make sure to post some pictures

shockeymonkey

#4
Sep 29, 2011, 08:45 am Last Edit: Oct 02, 2011, 10:02 am by shockeymonkey Reason: 1
wow! so many helpful replies already!

I tried out my LEDs a bit, I have a bench power supply.  I set it to 3V, and used a 10kΩ resister to see how each LED emitted.  Extremely disappointing results, all are were barely glowing. Only now do I realize it was a 10k resistor, I had just grabbed a random one from my bin.  I need a one with less impedance to draw more current to cause the LED to glow brighter.

Quote from: Grumpy_Mike

To drive 4 fixtures each with 3 LEDs taking 350mA each you need a supply at least capable of providing:-
4 * 3 * 0.35 = 4.2 Amps

Thanks, this is very helpful!  This number first seems like a lot.  But it's actually more.
If I was running 4 fixtures, each with 4 RGB LEDs, emitting pure white (all rbg channels on), it'd be bigger still.
4 fixtures * 4 LEDs stars per fixture * 3 RGB channels per star * 0.35a per LED= 16.80A
16.8A * 5V = 83.5 watts
Wowee.  I should know that, they're 3W LEDs, and I have 16 of them.  I have a PC power supply I can use for this.  It's rated for 30A at 5V, so sufficient, sadly actively cooled (aka noisy) and big.  Not what I'll use in the end but will be a bench supply.

Quote from: Grumpy_Mike
You don't power LEDs by applying the forward volts drop to them.

Thanks, this and those links led to great information.  I seems like I can use 3 resistors to do this, but then I'd be generating a sizey amount waste heat as it's for 12 channels.  I'm looking at http://www.instructables.com/id/Power-LED-s---simplest-light-with-constant-current which has a simple circuit I can replicate 12 times to control the LED channels. 

in the instructable he says:
Quote
LED current is set by R3, it is approximately equal to: 0.5 / R3


0.5 / 1.11 ohm = .450mA

1.11ohm resistors seem to exist so I'm in luck.
resistor power is:
- R3 power: the power dissipated by the resistor is approximately: 0.25 / R3
watts = 0.25 / R3
watts = 0.25 / 1.11
.225 watts. need 0.5w resistors

16 x approximately 100k-ohm resistor (such as: Yageo CFR-25JB series)
16 x 1.11 ohm resistor (0.5w)
16 x small NPN transistor (such as: Fairchild 2N5088BU)
16 x large N-channel FET (such as: Fairchild FQP50N06L)

Small progress.  I need to find some wires to solder onto the LED stars and to go buy some parts.


I highly recommend you look at the Macetech approach:

http://macetech.com/blog/

Their ShiftBar (http://macetech.com/store/index.php?main_page=product_info&products_id=10&zenid=fa1e90cc33bb34a3ee673c3a321016eb) and Satellite Module (http://macetech.com/store/index.php?main_page=product_info&cPath=1&products_id=16) seem to be a good fit for your project.

Thanks, that stuff looks like I could slap something together in days.  Looks a bit expensive though for my scale.  I was tempted to buy one for a 12v RGB LED bar I have, but their shipping is $12 for an $8.99 product. =(


Sounds like a cool project - always fun to see how people put these kinds of things together :) Make sure to post some pictures

Thanks, LEDs are marvellous!  I have been percolating on this idea for some time, so I'm excited to see it realized.  I'll get some pictures going as I start construction, thanks for the tip!

Grumpy_Mike

It's not the resistors that are the problem with that circuit it is the power dissipated in the FET. It is working in the linear mode so you need to work out the voltage across it times the current. The voltage across it will be the supply voltage minus the forward volts drop of the LED or LEDs minus the volts drop across R3.
Then look up the package dissipation of the FET you are going to use and the size of heatsink you will need to make it run without melting.
How to do these calculations are given here:-
http://www.thebox.myzen.co.uk/Tutorial/Power.html

shockeymonkey

#6
Oct 02, 2011, 09:20 pm Last Edit: Oct 03, 2011, 03:25 am by shockeymonkey Reason: 1

It's not the resistors that are the problem with that circuit it is the power dissipated in the FET. It is working in the linear mode so you need to work out the voltage across it times the current. The voltage across it will be the supply voltage minus the forward volts drop of the LED or LEDs minus the volts drop across R3.
Then look up the package dissipation of the FET you are going to use and the size of heatsink you will need to make it run without melting.


Ah ok.

LED spec again:
Red: 2.5V ~ 3.0V, 350mA
Green: 3.2V ~ 3.8V, 350mA
Blue: 3.2V ~ 3.8V, 350mA

R = (Vs - Vf) / Imax
Rred = (5v - 2.5v) / 0.350 mA
Rred = 2.5v / 0.350mA
Rred = 7.142857142857143 ohms

Rblue = (5v - 3.2v) / 0.350mA
Rblue = 1.8v / 0.350mA
Rblue = 5.142857142857143 ohms

Rgreen ~= Rblue

I soldered all of my 12 LED stars up with wires now, and tested each one, and did some test running 4x at once.
used 3 330 ohm 1/4w resistors powering the 3 RGB channels.  Very bright now, but only running up to 5v 250mA for all 3 channels.  Really excited now to see their full potential.

Also one thing to note! These are common anode LED stars, they're mislabelled.  That means I'm not using an NPN transistor any longer, but a? PNP I think?

Attached is a picture of 4 stars breadboarded in with 3 330 ohm 1/4w resistors.

dc42

I'm a great fan of mosfets, but a mosfet is overkill in that instructables article if you only want to sink 350mA for a LED. You can use any NPN transistor with a reasonable hfe at that current (such as the BC337) instead of the mosfet, if you reduce R1 to about 330 ohms. To control the LED from an Arduino, connect the upper end of R1 to the Arduino pin instead of the supply.

I think you'll find that the LED current is closer to 0.65/R3 than 0.5/R3.

To drive power LEDs efficiently, you need to use a buck converter circuit or similar rather than a series resistor.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Grumpy_Mike

Quote
This are common anode LED stars, they're mislabelled.  That means I'm not using an NPN transistor any longer, but a? PNP I think?

No common anode RGB LEDs need to use a NPN to switch them on and off.
It is common cathodes where you need a PNP.

Go Up