base resistor for TIP120

i'm a little confused by the calclulations, i don't know what i need to plug in or even where to get the proper information. i need to drive a 12v source with a maximum amperage draw of 2amps with my uno, with pwm.

the project is an rgb led strip driver. any advice here?

everyone here has been very helpful, thanks guys.

when i searched, i saw here http://forum.arduino.cc/index.php?topic=253834.0 that 1k should do , and his use case is similar to mine, but i dont know if anything is different, and i would still like to learn how to calculate it for other transistors. i found a calculator online, but it didnt let me put anything, just showed me the values for a select group of transistors.

You have 12V connected to your load, and you are sinking 2A of current to Gnd with the TIP120? You want the TIP120 to turn on full, and let the load control the current. A motor for instance would be self controlling with the resistance of the coil being the limiting factor, while LED strips would have built in current limit resistors. So drive the TIP120 on hard - 220 ohm resistor will drive it on full, while limiting the Arduino to a safe level.

TIP 120 are darlington, you can not get under 1 volt collector - emitter voltage. The LED strip only gets 11 volts.

Use an MOS FET with low RDSon and logiclevel.

Pelle

and i would still like to learn how to calculate it for other transistors.

Since the TIP120 is a Darlington pair, things are slightly different from a normal transistor, but the concepts are the same.

It starts with the fact that a transistor is a current amplifier. A typical transistor has a current gain (beta or hfe) of around 100, There is a graph on the TIP120 datasheet showing that the minimum current gain is about 500. When current is above 1 Amp, the current remains above 1000. The current gain varies from transistor-to-transistor, so the datasheet usually just specifies the minimum.

If you need 2 Amps (collector-emitter current), you need 2/500 (4 milliamps) base-emitter current.

Since you want to make darn-sure the transistor is switched fully-on, you can put more than that into the base. When we do this we say the transistor is "saturated", and the collector-emitter current is NOT determined by the transistor's gain, but limited by the load resistance (per the voltage and Ohm's Law).

The next thing you need to know is that the voltage applied to the base resistor (typically 5V if you are using an Arduino) is divided between the resistor and the base-emitter junction (Kirchhoff's Law). With a normal ransistor the base-emitter on-voltage is around 0.7V. That means we have 4.3V across the resistor. Since we are usually over-driving and saturating the transistor, we have a little voltage to "play with" and we can usually ignore the 0.7V drop and assume the full 5V is across the resistor.

But, the Darlington has higher base-emitter voltage. The datasheet says 2.5V, so we shouldn't ignore it and we should assume 2.5V across the base resistor.

You also need to know that the current through the base resistor is the same as the base-emitter current (Kirchhoff's Law).

Now that we know the voltage across the resistor and the required current, we can use Ohm's Law to calculate the resistance (V/I = R). (In case you don't know, I is the symbol for current.)

Since we want to saturate the transistor, standard practice is to cut the calculated resistance in half (or more) to at least double the base-emitter current compared to the calculation.

Another thing to know is if you change the load so it requires less current (say 1A or 1/2A instead of 2A), you don't have to change the base resistor... The transistor will remain saturated. But if change it to where you need more current, you may not have enough base-current to drive the transistor into saturation, and you may need to re-calculate.

I'm trying to use a TIP120 to drive an electro-magnet. I'm using an Arduino to switch on/off the current with a Digital I/O pin applying 5V at the base of the transistor. The Electro-Magnet is powered by a 12V supply and has an internal resistance of 39 Ohm.

The problem I'm having is the the Electro-Magnet is not getting full current from the Transistor when I switch it ON using the +5V from the Arduino. If I use a bench power supply to the Electro-Magnet at 12V it typically draws 330mA at full power. When I use the Arduino to switch the TIP120 on (using a 5V DIO pin to Base) I'm only getting around 200 mA current through the Electro-Magnet. I do have a resistor leading to base of the transistor to prevent too much current out of the Arduino. I can't achieve the 3V needed to fully turn on the transistor.

Am I missing something or is my assumption not correct. I expect that I can drive a high current load (330mA) with 12V (Collector through Emitter) running through the TIP120 using the Arduino to swith the transistor on by applying a minimal load to the Base of the transistor with a 5v digital I/O pin.

I've reduced the Arduino DIO to Transistor Base resistor to 220 Ohm but I'm only able to achieve around 2V to the base of the transistor which seems to be limiting the current through the transistor. Spec states you need 3V to fully turn on the transistor. I don't think I can pull any more current from the Arduino without Frying it.

Advice Please!

A TIP120 is an NPN darlington, so the base is current driven.
Voltage on the base is irrelevant, but should be over the >1.3volt threshold (two BE junctions).
This darlington, when used as a switch, should be driven with 1/250 of the collector current.
1k base resistor (~3.5mA, assuming 5volt pin) should be good for about 1Amp.

What you’re seeing is the high saturation voltage of a darlington.
Should be ~0.75volt at that current (300mA), but…
Maybe the transistor is damaged. Did you use a kickback diode across the solenoid?

Tip120 is old technology.
A modern logic level mosfet can do much better (almost no saturation voltage at that current).
Leo…

jwahaus: I'm trying to use a TIP120 to drive an electro-magnet.

This part is obsolete. Useful only as a service replacement (and even then probably inadvisable as a proper FET may be substituted for improved performance in most cases, just as LSTTL logic chips should be replaced by HCMOS where practical).

Interesting question - why did you buy it?

Reading something on "instructables" perhaps? Good advice is to check here before purchasing anything or acting upon any "information" discovered on that site. :astonished:

MOSFETs overtook darlington's decades ago, but the old stuff refuses to die!

Without a freewheel diode acros the electromagnet you are pretty-much guaranteed to fry the TIP120 the first time you use it, which is what we suspect may have happened. Any inductive component needs some kind of snubbing when switched, or high energy high voltage transients are sent back to bite the switching device. For DC a free-wheel diode is the simplest snubber, and it must go across the electromagnet, cathode to the positive supply (assuming low-side switching).

If the electromagnet is 39 ohms, 12V current should be 300mA, with the darlington something like 250mA due to the 2V loss, but definitely shouldn't be as low as 200mA

Also you absolutely must use a base resistor with any BJT - overwise you may fry it and the Arduino pin... 1k is normally fine for darlingtons as they have a usable saturated current gain of over 1000.

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

What are you using as the power supply for the 12V? Do you have the gnd of the Arduino connected to the gnd of the 12V supply?

Thanks.. Tom.. :)

TomGeorge: Do you have the gnd of the Arduino connected to the gnd of the 12V supply?

Thanks Tom, this solved an hour of troubleshooting! Would anyone care to explain to a beginner why connecting the two grounds (one from a separate barrel plug power supply, and another from the arduino) is so important? A lot of strange behaviour (e.g. motors humming, PIRs being activated without movement) were instantly resolved with a single connection between the grounds. Thanks again :)

Combo: Would anyone care to explain to a beginner why connecting the two grounds (one from a separate barrel plug power supply, and another from the arduino) is so important?

Simples!

An electrical circuit requires a complete circuit loop which requires two conencting wires to each part. If any component or group of components were only connected to another component or group of components by one wire, then there is no circuit.

When you inspect the schematic diagram of some proposed circuit, you must be able to trace a continuous path from the "active" terminal of the power supply - or an output from a controller - through the following part and back to the ground of the first.

Combo: ... Would anyone care to explain to a beginner why connecting the two grounds (one from a separate barrel plug power supply, and another from the arduino) is so important? ...

as a beginner, i understood it this way - the circuit needs a common reference point (aside from the common supply of V+) - so, if one part of the circuit has a GND and another part also has a GND - these two GNDs should be "commoned" - so that the whole circuit has the same reference point (of Ground).