Motors do not spin when changing direction

hi, i am building a 4wd arduino car, I want it to move in straight line and change direction for 5s intervals using arduino l298n motor driver. The forward movement works fine. However, for the reverse only right side of motors spin, left side doesnt move, here is my code:

// left side connections 
int in1 = 3;     //in1 to pin 3
int in2 = 11;    //in2 to pin11
// right side connections
int in3 = 12;     //in3 to pin12
int in4 = 13;      //in4 to pin13

//pin 4-10 are connected to liquid crystal display

void setup() {
  pinMode(in1, OUTPUT);
  pinMode(in2, OUTPUT);
  pinMode(in3, OUTPUT);
  pinMode(in4, OUTPUT);

  digitalWrite(in1, LOW);
  digitalWrite(in2, LOW);
  digitalWrite(in3, LOW);
  digitalWrite(in4, LOW);
}

void loop() {
  digitalWrite(in1, HIGH);
  digitalWrite(in2, LOW);
  digitalWrite(in3, HIGH);
  digitalWrite(in4, LOW);
  delay(5000);
  digitalWrite(in1, LOW);
  digitalWrite(in2, HIGH);
  digitalWrite(in3, LOW);
  digitalWrite(in4, HIGH);
 delay(5000);
}

I'm sure all wiring and connections are right, what could be the issue?

A wire needed for the left side going backwards is missing, faulty or makes no connection.

1 Like

I doubt they are. Use your multimeter to verify wiring correctness and continuity.

If this is put together on a breadboard, move connections, as breadboards are for temporary experiments and tend to be unreliable.

Railroader got it right, it shows that on page 33 of the unfinished schematic. Also on page 45 there is a wire going nowhere.

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