L293d Motor Driver Arduino

After seeing some complicated circuit diagram of L293D motor driver online. I thought why not make it more easier for people. And that's why in this post I'm sharing a colorful circuit diagram of L293D. So that you can clearly understand which wire is going where.



In the diagram above you can see all the wires are in different colour except for both motor wires. Well, I've made it one colour for both, because the pin 3, 6, 11 and 14 can turn into + or - at any time. So I though there is no point of making  them in different colour.

OK, let's go through some important pins. Pin 3 and 6 is for left motor and pin 11 and 14 is for right motor. Pin 1, 9 and 16 for Arduino 5v and Pin 4, 5, 12 and 13 is for GND of both Arduino and the external power. Pin 2 and 7 is for controlling left motor and pin 10 and 15 is to control the right motor. And finally the pin number 8 is for v in of external power.

Now let us see the sketch, but before I share the sketch let me tell you what it actually does.
  • It starts with 2 seconds delay, just to give some time to settle down when you press the reset button.
  • Turns on the green LED to let you know that it's ready to go.
  • Goes forward 2 seconds.
  • Turns left.
  • Comes back.
  • Turns right
  • Comes back
  • Goes backward for 2 seconds.
  • It will do all the above tasks once then will stop, if you want to make it do again then press the reset button.
The sketch 


int lmotorf = 2;
int lmotorb = 3;
int rmotorf = 4;
int rmotorb = 5;
int greenled = 6;

// the setup routine runs once when you press reset:
void setup() {              
  // initialize the digital pin as an output.
  pinMode(lmotorf, OUTPUT);
  pinMode(lmotorb, OUTPUT);
  pinMode(rmotorf, OUTPUT);
  pinMode(rmotorb, OUTPUT);
  pinMode(greenled, OUTPUT);


  delay(2000);
  digitalWrite(greenled, 1);
  delay(500);
  digitalWrite(greenled, 0);
  delay(10);

  
  digitalWrite(lmotorf, HIGH);   // turn the leftforward on.
  digitalWrite(rmotorf, HIGH);  // turn the rightforward on.
  delay(2000);      // wait for a miliseconds
  digitalWrite(lmotorf, LOW);  // turn the leftforward off.
  digitalWrite(rmotorf, LOW); // turn the rightforward off.
  delay(1000);
 
  digitalWrite(rmotorf, HIGH);
  delay(500);
  digitalWrite(rmotorf, LOW);
  delay(1000);

  digitalWrite(rmotorb, HIGH);
  delay(500);
  digitalWrite(rmotorb, LOW);
  delay(1000);
 
  digitalWrite(lmotorf, HIGH);
  delay(500);
  digitalWrite(lmotorf, LOW);
  delay(1000);

  digitalWrite(lmotorb, HIGH);
  delay(500);
  digitalWrite(lmotorb, LOW);
  delay(1000);
 
  digitalWrite(lmotorb, HIGH); 
  digitalWrite(rmotorb, HIGH);
  delay(2000);
  digitalWrite(lmotorb, LOW);  
  digitalWrite(rmotorb, LOW);
  delay(50);
 
}

// the loop routine runs over and over again forever:
void loop() {
          
  delay(50);            
}


Few pin names which you might not have understood.
  • lmotorf = Left motor forward.
  • lmotorb = Left motor backward.
  • rmotorf = Right motor forward.
  • rmotorb = Right motor backward.

Just by getting control of the motors you can do lot of things. For example moving robotic arms up and down or turning it side to side and so on. This is a simple sketch, but just by editing a bit you can control the motor on your command. If you didn't understand something, please let me know in the comments below.

Let's see the sketch in action




l293d circuit diagram. l293d motor driver pin diagram. l293d motor driver circuit diagram. l293d wiring diagram. l293d motor connection. l293d ic diagram. l293d motor circuit. l293d pin diagram. l293d ic pin diagram. motor driver pin diagram. motor driver l293d pin diagram. pin diagram of l293d. l293d diagram. l293d circuit. motor driver l293d circuit diagram. l293d motor driver module circuit diagram. l293d motor driver diagram. l293d connection diagram. how to make l293d motor driver. l293d motor driver board pin diagram. circuit diagram of l293d motor driver. l293 motor driver pin diagram. l293d ic circuit diagram. pin diagram of l293d motor driver. motor driver circuit diagram. l2930 pin diagram. l293d wiring. motor driver l293d circuit. l293d motor driver circuit.

l293d schematic diagram. l293 motor driver circuit. l293d motor driver working. l293d motor driver module pin diagram. l293d motor driver schematic l293d pin configuration. l293d circuit diagram motor driver. how to use l293d motor driver. l293d motor driver ic pin diagram. can pin diagram. circuit diagram of motor driver. motor driver ic l293d pin diagram. l2930 motor driver. pin configuration of l293d. motor circuit diagram. ic l293d pin diagram. l293 circuit diagram. l293d module pin diagram. l293d motor driver pin configuration. circuit l293d. l293d ic pin configuration. l2930 ic. ic 293d pin diagram. l293d motor driver circuit schematic. lm293d pin diagram. motor driver diagram. l293d motor driver pin description. pin diagram of l293d motor driver ic. driver circuit diagram. working of l293d motor driver. l293d pin out. l293d pin description.

2 comments:



Newly posted:
Reason why rich getting richer and poor getting poorer