How to Use the L293D Motor Driver – Arduino Tutorial
The L293D is a 16-pin Motor Driver IC which can control a set of two DC motors simultaneously in any direction. The L293D is designed to provide bidirectional drive currents of up to 600 mA (per channel) at voltages from 4.5 V to 36 V (at pin 8!). You can use it to control small dc motors – toy motors. Sometimes it can be extremely hot.
In this tutorial you will learn how to use it with Arduino uno to control two dc motors.
Components :
- Arduino Uno
- Breadboard
- L293D Motor Driver IC
- Jumper wires
Connections:
- PIN 1 – connect to an Arduino digital pin 6
- PIN 2 – connect to an Arduino digital pin 5
- PIN 3 – connect to DC motor one pin
- PIN 5 – connect to an Arduino GND
- PIN 6 – connect to DC motor another pin
- PIN 7 – connect to an Arduino digital pin 4
- PIN 8 – connect to an Arduino 5V
- PIN 16 – connect to an Arduino 5V
Example Code:
void setup() { pinMode(4,OUTPUT); pinMode(5,OUTPUT); pinMode(6,OUTPUT); digitalWrite(4,HIGH); } void loop() { // motor rotate left to right direction digitalWrite(5,HIGH); digitalWrite(6,LOW); delay(5000); // motor right to left direction digitalWrite(6,HIGH); digitalWrite(5,LOW); delay(5000); }
Leave a Comment
(0 Comments)