Common Cathode RGB Tranny/PWM/Arduino

I wanted some common anodes, but I got a common cathode RGB led. Just want to make sure my idea will still work, avoiding sending it back :).

So, I want to power the three individually and do what everyone else does by getting some cool colors.

I have these transistors, http://www.futurlec.com/Transistors/IRF740.shtml They're MOSFET N Channel.

My circuit will be something like this

+v -----|----------------| | LED LED LED ARDUINO-----Tran----Tran---Tran | | | | | RESIS RESIS RESIS 0v--------------------------------------

Will that work correctly with those transistors?

You shouldn't need the transistors, unless your LED(s) can take a current higher than 40ma. If less than 40ma, the circuit would look something like:

+V--A
     r
     d 3--------------LED
     u                 |
     i 5---------LED   |
     n 6---LED    |    |
     o      |     |    |
     |    R220  R220 R220
0V--L------L-----L----L

Your code before setup() would be something like:

    const byte led1Pin = 3;
    const byte led1Pin = 5;
    const byte led1Pin = 6;

Your code in setup() would be something like:

    pinMode( led1Pin, OUTPUT );
    pinMode( led2Pin, OUTPUT );
    pinMode( led3Pin, OUTPUT );

Your code in loop() would be something like:

    byte led1Value = ...;
    byte led2Value = ...;
    byte led3Value = ...;
    analogWrite( led1Pin, led1Value );
    analogWrite( led2Pin, led2Value );
    analogWrite( led3Pin, led3Value );

If you have high current LED's then transistors are needed. Just make sure your resistors can take the power. Resistors are rated in watts. W=V*A. Most are 1/8, 1/4, or 1/2W. I think that a 3W LED will take at least a 3W resistor. I haven't seen 3W resistors, but 5W are pretty easy to find.

Your original diagram showed common-anode LEDs. Just to make it clear: common anode = positive end common; common cathode = negative end common.

Also, those transistors are 10 Amp rated MOSFETS -- much bigger than you need!

It's a 3w LED, so I think I'll need the transistors (nearly 500 mA max draw!).

I definitely am confused on the naming, seems I got what I ordered!

Ah, OK! A 3W LED will need half an amp or so!

It's a 3w LED

So you can't do the current limiting with just a resistor you need a constant current source module and lots of heat sink to stop the thermal runaway.

So even though each individual LED uses ~1W, I would still need a constant current source (battery?)? Why wouldn't driving with a transistor work?

*Thanks for the replies so far!

It would help if you said what sort of LED you had. With a 1W LED I would still use a constant current supply. Others might disagree but 1W is quite a bit of power to burn.

That is not “just” a transistor. Have a look on the rest of the net for the sort of module you need.

Here's the specs

Specifications: Lens Color: Water Clear Emitting Color: Red Green Blue Intensity Type: 110~120Lm Viewing Angle: 120° DC Forward Voltage:3.4V~3.6V Max Current Per Color: 350mA Max Combined Forward Current: 650mA

Wavelengths: Red 620-630 Green 515-530 Blue 464-470

This is the data sheet, or very similar (I have a common cathode) http://www.prolightopto.com/datasheet/3_2_RGB%20Star/3W_PG1X-3LUS_v2.7.pdf

I did find this though, http://users.telenet.be/davshomepage/current-source.htm And I do have some 317s lying around! Whoo!

Max Current Per Color: 350mA Max Combined Forward Current: 650mA

So you can only use a maximum of 216mA per LED (650 / 3). The problem is that:-

DC Forward Voltage:3.4V~3.6V

Means the forward voltage can be anything between those limits depending on the individual device and the temperature. That means, given an LED current of 200mA the resistor could be between 8R2 to 6R8 and at least half a watt a piece.

Some useful links:-

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1234273497 Also follow the links off that thread.

LED resistor calculator page: http://ourworld.compuserve.com/homepages/Bill_Bowden/led.htm