Maker Pro
Maker Pro

Switching DC motor with TIP122 and Arduino

emirtnrvr

Feb 16, 2023
13
Joined
Feb 16, 2023
Messages
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
 

danadak

Feb 19, 2021
751
Joined
Feb 19, 2021
Messages
751
Basically these are the conditions you want :

1676588992898.png

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
Joined
Feb 16, 2023
Messages
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,700
Joined
Nov 17, 2011
Messages
13,700
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.
 

danadak

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

1676654981663.png

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
Joined
Feb 16, 2023
Messages
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?
 

danadak

Feb 19, 2021
751
Joined
Feb 19, 2021
Messages
751
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
Joined
Feb 16, 2023
Messages
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
3,302
Joined
Nov 8, 2019
Messages
3,302
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,478
Joined
Apr 24, 2015
Messages
3,478
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.
 

danadak

Feb 19, 2021
751
Joined
Feb 19, 2021
Messages
751

emirtnrvr

Feb 16, 2023
13
Joined
Feb 16, 2023
Messages
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?
 

danadak

Feb 19, 2021
751
Joined
Feb 19, 2021
Messages
751
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
Joined
Feb 16, 2023
Messages
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
Joined
Feb 16, 2023
Messages
13
12.PNG

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

Sunnysky

Jul 15, 2016
541
Joined
Jul 15, 2016
Messages
541
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:

danadak

Feb 19, 2021
751
Joined
Feb 19, 2021
Messages
751
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.


1676913846434.png


Regards, Dana.
 
Last edited:

emirtnrvr

Feb 16, 2023
13
Joined
Feb 16, 2023
Messages
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.

123.PNG
 
Top