H bridge motor using L293D

I am looking to turn a single motor clockwise and anticlockwise alternatively. However when I run the simulation the motor doesn't run in any direction. Code and circuit image have been attached.

int ford = 8;
int back = 12;
void setup()
{
  pinMode(ford, OUTPUT);
  pinMode(back,OUTPUT);
  Serial.begin(9600);
}

void loop()
{
  digitalWrite(ford,LOW);
  digitalWrite(back,LOW);
  delay(100);
  digitalWrite(ford,HIGH);
  digitalWrite(back,LOW);
  delay(200);
  digitalWrite(ford,LOW);
  digitalWrite(back,HIGH);
  delay(200);
}

I see your ground jumper on your breadboard but no Vcc jumper one side of the board to the other. I see your 6.0 Volt battery pack and please tell me you are not feeding 6.0 Volts to your Arduino 5.0 Volt pin?

While in its day the L293 was a good choice today there are much better choices as your motor will see much less voltage than the 6.0 Volts you are applying due to losses. Newer chips use MOSFET design for much less loss. What is your motor voltage & current requirements?

Ron

1 Like

Thanks! I realized my mistake
I am using L293 as part of an assignment

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.