Go Down

Topic: controlling rgb leds through mosfets (Read 436 times) previous topic - next topic

timmie

Hello everyone,

for my project I want to control 9 nine rgb leds, they can all have the same color and I will use three pwm ports to control them. Though I don't know what the current should be, I know that 9 leds on one pin could damage my arduino. Therefore I would like to use mosfets to power the leds. I would like to use  something like here http://www.jerome-bernard.com/blog/2013/01/12/rgb-led-strip-controlled-by-an-arduino/

However, my leds are common cathode so I do not know where the + from my power source should go to, also I do not know how I can calculate the resistor value. All the information on my leds (not a lot) can be found here http://www.ebay.com/itm/50-100-500-1000-pc-5mm-4-pin-RGB-Diffused-Common-Cathode-Common-Anode-LED-/130979690146?ssPageName=ADME:L:OC:NL:3160

Please tell me if I forgot any details and thanks for your help!

Tim

Grumpy_Mike

You can't control those LEDs with that FET
For common cathode you need a top switch that is either a PNP transistor or a P-channel FET.

They look like standard 20mA LEDs so treat them like any other LED each anode will need its own resistor, so theat is three resistors per LED.

timmie

Thank you very much for your reply. As for the resistors, I have soldered all the green together, all the blue etc, so I have only 4 wires. three colors and ground. Can I use one resistor per color, so three in total, or do I need 27?

Grumpy_Mike

Quote
I have soldered all the green together, all the blue etc,

Do get your iron out and unsolder them.

Quote
Can I use one resistor per color, so three in total,

No

Quote
or do I need 27?

Yes.

You can not connect LEDs directly in parallel, they will not share current and anyway even if they did the resistor value would be stupidly small.

Go Up