Login Join Maker Pro

# Switching DC motor with TIP122 and Arduino

#### emirtnrvr

Feb 16, 2023
13
Hi, PCB has been received from the manufacturer. I tested it first I thought there was no problem but after 2-3 tries Arduino didn't operate the system properly. Servo, brushed motor and DC motor are opening and suddenly closing. Most of the time even they don't start. I can't upload code to Arduino when it is connected to PCB even PCB is unplugged from the battery. But when I disconnect the Arduino from PCB, Arduino is working well. Also, I can measure 0,5V from the main voltage line when PCB is unplugged from the battery. MOSFET side I am measuring -0,12V from +9V-drain when PCB is unplugged. I tried to attach the diode to the ESC power line but it didn't work. I will try to change MOSFET maybe I damaged the MOSFET. I think something wrong with the DC motor switching circuit. I need help. Thank you.

FCU_DATA: PWM data from Flight Controller Unit
Sacma_Power: ESC power line
Sacma_Data: ESC data line
Titresim_Power: DC motor power line
Ard_regulator: Arduino Voltage Regulator 24Vto12V L7812
Servo 5V: Servo's regulator MP1584 adjusted to 5V
Titresim 9V: DC motor's regulator MP1584 adjusted to 9V
VCC_Batt: 6S Battery
Ignore the 3D model's "TIP120" writing. Parts changed but I didn't change the 3D model.

Best Regards,
Emir Tanriver

Feb 19, 2021
333
No cap on the 9V supply ?

Same for 5V, even though Nano has one on its board a cap should be close to servo.

Thinking 5 uF each or more depending on servo current and motor current.

Does the servo need a back emf diode ?

For troubleshooting you could sub a power R for each of the loads, motor and servo,
to see if everything runs w/o error, to get clue what is root cause of problem. Also use DSO
scope, when servo and motor connected, set on level trigger, one shot, on Nano power line
and outputs to servo, motor. Set to trigger a diode drop above 5V or a diode drop below
ground, to see if you get triggers.

Cap choice, not all caps, for same value of C, have same ESR performance :

OSCON is polymer tantalum.

Regards, Dana.

Last edited:

#### emirtnrvr

Feb 16, 2023
13
No cap on the 9V supply ?

Same for 5V, even though Nano has one on its board a cap should be close to servo.

Thinking 5 uF each or more depending on servo current and motor current.

Does the servo need a back emf diode ?

For troubleshooting you could sub a power R for each of the loads, motor and servo,
to see if everything runs w/o error, to get clue what is root cause of problem. Also use DSO
scope, when servo and motor connected, set on level trigger, one shot, on Nano power line
and outputs to servo, motor. Set to trigger a diode drop above 5V or a diode drop below
ground, to see if you get triggers.

Cap choice, not all caps, for same value of C, have same ESR performance :

View attachment 58376

OSCON is polymer tantalum.

Regards, Dana.
Thanks for your reply. But I can't understand clearly why I can measure voltage from the circuit when PCB is unplugged. and I am a beginner so I don't know how to choose a capacitor or where should I use it. Can you explain more clearly please?
Brushless Motor: 6S 2A
Brushed DC Motor: 9V 2A
Servo:5V 2A

#### bidrohini

Feb 1, 2023
51
Here they used 500 ohms for a 12V motor.

### Arduino TIP122 DC motor Control - Electric Diy Lab This post is about Arduino and TIP122 DC motor control, we'll see how we can contorl DC motor using TIP122 transistor and arduino electricdiylab.com

#### emirtnrvr

Feb 16, 2023
13
Here they used 500 ohms for a 12V motor.

### Arduino TIP122 DC motor Control - Electric Diy Lab This post is about Arduino and TIP122 DC motor control, we'll see how we can contorl DC motor using TIP122 transistor and arduino electricdiylab.com

Thank you for your reply. But I changed TIP122 with IRLZ34N at dana's direction.

Feb 19, 2021
333
Thanks for your reply. But I can't understand clearly why I can measure voltage from the circuit when PCB is unplugged. and I am a beginner so I don't know how to choose a capacitor or where should I use it. Can you explain more clearly please?
Brushless Motor: 6S 2A
Brushed DC Motor: 9V 2A
Servo:5V 2A
When you are unplugged from battery, but have usb plugged in, usb will supply board with
5V thru D1, on this Nano board schematic.

How do you figure C size....

Basically you have the following electrical description of a cap. Q = C x V, Q is charge. dQ/dt = C x dV/dt = I = Current
needed by load when its turned on. So you want to determine C, solving for C = I / dV/dt. So if you want to limit the drop
in V when a 2A load is applied, say 100 mV, you have to look at response time reg takes to adapt to change. So during
that time we need C to supply charge until it does. Your regulators, the MP1584, I cannot tell from datasheet its time to
respond to a load change. You could do a jig test using scope to determine this. So lets use 10 mS as example. Then
reg takes over, we have C = 2 / (.1V/.01 sec) = .2 Farad. Huge cap, but we have a battery that will supply charge, and
its response time limited mainly by small amount of L in wiring/PCB trace. So battery will mitigate size of cap needed.
So you will have to experiment with cap size so that dip in 5V is minimal. That being said we now need to look at cap
type. "Normally" one uses a bulk cap to handle large current needs, and a ceramic type cap, say .1uF, to handle fast
transient needs.

You could write a quick and dirty Nano code to pulse Servo MOSFET in a tight loop, say 100 mS rate, and look at
scope dip in V, circuits response, and try caps to achieve goal. Dip in V is determined by specs on Nano board-

Regards, Dana.

Last edited:

#### emirtnrvr

Feb 16, 2023
13
When you are unplugged from batter, but have usb plugged in, usb will supply board with
5V thru D1, on this Nano board schematic.

View attachment 58377

Regards, Dana.
Thanks but in my situation neither USB nor Battery is connected to PCB.

#### emirtnrvr

Feb 16, 2023
13
I will try using cap but I don't know where should I place and which size cap should I use. Can you help me?

Feb 19, 2021
333
Do you have a scope ? If so model number ?

When no battery is connected, or USB, what points in circuit and V are you measuring ?
You are measuring DC right. Could be you are just picking up AC in your lab due to
things like fluorescent lighting, AC wiring.....

Regards, Dana

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