Motor is not spinning with l293d motor driver and arduino

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - VARIABLES

int motorSpeed = 200; // motor speed - from 0 to 255;

// Motor Pins
// the H bridge takes two outputs from the Arduino to control each motor.
int motor1_Pin0 = 11;
int motor1_Pin1 = 6;

int motor2_Pin0 = 5;
int motor2_Pin1 = 3;

void setup() {

// set Arduino pins as outputs
pinMode(motor1_Pin0, OUTPUT);
pinMode(motor1_Pin1, OUTPUT);

pinMode(motor2_Pin0, OUTPUT);
pinMode(motor2_Pin1, OUTPUT);

void loop() {

analogWrite(motor1_Pin0, motorSpeed);
digitalWrite(motor1_Pin1, LOW);

analogWrite(motor2_Pin0, motorSpeed);
digitalWrite(motor2_Pin1, LOW);

delay (1000);

digitalWrite(motor1_Pin0, LOW);
analogWrite(motor1_Pin1, motorSpeed);

digitalWrite(motor2_Pin0, LOW);
analogWrite(motor2_Pin1, motorSpeed);

delay (1000);


Please help and do find some mistakes


No closing brace on setup() for a start.


It would have been nice if you had provided a schematic of your actual circuit, with both motors. The motor that is there in the pic is on different pins from the code, so which is right?

But let's assume the circuit you have, matches the sketch.

What voltage do your motors need, and are you supplying enough on pin 8 of the 293? The 293 datasheet says that needs to be at least as high as the logic supply on pin 16, so 5V minimum if your pic is correct.

Then assuming the motor voltage is high enough to make the 293 happy, there's a voltage drop (about 2V iirc) through the 293 so your motors may not be happy with that.

Measure the voltage on the 293 output pins.....

Thanks for your inputs I will check on that and come back to you

Presumably you checked the motors actually work, by powering them direct from the battery?

Direct connection of motors to the batteries work

A picture of your project would be good too.

Can you please post a copy of your complete sketch, using code tags?
They are made with the </> icon in the reply Menu.
See section 7,148850.0.html

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks …Tom… :slight_smile:
(just be different I did it in a different order this time :))

It is already there as an image in the initial post please refer to it as a jpg file