This question already has an answer here:

I have a 9V DC motor and I want to control its speed with an Arduino board with help of a power transistor TIP120. In one of the web-tutorials the writer explains how to calculate the resistor resistance. Here is the link to the page: http://teachmetomake.wordpress.com/how-to-use-a-transistor-as-a-switch

In Example 1, if you scroll down to read the paragraph starting with: “Finally let’s take a look at the datasheet for the TIP120. First, we see that Ic(max) = 5 A, and that Vceo(max) is 60, 80, or 100 V, so we are fine so far. Next we check the base current...” you can read his explanation.

Here the writer of the blog uses a logic to calculate the resistor value for the base. If I use his logic I obtain a resistor value which is very low comparing to other examples in other websites. Here is my scenario using his logic and by looking at TIP120 data sheet:

1-) The DC motor will be fed by a 9V battery and will be controlled by a pwm pin from the Arduino using a TIP120 transistor.

2-) The DC motor draws 500mA with no load; and 2500mA stall current as Imax_load. I measured these with an ampermeter.

3-) In this case the TIP120 satisfies the condition for Vce and Ice_max.

4-) Since Ic/Ib = 250, Ib_max will be 2500mA/250. So Ib_max = 10mA.

5-) Accoridng to TIP120 data sheet, in saturation zone for 2500mA the base emitter voltage will be Vbe = 1.75V.

6-) Since Arduino pin output is 5V, the voltage drop in resistor should be Vr = 5V – Vbe = 5 – 1.75 which means Vr = 3.25V.

7-) We can then use the base current Ib as 10mA < Ib < 40mA. Below 10mA the current will be too low and above 40mA might damage the Arduino. So I also choose a calue as 20mA. This means a resistor value R = Vr/Ib = 3.25V/20mA so that I obtain the proper resistor as R = 162.5 ohm.

I found many tutorials for Arduino and this transistor they use resistors such as 1k or 2.2k ect. For example here at this webpage they use 1k resistor: http://www.instructables.com/file/F9LKDFGGU7FXUMH There are many other use 1k and 2.2k.

My question is, is his logic and my calculations are right? Can I safely use the resistor I calculate?

marked as duplicate by tcrosley, Keelan, placeholder, Daniel Grillo, Matt Young Oct 21 '14 at 12:34

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    It is safe to use, most arduino tutorials don't add the stall current in. Where does "Ic/Ib = 250" come from? If I read this right the datasheet says it's more than 1000... EDIT: Ah ok, found it. Tiny text on figure 2. Yepp, it is save to use, then! ^^) – Alzurana Oct 20 '14 at 19:11
  • 2
    I agree the design method is sound. Only thing I'd add is you probably don't need the factor of 2 margin on Ib. Beta > 1000 is guaranteed, so in effect the datasheet curve already includes a factor of 4 margin in the definition of "saturation" vs "linear" behavior. You could design for 10 or 12 mA base current and still be okay. – The Photon Oct 20 '14 at 19:25
  • The Photon thanks, do you have an idea how to figure out how to find the lower limit for switch/saturation mode? I mean 10mA is ok for switch mode but what can be the lower limit? it shouldn't operate in amplification mode right? – user16307 Oct 20 '14 at 19:34
  • @user16307, AFAIK, it's just a fuzzy transistion, so they just picked arbitrarily to use the point where gain drops by 3/4. – The Photon Oct 20 '14 at 20:41
up vote 4 down vote accepted

Following the instructions on the blog I can assure you that it is safe to use for your application.
It seems that most arduino tutorials either drive much smaller motors, or use standard resistor values.
As in: "Oh well, I don't wanna calculate it, lets just whack 1k in there."

Just to be clear:

The datasheet says b = 250 on total saturation in figure 2.
You go from there and take your collector current, which is Ic = 2.5A

Ib = Ic / 250
Ib = 25mA

Then you look at figure 2, again. Vbe for Ic = 2.5A is about 1.75V
->(Don't be afraid to overshoot a LITTLE bit)
The output voltage of your controller is Vaduino = 5V
so you can calculate the resistors voltage:

Vr = Varduino - Vbe
Vr = 3.25V

Therefor your resistor is:
Rb = Vr / Ib
Rb = 130 ohm

Yes this is extremely small, but you are driving large currents and your signal voltage from the Arduino is very low. The TIP120 operates at the upper range of it's specs, that's why Vbe is that high.
What you can do is add a 2nd transistor to drive the TIP120 to decrease current on your I/O pin of the Arduino. But as far as I know the Arduino is able to drive 25mA. It's on the edge, but it CAN do it.

Here's a schematic:
lower Arduino Current
This lowers the current on your arduino I/O pin. This setup is useful for even larger loads, even though I'd recommend a mosfet in that case.
Another problem with this: it inverts the output, so whenever the I/O pin is HIGH, Q2 is off.

Also:
You said you're driving this from a 9V cell. Keep in mind that 9V batteries are not able to provide 500mA without a significant voltage drop, and they certainly don't provide 2.5A! So you might wanna think about your power source, too.

  • Thanks for answer . Btw I'm planning to power the DC motor by a 9V battery? What do you mean by " add a 2nd transistor to drive the TIP120 to decrease current on your I/O pin "? – user16307 Oct 20 '14 at 19:36
  • aha ok you re talking about the base current draw. – user16307 Oct 20 '14 at 19:44
  • Yepp. I did an edit on my answer, check it out. ;) – Alzurana Oct 20 '14 at 19:54
  • thnx for the input! one last question about this. i saw in another tutorial one was using a 1uf capacitor parallel between motor imputs. what would it be for? – user16307 Oct 20 '14 at 20:09
  • 1
    @user16307 - The capacitor across the motor is noise suppression, to try and filter-out the noise caused by the high-speed electrical switching which happens inside a brushed DC motor. – user1844 Oct 20 '14 at 20:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.