Updated: Aug 10
A DC motor is an electric motor that converts direct electrical current energy into mechanical energy, mostly all DC motor works on the same mechanism for periodically changing the direction of current in the motor. Through this article one can learn how to interface a DC #l293d DC motor with #Arduino, along with the coding and circuit diagram.
The image shows the list of components needed. Let's have a quick look at each of them.
What is a Bread Board?
A breadboard is a rectangular board with small holes in it that are used for connecting elements. The connections are not fixed and can be varied. In a breadboard, all the holes in one horizontal line are in series connection with each other. Breadboards are made from plastic and come in all shapes, sizes, and even different colors, the most common sizes are "full-size," "half-size," and "mini" breadboards.
Buy a Breadboard:- https://amzn.to/3lsvU6x
What is an Arduino Board?
Arduino Board can address inputs such as light on a sensor, Twitter information, a finger on a button, and turn it to an output such as initiating a motor, turning on an LED, advertising something online. All of this can be done by transferring a set of instructions to the microcontroller on the board by the use of the Arduino programming language.
Wanna buy an Arduino here's the link:- https://amzn.to/3iCbCFW
l293d motor driver:-The Pin Diagram of an l293d DC motor is as shown. The VSS is where the power supply is given. IN4 and IN3 will be used for direction control. OUT4 and OUT3 will be connected to the DC motor. The 12 and 13 GND pin will be grounded. Enable (EN) is used to control the speed of the DC motor.
Buy DC motor:- https://amzn.to/36NPpCx
Jumper wires:- Jumper wires are used to establish a connection between different elements in the circuit and the Arduino board.
Buy jumper wires:- https://amzn.to/3jGvoBm
Circuit Diagram for dc motor
The circuit connections are as follows, The power terminal that is VSS is connected to the positive terminal of the breadboard which is further connected to the 5v of the Arduino board. The input 4 (IN4) is connected to the 4th pin of the Arduino chip, while the output 4 (OUT4) pin is connected to the DC motor. Both the ground pins are grounded on the negative terminal. Output 3 (OUT3) is again connected to the DC motor. Input 3 (IN3) is connected to pin 3 of the Arduino board. The enable (EN2) is connected to pin number 2 of the Adruino board.
There is an external power supply used because Arduino alone cannot handle the DC motor. The positive terminal of the power supply is connected to the positive of the breadboard which further is connected to the VS of the DC motor for extra power. The negative terminal of the power supply is connected to the ground of the breadboard
DC motor working
The working of DC Motor is quite simple, As the code is applied to the Arduino chip the fan starts to rotate in an anticlockwise direction first then after a pause of 2 sec it will rotate in a clockwise direction. This process will continue. The below image shows the picture of the circuit when the code is not applied.
The view of the circuit when the code is applied.
Video explanation with the practical implementation, for a more beneficial perception.
Video by:- Kaushik Ram Selvaraj
The interfacing gives an overview of how to interface a DC motor with Arduino and use it to rotate a fan. Similarly, numerous other applications can be designed for more knowledge purposes. Small DC motors find applications in tools, gadgets, and appliances. Larger DC motors are currently employed in the propulsion of electric vehicles, elevators, hoists, etc.