Hello again.

So you have a DC motor or lamp but no matter how you connect them to your Arduino they just won't work? Guess what, the Arduino is a brain that comes with small muscles. It can control LEDs and other low power nicknacks but not those power motors or lights you need for your next project. The Arduino is good at thinking but not for heavy lifting. Lazy lad.

There are a few add-ons out there that you can buy such as power and motor shields for your Arduino. They have all the muscles in one nice package. Slap those shields on your Arduino and you are ready to control motors and other high power stuff (some soldering may be required.)

Or you can do it yourself for a fraction of the cost and double the pleasure. Enter the TIP120 and its sidekicks.

The TIP120 is an NPN Power Darlington Transistor. It can be used with an Arduino to drive motors, turn lights on, and drive other high power gadgets.

The TIP120 acts as a power broker or gatekeeper between the Arduino realm and the high power realm composed of the PC fan and its battery pack. The Arduino can tell the TIP120 how much power to pass from the external battery pack to the PC fan but the Arduino does not share any of its power or share pins with the PC fan or its batteries. The TIP120 is the go in between.

The TIP120 has three pins. One is called Base, which we will connect to any of the Arduino PWM pins. Through the Base pin, the Arduino can tell the TIP120 how much power to supply to the motor from the external battery pack. That's it. The TIP120 does the heavy lifting while Arduino sits back and gives orders through one of its PWM pins to the TIP120 Base pin telling it how much power to pass to the motor. The poor TIP120 has to then pass the requested power from the external power to the motor based on Arduino's request.

In this tutorial, I will build a basic circuit in which I use an Arduino to control the speed of PC fan via the TIP120. You can take this basic circuit and replace the fan with other devices.

If you want to know more about Darlington transistors you can spend some time at Wikipedia http://en.wikipedia.org/wiki/Darlington_transistor It's an interesting read but you don't really need to understand it to use the TIP120. Heck I don't know what most of this stuff means.

The TIP120 is a very robust item. It can handle lots of power (see specs) but the Arduino can't. So we must protect the Arduino from potential party crashers. For starters, we use a 1K Ohm resistor between the Arduino pins and the TIP120 Base pin. This is insurance against electric shorts. The TIP120 can handle 60V and 5A but I assure you the Arduino won't.

Then we have those DC motors. The internal brushes on toy/hobby DC motors generate lots of potentially harmful sparks and stray electricity that needs to be blocked. Instead of guessing which motor is safe and which is not, we simply add a $0.20 diode and $0.10 1uF ceramic capacitor to our circuit. Some electromechanical devices such as solenoids may require different capacitors.

Placing the ceramic capacitor on the + & - poles of the motor will act as suppressor of sparks and surges generated by motor brushes, which can be harmful to your circuit.

A small ceramic capacitor in the range of .01 to 0.1 uF is probably sufficient to offer protection from hobby DC motors. But If you are using brushless motors, such as the PC fan I am using in this tutorial, don't use a capacitor.

As for the 1N4004 diode, it allows current to pass in one direction from positive to negative but will block any stray current that tries to go in the opposite direction, which might have undesirable effects on your circuit.

Unlike resistors which allow current to flow in both directions, diodes were designed to let current pass from positive into negative, not the other way around. When you look closely at those small diodes we use in our projects, you will see a ring on one end of the diode cylinder. This tough guy can block high voltage (400V) with high current (1A). Again, no need to understand all this stuff so long as you connect the circuit properly.

I am a picture person so I have lots of pictures to help me explain my point.

- TIP120 transistor (datasheet: http://www.futurlec.com/Transistors/TIP120.shtml ) $0.70
- Diode 1N4004 (datasheet: http://www.futurlec.com/Diodes/1N4004.shtml ) $0.20
- 1K Resistor (Brown, Black, Red, Gold) $0.10
- 1uF ceramic capacitor to be used with hobby DC motors $0.10
- Arduino UNO with IDE
- Breadboard
- PC fan or hobby DC motor
- 9V Alkaline or 7.2V NiMh batteries (6 X AA)
- Wires.

NOTE: I don't get commission or any perks from linking to Futurlec.com. I just like their service and prices so far.

// Define which pin to be used to communicate with Base pin of TIP120 transistor
int TIP120pin = 11; //for this project, I pick Arduino's PMW pin 11
void setup()
pinMode(TIP120pin, OUTPUT); // Set pin for output to control TIP120 Base pin
analogWrite(TIP120pin, 255); // By changing values from 0 to 255 you can control motor speed

void loop()

I must thank http://luckylarry.co.uk for his super blog.


<p>so I'm looking at the spec sheet, and it looks to me like the minimum input voltage on the collector is 5V. What can I use with 3.3V outputs like on a teensy lc? I'm googling it, but haven't come up with the right component yet. I want to address LED strings as in a costume using teenies, in case you are wondering...</p>
This is a great setup thank you.<br><br>Should I get a larger resistor if I were to use a large 12v battery with a drill motor?
<p>if i dont have tip 120, which one can substitute it?</p>
Any NPN transistor rated for your application will do.
<p>i am using this s8050 npn &amp; it work</p>
<p>i can use dc motor and don't use pc fan?</p>
Yes, you can.
<p>Does it matter if i wired the transistor directly to power and the +ve of fans to the emmiter? </p>
I'm not sure what you mean. Show a diagram and we can assist you.
<p>if i do all of this except put the capacitor on the motor what are the consequences?</p>
The capacitor is there to filter nosie. Depending on your curcuit you may be fine without it. Everything will still work just not as smoothly as it could work.
<p>Hi, I just recently built a project using the ATtiny85 (rated I think somewhere between 2 to 5V). The project uses a simple code with a potentiometer to control the speed of a DC motor. Wouldn't you know it, after spending a lifetime soldering, the motor doesn't have enough torque for my needs. I had put a 5V voltage regulator in the circuit with the IC to prevent frying the thing, but now it's looking like I need a more powerful DC motor. Do you think this TIP120 will solve my problems?</p>
Your project requires a geared motor. The TIP120 will not solve this problem.
<p>Would this also work with a 3.3V Arduino Pro?</p>
Yes, bare in mind the Arduino is not handling the voltage or amp draw. The Arduino like the posted stated is only there to give orders. Your connected device and power source are operated independently. The Arduino is the boss. Make sure you understand the basics before doing this project. If you start with less you'll be much better off because you'll have a greater understanding.<br>
<p>this is so stupid like a 12V fan ? really why wud anyone need to do this with a MCU ? is a over kill just stick a 9V battery to it with a switch thats it,,, NOW if your going to include some IF statements while adding some sort of sensor NOW this is a reason to use a MCU but as a stand along is just a waste of time, even a DC motor could have suffice with just a 9V a resistor and a TIP120??? hell no a Voltage regulater 7805 would have done the trick while saving voltage obvs by regulating it no need for a mcu </p><p><br>i included one of my mini humanoid robots and this is worth a ATTINY MCU for all this motor i have used here</p>
Of course it isn't needed. He is demonstrating how to use the transistor with an arduino nothing more. He could have connected other devices as well but the basic setup will remain the same. It's all about building blocks. Switch on a led, now switch on led with a transistor, now switch on an led with a transistor through a relay. Those basic steps with the addition of other components will allow the user to control many things. So is it really &quot;stupid&quot; Nope not at all. <br>
<p>Wow!! thank you...</p>
<p>You shoud use an &quot;H Bridge&quot; and 2 pins of the arduino, that way you can choose the polarity. And you should turn CAPS LOCK off, keeping it on is bad Internet etiquette..</p>
<p>Hello there.</p><p>I have some issues with this project: i used all the specified parts but instead of TIP120 i have used TIP121 and instead of 1N4004 i used 1n4007.</p><p>I uploaded that program but my fan start rotatig continuously ,and if i pull de pin 11 from Arduino nothing happens.i thought it was supposed to stop .</p><p>I used that parts because i counldn't find the desired ones .</p><p>I want to rotate my fan at a specific moment.</p><p>Any ideas? thx </p>
<p>analogWrite(TIP120pin, 255); fan on</p><p>analogWrite(TIP120pin, 0); fan off</p>
<p>Obviously, that sketch sets a specific PWM value. So you won't see any variation in the fan rotating speed. Try with a loop ranging from 0 to 255 and back again to 0, with some millis between each cycle.</p>
<p>Hi techbitar, thank for the guide and it very simple to follow your procedure. Manage to get the project running in less than 30 mins. </p><p>1 question here : i had some voltage &amp; current taken down. Volt on 1k ohm is 3.33v &amp; current 3.33ma. Can you share with me why is the 1K Ohm resistor chosen &amp; not other value?</p>
<p>Awesome, very well explained, the analogy is just pure icing for beginners.</p><p>Thank you for the instruct-able.</p>
<p>Hello, I'm currently working on a project with an Arduino Mega and I'm trying to incorporate what you've done on your Instructables with my project. I need to light up six LED strips but I'm having some trouble figuring out where to put each of the three wires that protrude from them and was wondering if I could get some advice from you? Any help is appreciated! </p>
<p>AFAIK, all normal PC fans are brushless.</p>
<p>Hy ! I want to ask about the fan. It's brushed or brushless fan ? </p>
<p>Hey, im new to arduino programming and was wondering if there was any way to use a potentiometer at the input of the arduino to alter the motor speed? Any help would be greatly appreciated thanks</p>
<p>Yes.</p><p>Read analog on potentiometer and send that to pwm.</p><p><a href="https://itp.nyu.edu/physcomp/labs/motors-and-transistors/using-a-transistor-to-control-high-current-loads-with-an-arduino/" rel="nofollow">https://itp.nyu.edu/physcomp/labs/motors-and-trans...</a></p>
<p>Short answer, no, not directly. I have been researching variable outputs with the Arduino and changing speed of an electric DC motor is not possible without additional electrical components. From what I've read we need a digital to analog converter. If anyone else can direct us to a source for guidance&hellip;thanks.</p>
<p>Actually, you can. Arduino (or more correctly the ATMega328) is itself a digital to analog converter: you just need to use the PWM digital pins for analog output. See: <a href="http://arduino.cc/en/Tutorial/PWM" rel="nofollow">http://arduino.cc/en/Tutorial/PWM</a></p><p>I have found an example of what j.craigmile wants to do here: </p><p><a href="http://www.dummies.com/how-to/content/how-to-control-the-speed-of-a-dc-motor-with-the-ar.html" rel="nofollow">http://www.dummies.com/how-to/content/how-to-contr...</a></p>
I need help: what transistor have to use to switch a 3,7v motor whit 3,7v battery? Unfortunately the arduino amperage is not sufficent.
<p>My Test go Good in this way.</p>
<p>Hello.</p><p>This is Luca from Italy.</p><p>I'm Tring this project for the first time and I thank you for the good information.</p><p>Anyway I look that the small classic RC 12V motor need at least a 50/100uF Capacitor to start without problem. If we put a capacitor less than that we will need to apply too much Potentiometer turn to give the start to the motor...</p><p>Other thing I advice to put a Diode 1N4007 or something around that between the Resistence and the Base of the TIP-120. This will really stop any back current from the TIP-120 to Arduino!</p><p>Anyway I advice to put a 1M Ohm,1/4Watt Resistor between the GND and the Anode of the Diode, a simple Pull Up to prevent strange motor behavior a cause of static electricity, hand humidity and body electricity...</p><p>Bye Boys!</p>
Hey there! Awesome tutorial, I learned a lot from it and love that you have plenty of pictures to follow.<br>I am new to Arduino and I am making a circuit of my own, I hope you have a bit of time and can help me out:<br>I am working on a circuit in a vehicle that is ground based (you ground the wire to activate it).<br>But those lines will read 12v when not grounded.<br>I need to turn on some factory LEDs with an Arduino (once again, I just need to ground the wire coming from the LED to activate it, that part of the circuit I cannot modify).<br>The Arduino will be counting button presses, acording to the number of times they were pressed, it will turn on the respective LED and toggle a relay - don't need help for this part just yet ;)<br>My issue arrives at the point where I want to ground those LEDs.<br>I am aware that I can use relays, but my project already uses a minimum of 6 relays to control 12v lines to turn on Aftermarket Heated Seats (Driver and Passenger, High, Medium and Low) and so, I do not want to use any more relays.<br>Can I apply a similar transistor, which instead of regulating power, will just ground one of its pins when the 5v from an output pin is set to high and that can handle 12v on that same pin when the output pin is set to low without feeding it back to the Arduino?<br>Is a transistor even needed for this? I just started taking electronics on my own and I can't figure out what I need just yet.<br>Care to lend a hand?
<p>I was looking at the TIP 120 Darlington Transistor specification sheet and noticed that it has internal diode protection between the collector and emitter. Your diode is redundant and perhaps not necessary.</p><p>Refer to the TIP 120 specs here:<br><a href="http://www.onsemi.com/pub_link/Collateral/TIP120-D.PDF" rel="nofollow">http://www.onsemi.com/pub_link/Collateral/TIP120-D.PDF</a><br>The snubbing/snubber capacitor across the motor connections is a good idea for noise suppression. I may add that it is also a good idea to wind the motor leads to suppress further emissions. Hope that helps!</p>
<p>Wind the motor Leads? As in twist the +/- Wires together?</p><p>I've seen this in twisted pair shielded cable, is this similar?</p>
Yes exactly, the &quot;twisted pair&quot; wires are twisted together for the purposes of canceling out electromagnetic interference and crosstalk between neighboring pairs. The method was invented by Alexander Graham Bell to reduce crosstalk on telephone lines. It may be overkill in your application but if your application is near low level audio or other &quot;input sensitive&quot; signals, it is a good practice. <br>Although when you say +/- you may be refering to differential signals that expand upon this to another level as in differential amplifiers.<br>
<p>Hi, my name is Emmanuel.. i am currently working on this group project to that and your instructable was a great help but my problem is i need to control the dc motor by pressing a push button and i am suppose to control four dc motors with four buttons with different configurations like when you press button 1 motor 1 and motor 4 starts moving somthing like that..will be glad if you can help with the circuit and the sketch...i couldnt get the motors to respond to the button press....thanks in advance</p>
<p>Thank you for this great instructable! <br><br>I was able to apply this to drive a 12v LED light strip with my Raspberry Pi using a 2N3904 transistor and a 1N4002 diode I had around (to be safe), capacitor not needed. Since I am still new to electronics, it took me hours to find how to best accomplish this without frying my Pi or anything. Works great.</p>
Thanks for the instructable! <br>Quick question. I made a circuit like this and then I soldered it but now the transistor is getting extremely hot and allowing current continuously through what should I do
<p>Apologies in advance for the slight twist on subject but have been battling to find info. I currently play with my own slot car controller circuits using a Tip35c (NPN) and Tip 36c (PNP) transistor, controlled by a simple wiper board of resistors totaling 108 ohms. Without involving the use of a PWM circuit (which the Arduino is) I would like to substitute the resistor wiper board with a hall effect device and magnet powered via a 7805, which would give me the standard 0 to 2.5 volts and which I would then like to control drive the amplifier transistor and control the 13.5 volts supply to the slot car. All circuits using the hall device work on the basis of switching, thus PWM only, the very thing I am trying to avoid. Is it feasible for the small 0 to 2.5 volt hall device to control the 13.5 v transistor with a simple non-pwm circuit? In my ignorance, I assume I am trying to covert voltage movement to resistance movement ;-)</p><p>Thanks</p><p>Dave </p>
<p>why you have choicethe TIP 120 and not the 7805 (positive) transistor?</p>
<p>The 7805 is a +5V 1A regulator, it takes an input voltage and outputs a stable 5V for use in your circuits. A regulator will supply a constant voltage regardless of the input (within the parameters of the device).</p>
<p>Hi guys! Let me take a minute of your time. <br>Our young startup has developed a revolutionary product for automation of existing window blinds. It is Wi-Fi and ZigBee enabled. We have launched a Pre-Order campaign today - please like, share and contribute! <br>Check out the link below: <a href="http://bit.ly/1bkbCHh" rel="nofollow">http://bit.ly/1bkbCHh</a></p>
<p>I'm currently working on a team project that uses the setup used here to control 12V DC fan. Instead of an actual darlington transistor, i decided to use two 2N3904 npn transistors to form the darlington transistor, and instead of the 1n4004 diode i used a 1n4148 diode (i dont think that would really matter cause both of these diodes have very similar specs and they both have the same function in the circuit). When I tested this circuit, I applied a source of 5V and 1A (not from the arduino) and the voltage drop across the dc brushless fan and the current flowing through it both went up to a maximum value, but then they both slowly and steadily started to decrease, even with the source still on. and when I turned the source off, they both started increasing slowly and steadily. Can anyone explain why this happened?</p>

About This Instructable


302 favorites


Bio: Did I unplug the solder iron?
More by techbitar: IR Remote Control Station for Android - TURN THE TV DOWN SensoDuino: Turn Your Android Phone into a Wireless Sensors Hub for Arduino Modify The HC-05 Bluetooth Module Defaults Using AT Commands
Add instructable to: