DC Motors An interfacing method for turning on and off a DC motor via a microcontroller is shown below. However, the above circuit will only work for a 5 V motor. If the supply voltage is changed (for example, if the supply is changed to 12 V to run a 12 V motor) then the motor will be on all the time because 5 V applied to the base of the p-n-p transistor is not enough to turn it off. To interface to larger motors the following circuit may be used.
In the above example a 12 V DC motor is interfaced to a microcontroller. When the port pin is set (ie; is equal to 5 V) the p-n-p transistor is off which means the n-p-n transistor is also off. Therefore there is no path for current through the motor and the motor is off. When the port pin is cleared the p-n-p transistor is on. This turns on the n-p-n transistor which allows current to flow through the motor to ground; the motor is on. The value of R2 needs to be carefully chosen; too high and the current into the base of the n-p-n transistor will not be enough to turn on the transistor, too low and the circuit draws too much current. Bi-directional DC Motor A circuit diagram for interfacing a 12V DC motor to a microcontroller in a way that allows the controller to not only turn on and off the motor but also to set the direction in which the motor runs when it is on, is given below.
The circuit is made up of a bridge. If both sides of the motor are at the same voltage the motor is off. So, if T1 and T3 are on, both sides of the motor are connected to 12 V and the motor is off. If T2 and T4 are on both sides of the motor are connected to ground and, again, the motor is off. If T1 and T4 are on then the left side of the motor is at 12 V and the right side is at ground, therefore the motor runs in one direction. We will call this forward. If T3 and T2 are on then the left side of the motor is at ground and the right side is at 12 V, therefore the motor runs in the opposite direction; ie, reverse. The circuit is designed so that T1 and T2 cannot be on at the same time and T3 and T4 cannot be on at the same time. This is very important; if T1 and T2 were on at the same time there would be a short circuit between 12 V and ground and the transistors would burn out. The same is true for T3 and T4. The truth table for the circuit with its two inputs, A and B, is given below.
A |
B |
Motor |
0 |
0 |
off |
0 |
1 (5 V) |
reverse |
1 (5 V) |
0 |
forward |
1 (5 V) |
1 (5 V) |
off |
An explanation of the four entries in the table is given below:
Download your Full Reports for DC Motors
Advertisement