Go Down

Topic: 20 RGB LED Mood Lamp (Read 866 times) previous topic - next topic

nitinarora

Hello kind people,

I am in the process of making a mood lamp using 20 RGB LEDs (common anode) and have 2 questions about the circuit:

1. I plan to drive these LEDs with each color channel in parallel using an NPN transistor driven by a PWM pin (3 NPNs for 3 colors). 20 LED's would be ~400ma for each channel so i plan to use a PN2222a transistor as a low side switch (data sheet says Ic max is 1 amp). Could someone please tell me if the below calculation for the base resistor is correct.

Ic = 400ma
hFE (min) = 35
Ic/hFE = 11.42
Base Current = 22.85ma (11.42 x 2 to ensure saturation)
Vbe = 0.8
Rb = (5 - 0.8)/22.85 = 184 ohms

I have made a quick excel for this so if someone could let me know if this is correct i could re-use the calculator going forward.

2. I am aware that LEDs in parallel need to have a resistor for every LED. Is it possible to use a single resistor at the anode of every led instead of wiring 3 per LED. I understand that the resistors need to be different since the red led has a lower forward voltage but if I wire a 100 ohm resistor to the anode would it serve the purpose or the red led would just eventually burn out?

Much appreciate any suggestions.

johnwasser

>  Rb = (5 - 0.8)/22.85 = 184 ohms

That should be:  Rb = (5 - 0.8)/0.02285 = 184 Ohms

Once the transistor is fully on the base current beyond that isn't critical so I would go for 30 mA which is still well within the 40 mA maximum for the Arduino pin.  That would calculate out as 140 Ohms.

> 2. I am aware that LEDs in parallel need to have a resistor for every LED. Is it possible to use a single resistor at the anode of every led instead of wiring 3 per LED.

No. Current is the quantity of electrons.  For components in series the current is the same through each component.  For components in parallel the current is shared across the components.  If you use a single resistor for three LEDs the current through the resistor has to be the SUM of the current through each LED.  Unfortunately there is no way to force that current to be shared equally across the three LEDs.  You end up with some LEDs hogging the current and burning out.

If you had separate LEDs instead of RGB units you could put LEDs of the same color in series and use a higher voltage to drive them.  If they are in series they all get the same current.  A constant-current driver or single resistor can then adjust current for all of them.  Twenty in series would require 20 to 60 volts so usually parallel and series are combined: Four strings of five, for example.  Each 'string' needs a resistor or constant-current driver.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

fungus

#2
Oct 17, 2012, 04:06 pm Last Edit: Oct 17, 2012, 04:12 pm by fungus Reason: 1

2. I am aware that LEDs in parallel need to have a resistor for every LED. Is it possible to use a single resistor at the anode of every led instead of wiring 3 per LED. I understand that the resistors need to be different since the red led has a lower forward voltage but if I wire a 100 ohm resistor to the anode would it serve the purpose or the red led would just eventually burn out?


Resistor at the cathode? No way. The red LEDs would die long before you got enough light from G+B.

OTOH if I understand it correctly you have a transistor for each color (3 in total) and the cathodes for each color all connect to their corresponding transistor. In this case you could probably connect a resistor to the transistor's collector and connect the cathodes to the other end of the resistor (it's not good engineering practice but it'll probably work).
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

nitinarora

Thank you gentlemen.....think i will end up soldering separate resistors to each of the cathodes....60 resistors that's going to be a task :)

Go Up