Arduino Control Motor Driver Using L293D and Arduino

Control Motor using arduino

The L293D motor driver IC

A motor driver IC is an IC chip used to control motors simultaneously and in a bi-directional manner. In a robot, it acts as an interface between microprocessors and the motors. The L293D is one of the most commonly used motor drive IC’s. It is composed of 2 H-bridges. An H-bridge is the most basic circuit for controlling low current motors. The L293D has 16 pins as listed below;

  • Ground pins-4
  • Input pins-4
  • Output pins-4
  • Enable pins-2
  • Voltage pins-2
L293D motor driver IC
Motor Driver IC’s are mostly used to control motors of autonomous robot

Motor Driver IC’s are mostly used to control motors of autonomous robots. After trial and error, I managed to come up with a simple but efficient way to control two small motors using the L293D and Arduino.

Items required

Circuit

controlling motor
You can power L293D using an external power source with up to 36V. However, ensure you do not impart more volts that the motors can take lest you burn them.

Connect the components as shown above. The connection is pretty easy and fast. You can power L293D using an external power source with up to 36V. However, ensure you do not impart more volts that the motors can take lest you burn them.

The Code

You could also modify the code for different types of controls, for instance, you could use analogWrite (pin, PWM value) in place of digitalWrite(pin, HIGH/LOW) so as to control motor speeds.

If you have implemented this successfully, congratulations! You now know how L293D alongside an Arduino Uno can be used to control DC motors.