Arduino, 6x Analog RGB LEDS + Transistors

Iya guys

hope you can help

I need to run 6 x RGB LEDS from 3 PWM pins (all LEDS are light same colour at one time)

I need more Amps so wanted to use a transistor But im having strange results when using them get differnt colours to what i should.

Can you use transistors with PWM ?

hey you could use my driver bu you would have to add resistors to each R G B pin so that you could run them from 12v or lower but i dont know how low can go maybe it can run from 5v would have to look at the data sheet

to make it smaller you could use a ULN2003 insted of the mosfets i used

But im having strange results when using them get differnt colours to what i should.

“strange”? What on Earth does that mean?

Can you use transistors with PWM ?


You haven’t said what sort of LEDs you’re using.
Common anode?
Common cathode?

@Gavzorz - I’m not sure you’re going to be saturating those MOSFETs with a logic-level gate voltage - they’re going to get hot if you’re not careful.
Where did you get the circuit from?

using common anode RGB LEDS and spec sheet says 20ma

So, what is "strange"?

(sp. "mA")

sorry mA

strange from the point of view that i set code to show red and i get some white leds and some green. colours are not correct

You're remembering that common anode LEDs will be "inverted" from what you would probably expect, i.e. outputting a LOW will turn the LED on?

How do you get white LEDs?

@AWOL hi, i found a pwm led driver that used a PIC and i looked at the schematic and just took out all the unused parts and got it down to that here is the link to the PIC project

is it wrong then?

sorry its this link

yes iv just inverted some of the colour values and i see red

thanks for the help

@Gavzzorz: Not sure, the datasheet is a bit unclear and the electrical specs are not in a standard form, but I don't think I'd want to use those devices for higher currents.

@ AWOL fair enought :) i have used it with 20 common cathode rgb leds so say that is 60 leds mono color leds and a cold cathode light and it didnt get how at all supose that isnt much current tho


AWOL you seem to be the guy to talk to, i dont supose you could help me with my post please need help ;( haha

As I said, it isn’t easy to tell from that datasheet.
What you’re looking for is the value RDS with the lowest value of VGS.
For common MOSFETs, RDS will be a few tens of milliohms, but with a VGS of 10V. This may mean that with a logic level gate voltage, the value of RDS may be considerably higher, meaning that the device may get very hot with higher currents (W=I2R and all that).
So, you need to find MOSFETs described as “logic” (often the same device designation, but with an ‘L’ somewhere in it) with a VGS of around 4V.

get differnt colours to what i should.

Check out my posting "RGB LED Woes" (I'm pretty sure that's what I entitled it) a couple of weeks ago.

Among other things, the apparent brightness of the R, G, and B LEDs is likely to be very different, unless the manufacturer has designed them to conform to the sensitivity spectrum of the human eye. Which they certainly didn't do for the ones I bought, and apparently don't often do (based on the replies I got).

For a half-dozen LEDs (assuming they're of the typical 20mA variety), you can use any old popular NPN transistor like the 2N2222. Multiple examples are available in the hardware interfacing sections of the Playground.


Nice schematics. A couple of nitpicks: Ground is usually denoted GND (not GRD). And the LED's are in the wrong direction ;)

Raron: haha thanks just did it fast on paint as you san see haha and thanks for pointing it out :slight_smile:

sorry for reviving the thread but posting a new one is more harm i guess. I've been working on a similar project witch involves lots of programming witch i like. I've build mine similar to the drawing on the first post, and i use comon cathode 5mm RGB Led's 5v 20mA. I hocked 3 Leds to my arduino but i didnt use the "MOSFET" thingy cause i don't know what that is. Point is my LED's don't produce the colors they should. Simple Red, Green and Blue work perfect but anything in between dosent work as it should. Instead of getting Yellow light i get two circles on my wall, one is Green and the other is Blue. Is that how it's suposed to be? I read lots of forums and people saying with RGB leds and analog pins with PWM you can control each pin's output and therefore get any desired color. I'ts exacrtly what I'm doing except 0,255,255 dosen't produce Yellow at all.. Any ideas, could it be the "MOSFET" thingy i'm not using? :-/

posting a new one is more harm i guess.

No you are better off starting a new thread. People tend to see a long thread and think it is not worth the effort of reading it all to see if they can contribute.

i get two circles on my wall..... Is that how it's suposed to be

Well that is how it is. This is because the three LEDs are not physically in the same place so there is a bit of displacement in where the light ends up. You can improve things by lightly sanding the LEDs or adding a diffuser close to the LED like a ping pong ball. Yellow is hard to generate with some LEDs, this is because the same amount of current does not produce the same amount of light.

could it be the "MOSFET" thingy i'm not using


Good idea bout the ping pong ball :) The thread can die at peace now :) Thanks for everything.