how to control dc motor with l293d

Discussion in 'Embedded Systems and Microcontrollers' started by bobparihar, Apr 7, 2015.

  1. bobparihar

    Thread Starter Member

    Jul 31, 2014
    here i am trying to interface dc motor with arduino uno for this i am using L293d, following is my code for rotating motor in either direction
    void setup() {
    // put your setup code here, to run once:
    pinMode(2, OUTPUT);
    pinMode(3, OUTPUT);

    void loop() {
    // put your main code here, to run repeatedly:
    digitalWrite(2, HIGH);
    digitalWrite(3, LOW);

    following is my circuit of L293D and the circuit board in the attachment

    now the problem i am facing is when i connect the motor input and output at the left side of the motor( out 1 and out 2) the motor rotates but when i connect motor at Right of IC(out 3 and out 4) the motor does not rotate
    left side of the ic working right side doesn't .. even i have cross checked that both Enable pin is shorted to vcc
  2. BtoomBoom

    New Member

    Mar 31, 2015
    If I understand it properly you are sending a signal 1 on L293d's pin 2, 0 on pin 3 but nothing on pins 4 and 5. Motor 2 is not going to run on 0,0. Send a high signal on pin 4 or 5 to run it.

    Senior Member

    Jun 29, 2010
    Please first check the circuit simply with motor and input bu switch not by micro to get it test!
    read data sheet!