Blogroll

Powered by Blogger.

Saturday, 29 March 2014

Control DC Motor Direction Using L293D Motor Driver and Arduino

by realfinetime electronics  |  in Motor Driver at  23:23

L293D is a popular motor driver. It is special by its high current and voltage rating. Each L293D can be used to control two motors. Each side controls each motor. 1A and 2A is the control pins for motor M1. Similarly 3A and 4A is the control pins for motor  M2. Here, the circuit is demonstrated to control M1 only. Control pins are normally connected to Microcontrollers. I used Arduino to give control signals. Circuit Diagram is as shown in figure given below.


Direction of rotation as per the control signals is represented in the following table.

Program for clockwise rotation of motor.

int oneA = 13;
int twoA = 12;

void setup() {                
  pinMode(oneA, OUTPUT);      
  pinMode(twoA, OUTPUT);   
}

void loop() {
  digitalWrite(oneA, HIGH);   // 1A = 1
  digitalWrite(twoA, LOW);    // 2A = 0
  delay(1000);                       // wait for a second
}


Program for anticlockwise rotation of motor.

int oneA = 13;
int twoA = 12;

void setup() {                
  pinMode(oneA, OUTPUT);      
  pinMode(twoA, OUTPUT);   
}

void loop() {
  digitalWrite(oneA, LOW);     // 1A = 0
  digitalWrite(twoA, HIGH);    // 2A = 1
  delay(1000);                       // wait for a second
}

3 comments:

  1. Thanks, i will try this schematic for 2 motors.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. Hii You post a nice blog about Arduino Uno. You have good Explained of this Arduino Uno post .
      Thanks for sharing. https://robomart.com/arduino-uno

      Delete

IMPORTANT NOTICE

All the circuits, published in this blog is only after testing and getting proper results in my private lab. When you try these circuits, you should check the supply voltage, polarity of components, presence of childrens nearby and shorts in the circuits. This website will not be responsible for any harm happened to you or your components caused by your carelessness.

For More Electronic Tips

Proudly Powered by Blogger.