# Few questions on using transistor for pwm LED control

Edit: Thanks so much for the effort in explaining but I think I can understand better if explained in the following context:

Board: Arduino Nano Power Source: 12v Transistor: TIP120 LED: 4 strips of LEDs that consume 30mA each at 12v (3528 type LEDs)

Scenario: I want to switch these LEDs from fully off to fully on continuously (so like fading, except turning them on) then fade them off. This accounts for 1 cycle.

Question: How do I calculate the amount of power dissipated by the transistor. If I can't calculate the exact wattage, is there a way I can approximate the maximum?

Thanks so much!

I've got a project to build a rather small LED controller for pwm fading. First off, what transistor should I use (or maybe MOSFET?) to control less than 500 mA without a heatsink? Secondly, how does one calculate the heat dissipated by the transistor during the switching cycle?

Do you guys think using transistors is the best way to approach this? Or is there a way to somehow increase the capability of arduino's limit to switch higher than 5v and greater than 40ma?

Thanks for the guidance.

Your first assumption was wright. Use a transistor, or mosfet. the arduino can't source or sink that much. You should also consider to use an external power supply when you get around/over 500Ma.

As to which transistor or mosfet to use? It seems many would suggest a N channel digital mosfet.

I calculate the heat dissipated by holding my finger on it. If I can hold it on for 5 seconds without getting a blister, I am happy.

Nice method! :D Although If anyone else want to take a more mathematical route- I'd be all ears for the method as well. Regarding the switching though... I'm interested in how Arduino has the capability to switch 5v so fast if anyone reading this knows. Only thing I have a problem with is that it can only switch 40 mA. Is there something similar that can perhaps amplify the Arduino's switching frequency to work with higher voltage and current...? I assume that would be more efficient than using a transistor since less power will be used overall. Is this true?

I'm interested in how Arduino has the capability to switch 5v so fast if anyone reading this knows

Yes, arduino can switch 5v pretty fast, as can many/most computers. The design of current day digital circuits enable them to do that.

Is there something similar that can perhaps amplify the Arduino's switching frequency to work with higher voltage and current...?

You want to switch faster? How fast do you need it to switch? What are you building that needs more speed?

lpbug:
Is there something similar that can perhaps amplify the Arduino’s switching frequency to work with higher voltage and current…? I assume that would be more efficient than using a transistor since less power will be used overall. Is this true?

How do you mean?
What’s efficient depends on how it’s used.

lpbug: I'm interested in how Arduino has the capability to switch 5v so fast if anyone reading this knows. Only thing I have a problem with is that it can only switch 40 mA.

Design for 20 mA.

Is there something similar that can perhaps amplify the Arduino's switching frequency to work with higher voltage and current...? I assume that would be more efficient than using a transistor since less power will be used overall. Is this true?

Just use a MOSFET. They are efficient.

I’m so sorry- I didn’t mean to switch faster, i meant to retain the switching speed of the arduino but be able to handle higher voltage and current?

how does one calculate the heat dissipated by the transistor during the switching cycle?

Example:
If you use a 2N2222 the P=VI.
If Vce(sat) is 1V and the current is .5A your wattage at turn on is 500mW (1/2 Watt).
http://www.eng.yale.edu/ee-labs/morse/compo/datasheets/2n2222.pdf

If you use an IRL540 MOS FET rds(on) .077 ohms. P=I2R .5 X .5 X .077 = 19.25mW
http://www.vishay.com/docs/91300/91300.pdf

Thanks so much for the effort in explaining but I think I can understand better if explained in the following context:

Board: Arduino Nano Power Source: 12v Transistor: TIP120 LED: 4 strips of LEDs that consume 30mA each at 12v (3528 type LEDs)

Scenario: I want to switch these LEDs from fully off to fully on continuously (so like fading, except turning them on) then fade them off. This accounts for 1 cycle.

Question: How do I calculate the amount of power dissipated by the transistor. If I can't calculate the exact wattage, is there a way I can approximate the maximum?

Thanks so much!

4 strips at 30mA each gives a total of 120mA.
The voltage across the transistor when it is turned is between 1 to 2 volts, lets say it is 1 Volt ( VCE(sat) for the TIP120 @ 120mA is ~ 1V)

P=V x I = 1V x .12A = .12 watts of power dissipated by the transistor when it is on.
The power when the transistor is off is 12V x 0A = 0 watts.

lpbug: Thanks so much for the effort in explaining but I think I can understand better if explained in the following context:

Board: Arduino Nano Power Source: 12v Transistor: TIP120 LED: 4 strips of LEDs that consume 30mA each at 12v (3528 type LEDs)

Scenario: I want to switch these LEDs from fully off to fully on continuously (so like fading, except turning them on) then fade them off. This accounts for 1 cycle.

Question: How do I calculate the amount of power dissipated by the transistor. If I can't calculate the exact wattage, is there a way I can approximate the maximum?

Thanks so much!

Think of a MOSFET as a non-mechanical relay - the Arduino is able to command this relay to turn off and on many times per second - if done quickly enough then to our eye it appears it is on all the time

Craig