Transistor Selection and Wiring to Drive LEDs with PWM control

Part of a project I'm working on will be to control a set of LEDs with an Arduino. I will need to use PWM to dim them. I think the LEDs were taken from an automotive application, so they already have all the resistors or whatever built in. I just need to supply them with 12V and enough current.

Last night I hooked them up straight to a 12V battery and measured the current with a multimeter. They use about 750 milli amps.

I have sitting in my box a TIP120 transistor. (Datasheet)

On the package, I have the following specs:
Power dissipation: 65W
Collector-emitter voltage: 60V
Collector-base voltage: 60V
Emitter-base voltage: 5V
Collector current (continuous): 5.0A
Collector current (peak): 8.0A
Base current: 120mA
Unclamped inductive load energy: 50 mj

Questions about specs:
Does "collector current" mean the transistor can handle up to a 5 amps load?

Does "base current" mean that the arduino needs to supply 120 mA to trigger the transistor to "flip the switch?"

How much current can an arduino supply from all its output pins? Is the 120 mA for the transistor significant? I am wondering because while the Arduino is triggering the transistor, it will be doing other things, with other current draws.

Does "Emitter-base voltage" mean that I need to put 5V on the base to get it to switch?

Questions about wiring:

To wire this up would I do this?

+12v supply -> collector
Arduino PWM pin -> base

  • side of LED wires -> Emitter
  • side of LED wires -> ground

Do I need any resistors or capacitors in there? Maybe a "pulldown" resistor between the transistor base and ground, the way you do with a physical switch?

I have tried googling and looking at tutorials. Most of them only show how to do it for one circuit, and don't explain WHY, or they are way too advanced for me. Thank you for any help.

Buffalo_Chip:
Questions about specs:
Does "collector current" mean the transistor can handle up to a 5 amps load?

Yes.

(With enough heatsinking)

Buffalo_Chip:
Does "base current" mean that the arduino needs to supply 120 mA to trigger the transistor to "flip the switch?"

No. Numbers under "ABSOLUTE MAXIMUM RATINGS" are the values that will kill the transistor.

The number you're interested in is under "Saturation voltage"

Buffalo_Chip:
Does "Emitter-base voltage" mean that I need to put 5V on the base to get it to switch?

No. (see above...)

You need "Base-emitter on voltage" further down.

Buffalo_Chip:
Questions about wiring:

To wire this up would I do this?

+12v supply -> collector
Arduino PWM pin -> base

  • side of LED wires -> Emitter
  • side of LED wires -> ground

No. The transistor has to go after the LEDs, with the emitter connected to ground.

You'll need a resistor between the Arduino pin and the base. Try 150 Ohm.

From the datasheet:

Saturation voltages
IC = 3.0 A; IB = 12 mA VCEsat* max. 2.0 V

It also says that the HFE (current gain) is about 1000. As you can see from above, they are overdriving it by about 4x. This is typical for a darlington pair transistor. The rather large VCEsat voltage is typical of a darlington pair, too, but may be more on the order of 1.5V at the 750mA your LEDs draw.

So using the datasheet's preferred ratio of 1:250 base to collector current, 750mA/250 = 3mA.

About 5V will be provided by the Arduino (actually a slight bit less as their is internal resistance) and the VBE drop must be taken into account when calculating the base resistor. VBE at 3A is rated at 2.5V. So about 2.5V will be dropped across the Arduino to Base resistor.

2.5V/3mA = 667 ohms
For the sake of taking care of the slightly less than 5V out of the Arduino, variations amongst transistors and resistors, let's use 470 ohms.
2.5V/470 ohms = 5.3mA well under the maximum base current.

Say worst case, the Arduino manages to put out only 4.5V because of a depressed Vcc, leaving only 2V across the resistor:
2V/470 ohms = 4.3mA well over the 3mA required to drive the TIP120 into saturation.

As for heat dissipation in the transistor, we'll use the 3A rating of VCEsat of 2V, as we don't know exactly how much lower it would be at 750mA because it isn't linear. And we should err on the side of caution, or risk burning up the transistor:

750mA x 2V = 1.5W

A TO220 package will burn up with more than 1W, and even at 1W you are taking a risk. You should also double that number to take into account changes in ambient temperature, objects near the heat sink that interfere with air flow, dust, etc.

But 3W is still not bad. Simply bolting it to an aluminum case with the proper insulation and heat sink paste (more is NOT better) or to a reasonably sized heat sink should suffice. If you use a silpad, do NOT be tempted to add heat sink paste.

Oh, and the 150 ohm resistor that fungus suggested would work, too.

2.5V/150 ohm = 14.7mA
2V/150 ohm = 13.3mA

I just figured an explanation of how and why a particular resistor is used, would be more important for you than just giving you a number.

Also, there is not only a maximum amount of current you can draw from an individual Arduino pin, there is also a maximum current that can flow through the Vcc and ground pins. So you could be well within the maximum current limit on each pin, but go over on the Vcc/ground max current. No sense in using more current from a pin than you really need, then.

polymorph:
Oh, and the 150 ohm resistor that fungus suggested would work, too.

2.5V/150 ohm = 14.7mA
2V/150 ohm = 13.3mA

I was just erring on the side of "plenty". :slight_smile:

Good point about the heat. I suspect it might be OK (puts finger in air... 750mA x 1.5V... just over a Watt) but a Watt is still going to be plenty hot. Adding a heatsink is cheap and can't hurt anything.

Get some N-channel MOSFETs if you can, good parts with Low Rds will run much cooler.
I currently like AOI516 from digikey, have 32 on a board as a high current LED sink with big wide traces to source current for things like high current LEDs and 12V LED strips.

With 0.005 ohm on resistance, they dissipate just 3mW of power with 750mA of current (P=IIR) and have 4mV voltage drop while needing very little drive current from Ardiuno. I am driving them with 74HC595, which is even less capable.

http://www.crossroadsfencing.com/BobuinoRev17/

Darlington's waste a volt or more, tend to be less useful at low voltages as
a result (they are simple to interface to, that's their appeal).

MOSFETs loads better, but do those calculations, a MOSFET switched on
is a resistor, and the dissipation is I-squared-R. If you find the Vsat for
a MOSFET is more than a volt you probably need a lower resistance one.

Simple BJTs can switch 750mA if you chose the right ones (modern
super-beta devices with ultra-low Vsat (50mV is achievable I think)).

MOSFET, better idea. 20mOhm for a good one, at 750mA that is only I^2 x R = 11.25mW, only 15mV dropped across it. No heat sink required. Just make sure it is logic level.

polymorph:
MOSFET, better idea. 20mOhm for a good one, at 750mA that is only I^2 x R = 11.25mW, only 15mV dropped across it. No heat sink required. Just make sure it is logic level.

It won't be 11.25mW when you PWM it (which he's planning to).

If he's already got the TIP120s, they'll work. Might as well use them.