DC Motors are found everywhere: electronics, toys, fans, tools, discs, pumps etc. DC Motor is an actuator that converts the DC supply to rotation or movement.
There are different types of DC motors: Brushed DC motor, Brushless DC motor, Geared DC motor, Servo motor, Stepper motor and DC Linear Actuator.
Different types of motors are used in different applications like Robotics, precision positioning, industrial automation etc.
Generally, when a DC motor is associated with any microcontroller based system, it is often connected using a Motor Driver IC. A Motor Driver IC provides the necessary current for the motor to run. It can also control the direction of the rotation.
In this project, an Arduino based speed and direction control of DC motor without using Motor Driver IC is designed. A DC Motor can’t be connected to a Microcontroller as the output current of the Microcontroller is very small and it cannot drive the motor.
Hence, we use transistors to form an H-bridge to drive the motor. The circuit diagram, description and its working are mentioned below.
It is a Microcontroller Based prototyping board. The microcontroller used on the Arduino Uno board is ATmega328p. Arduino is responsible for controlling the speed and direction of the motor with the help of other components.
It is an NPN transistor with an output current of 800mA. The maximum output current that is available from Arduino’s I/O pins is 50mA, which is not sufficient to drive a motor. Hence, four transistors with high current capability are used.
Arduino is the main processing unit of the project. The wiper terminal of the POT is connected to the Analog Pin (A0) of the Arduino. The other terminals are connected to Vcc and GND. Four transistors are connected as shown in the circuit diagram.
With the load i.e. a DC Motor in the center, they form an H – bridge. Transistors Q1 and Q4 form the backward direction path while transistors Q2 and Q3 form forward rotation path.
The inputs to the transistors are given from the Arduino. The pins 3 and 2 of the Arduino are connected to the base of Q1 and Q4 respectively. Pins 5 and 4 are connected to base of Q2 and Q3 respectively. All these connections are made through four 1 KΩ resistors.
A DC Motor is an inductive load and can produce back EMF when we are changing the direction. In order to eliminate the effect of any back EMF, four diodes are connected across the collector and emitter of each transistor.
The aim of this project is to control the speed and direction of a DC Motor without using a Motor Driver IC. Hence, we need to form an H-bridge using transistors in order to drive the motor. The working of the project is explained here assuming all the connections are made as per the circuit diagram.
The POT is connected to the analog pin A0 of the Arduino. This is used to adjust the speed of the motor. The normal operation of the motor is to rotate in forward direction.
When a button, which is connected to the Pin 13 of the Arduino, is activated or pressed, the direction of the rotation must be reversed and should stay in that direction until the button is released.
For forward rotation of the motor, transistors Q2 and Q3 must be turned on. Hence, the outputs 5 and 4 of the Arduino are high. The button is connected between Pin 13 and ground.
The Arduino is programmed to detect a logic low on the Pin 13 when the button is pressed. When the button is pressed, the transistors Q1 and Q4 must be turned on. Hence, the pins 3 and 2 of Arduino are made high. The motor rotates in reverse direction as long as the button is pressed.
- The motor used in this project is a geared motor used for mobile robots. Hence, the rotation seems slow.
- The project is built using 2N2222 transistor, which has a maximum current rating of 800mA which is enough to drive low current motors. For driving motors with larger current requirements, BD139 (up to 1.5A) or other MOSFETS can be used.
- The code can be modified so that push to forward rotation and push to reverse rotation can be achieved.
- The circuit can be used to drive a single DC motor without Motor Driver IC.
- The circuit can be extended to 2 motors by implementing dual H-bridge connections.
- Can be used in simple robotic applications to control direction and speed of single motor.