Switching DC motor with TIP122 and Arduino

emirtnrvr

Feb 16, 2023
13
Hi, I want to switch 2 ampers 9V DC motor with TIP122 Transistor using Arduino nano. How many ohms resistor should I use for the transistor's base pin? How can I calculate? Thanks

Feb 19, 2021
333
Basically these are the conditions you want :

So Rb = ( Vout - 2.5 ) / 12 mA Note get Arduino (Atmel CPU, now Microchip) Vout from its datasheet.

Note you have 2A flowing thru C-E, whose sat V is ~ 2V @ 3A, thats 6W of power, implies
good sized heatsink.

Regards, Dana.

Last edited:

emirtnrvr

Feb 16, 2023
13
Thanks for your reply Arduino nano Vout is 5V so according to the calculation 220-ohm resistor is fine right?

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,073
The TIP122 is not a good choice. This is a Darlington pair with high gain but also high collector-emitter saturation voltage as pointed out by @danadak . Lots of energy wil be dissipated as heat and will not be available to the motor.

Imho a much better choice is a MOSFET, e.g. an IRF520. This is available as an inexpensive off-the-shelf module ready for wiring in between Arduino and motor without any additional components.

Feb 19, 2021
333
If you choose MOSFET this would be circuit you would want to use :

The diode is to limit L transient that occurs due to MOSFET turn off. Protects
MOSFET from exceeding gate oxide rupture.

The R18 is to insure when micro starts up, and tristates its GPIO, the MOSFET
stays off, until processor code takes over.

The 220 ohms is to limit current spike that occurs when GPIO turns high, to prevent
disrupting processor internal buss from spiking low causing potential code erratic
operation. Note if you were driving with a PWM then the 220 ohm needs to be lowered
to insure MOSFET does not stay in its linear region too long. There are application
notes available to do that calculation. Typically that is more like 10 - 50 ohms.... Also
one would not use processor GPIO direct in that application, one would use a MOSFET
gate driver to handle the high currents driving the MOSFET input and Miller capacitance.

Regards, Dana.

emirtnrvr

Feb 16, 2023
13
If you choose MOSFET this would be circuit you would want to use :

View attachment 58050

The diode is to limit L transient that occurs due to MOSFET turn off. Protects
MOSFET from exceeding gate oxide rupture.

The R18 is to insure when micro starts up, and tristates its GPIO, the MOSFET
stays off, until processor code takes over.

The 220 ohms is to limit current spike that occurs when GPIO turns high, to prevent
disrupting processor internal buss from spiking low causing potential code erratic
operation. Note if you were driving with a PWM then the 220 ohm needs to be lowered
to insure MOSFET does not stay in its linear region too long. There are application
notes available to do that calculation. Typically that is more like 10 - 50 ohms.... Also
one would not use processor GPIO direct in that application, one would use a MOSFET
gate driver to handle the high currents driving the MOSFET input and Miller capacitance.

Regards, Dana.
Thanks for your detailed response and also Thanks Harald. I will change TIP122. Can I use IRLZ34N? Logic MOSFET is enough for me. Can I use your circuit diagram with IRLZ34N? Are resistors values fine for IRLZ34N?

Feb 19, 2021
333
You driving MOSFET with a PWM ? If so this might help to calc the
gate R :

R18 fine as it is. The diode preferably wants to be a fast diode. 1N4148 for, depending on motor L.

Regards, Dana.

Last edited:

emirtnrvr

Feb 16, 2023
13
I
You driving MOSFET with a PWM ? If so this might help to calc the
gate R :

R18 fine as it is. The diode preferably wants to be a fast diode. 1N4148 for, depending on motor L.

Regards
I will not use pwm only digitalwrite functio. I only want to open and close motor

bertus

Moderator
Nov 8, 2019
2,854
Hello,

There is no problem using dana's circuit for switching the motor on and off using a digtal pin.
PWM is nothing else as very fast on/off switching.

Bertus

Minder

Apr 24, 2015
3,366
I

I will not use pwm only digitalwrite functio. I only want to open and close motor
The device will need to handle the initial current, especially if a load is present at switch on.

Minder

Apr 24, 2015
3,366
If no PWM, The device will need to handle the initial current, especially if a load is present at switch on.

Feb 19, 2021
333
I

I will not use pwm only digitalwrite functio. I only want to open and close motor
Then the 220 ohm in MOSFET gate should be fine.

If you have a scope look at turn off of motor, if you are still getting
high V spikes on MOSFET drain then consider adding this as well
in parallel with motor and diode, a snubber.

Regards, Dana.

emirtnrvr

Feb 16, 2023
13
Then the 220 ohm in MOSFET gate should be fine.

If you have a scope look at turn off of motor, if you are still getting
high V spikes on MOSFET drain then consider adding this as well
in parallel with motor and diode, a snubber.

Regards, Dana.
Thanks everyone, As you sad dana I will use 1N4148 diode for motor L but is diode max current important? Is 450 mA forward diode current enough for my 2.5A motor?

Feb 19, 2021
333
Boy did I screwup, no that diode is not adequate.

Something like this :

Basically a 200 nS, 5A, 100V or better.....Note speed one normally tries a representative
diode, looks at scope on MOSFET turnoff, and examines pk transient V to make sure
that does not exceed MOSFET specs. Look at both drain and gate when doing it. So
200 nS a starting point.

Regards, Dana.

Last edited:

emirtnrvr

Feb 16, 2023
13
Boy did I screwup, no that diode is not adequate.

Something like this :

Basically a 200 nS, 5A, 100V or better.....Note speed one normally tries a representative
diode, looks at scope on MOSFET turnoff, and examines pk transient V to make sure
that does not exceed MOSFET specs. Look at both drain and gate when doing it. So
200 nS a starting point.

Regards, Dana.
Thanks for everything Dana. I am really glad about your incredible help. Sorry, I am a new maker sometimes I can be confused. I have a question about diode why can't I use only MBR560 diode? Why do I need a fast diode? I won't use pwm. Can you help me understand?

emirtnrvr

Feb 16, 2023
13

You can check my circuit from the diagram is everything correct. Can I switch the motor(Titresim)? Thanks everybody.

Sunnysky

Jul 15, 2016
530
Hi, I want to switch 2 ampers 9V DC motor with TIP122 Transistor using Arduino nano. How many ohms resistor should I use for the transistor's base pin? How can I calculate? Thanks
You have some good advice already. I would approach it like a Thevenin source and load impedance and find out what the values are or need to be for the supply, converter and load. In order to regulate torque with current and low loss the supply must be the lowest ESR, then the "switcher" must be a reasonable low % of the load.

The motor starts at 0 RPM as pure DCR of the winding then the speed raises the impedance from back EMF and inductive switching. If the motor has a max rated current at full power then start with the assumption that the DCR at rated voltage will produce 10x this rated current.

Thus you can start with the assumption that the switching transistor resistance ought to be 10% of the DCR or 1% of the motor Vcc / Imax. = Rsw For BJT's this is called Rce= Vol/Ic and FETs is called RdsOn. Your choice here affects heat rise, switching capacitance and other effects. If you know thermal resistance you can estimate temp rise and try not to burn your fingers (Tc>55'C).

The switching rated needs to be low enough to accelerate T=L/R with Iavg= Vavg/ Zload avg. yet not an audible nuisance.

Also remember that higher current rated semiconductors of one type also have more capacitance especially in FETs and diodes with their higher conductance. Basically, RdsOn * Coss is fairly constant but varies with technology and voltage ratings. This can create a series LC resonance during transition with long wires to the motor so minimizing the loop area, grounding, decoupling in the layout reduces interference.
Tony
EE since 1975..

Last edited:

Feb 19, 2021
333
When the V reverses on the L (MOSFET turned off) it ramps very fast to a high V,
so diode needed to clamp it before its V gets too high, has to be fast. Thats the
reduced explanation as its complicated by the nature of the motor L, its losses,
and other considerations.

The MBR560 has no reverse recovery, Schottky's are normally much faster. But
datasheet has no specs so how fast it will switch has to be tested.

Regards, Dana.

Last edited:

emirtnrvr

Feb 16, 2023
13
When the V reverses on the L (MOSFET turned off) it ramps very fast to a high V,
so diode needed to clamp it before its V gets too high, has to be fast. Thats the
reduced explanation as its complicated by the nature of the motor L, its losses,
and other considerations.

The MBR560 has no reverse recovery, Schottky's are normally much faster. But
datasheet has no specs so how fast it will switch has to be tested.

View attachment 58099

Regards, Dana.
Thanks for all your responses. You can see my final design I haven't tried it yet, But when I try I will share my feedback when I tested it. I want to sum up my applications for makers who want to use MOSFET. I wanted to switch a 2.5 Ampers 9V DC motor using Arduino nano most efficiently. Thanks, Maker Pro Forum.

Replies
7
Views
1K
Replies
14
Views
2K
Replies
2
Views
774
P
Replies
7
Views
2K
P
Replies
17
Views
377