L298n Is a mess. HELPPP!

Hello lads, I'm a newbie who bought a 4w chassis (Motors work with 5v to 10v, don't know the amps), an l298n, and other stuff. I have 3 different batteries, a 6v 4.0AH Lead-Acid battery (It's the small one but heavy AF) a battery pack of 6v of 4 aa, and a 9v battery. I haven't tested the big 6v battery coz It discharged.

The problem::: Idk why when I use the 6v battery pack only 2 motors move really slow. The input is 6v the output is 0.5v (why is there a 5.5v drop???). Same thing when I use a 9v battery.

int IN1 = 7;
int IN2 = 6;
int IN3 = 5; 
int IN4 = 4;

void setup()
{
  pinMode (IN4, OUTPUT);    
  pinMode (IN3, OUTPUT);    
  pinMode (IN1, OUTPUT);
  pinMode (IN2, OUTPUT);
}
  
  void loop()
{

  // One sense
  digitalWrite (IN4, LOW);
  digitalWrite (IN3, HIGH); 
  digitalWrite (IN1, HIGH);
  digitalWrite (IN2, LOW); 
  delay(4000);

  // Stops
  digitalWrite (IN3, LOW); 
    digitalWrite (IN4, LOW);
  digitalWrite (IN1, LOW); 
  digitalWrite (IN2, LOW); 
  delay(500);

  // Other sense
   digitalWrite (IN3, HIGH); 
    digitalWrite (IN4, LOW);
  digitalWrite (IN1, LOW); 
  digitalWrite (IN2, HIGH); 
  delay(4000);

  // Stops
   digitalWrite (IN3, LOW); 
    digitalWrite (IN4, LOW);
  digitalWrite (IN1, LOW); 
  digitalWrite (IN2, LOW); 
  delay(5000);
}

Avoid the ancient, inefficient L298, which is causing the observed voltage drop. Pololu carries modern, efficient brushed DC motor drivers.

You will need to buy a driver that can easily handle the start/stall current of the motors.

9V smoke alarm batteries do not have enough current capacity to drive motors and barely enough to power the Uno. 9V smoke alarm batteries have no place in Arduino projects even though they are widely shown in projects. Don't believe what you see on the internet.

1 Like

The problem is that I need to use this, my school tells me its necessary LOl

Thx, should I use the 6v lead battery? What battery do u recommend.

Your school's recommendations are wrong, and won't work.

1 Like

If the motors are 1.5V to 3V motors the 6V pack (4 AA batteries) should do something if the batteries are new. The crappy L298 drops 2 to 4 volts so there should be 4V to 2V for the motors. If the motors are 6V motors then I don't know what you can do with what you have.

Is this your board ?

L298N-Motor-Driver-Module-Pinout


What is the battery voltage when the motors are turned on ?

What is the voltage across the motor when it is turned on ?

yes, with a 9v battery, its 0.23v Idk why but they don't even move... Its weird why does it have a 9v in and a 0.23v out... When I power 2 motors instead of 4 it does work.

Are the ENA and ENB jumpers installed ?


Measure the battery voltage when the motors are turned on; what do you measure ?

If, as you say, the 6V SLA battery has discharged… (what voltage does it read?)

It’s most likely scrap, because 6V SLA batteries don’t live very long once their voltage drops below about 5.2 V.

Internal damage. Won’t hold a new charge.

No they arent, 4v.

That is because the 9V battery does not have the capability to supply the required current and so the voltage is dragged down. Please just forget the 9V battery. Even if it works at all, it will only be for a short time. If the AA batteries in the 6V pack are fresh, they should work.

I just bought it for tests, it came with 3.23v. I live in a third world country so finding stuff is hard, thats why it came with that voltage. Should i change it? Can i recharge it?

The 6v batteries work only for 2 motors they cant manage 4

These need to be HIGH.

What do you mean?

Pulling these pins HIGH will make the motors spin (depending on the control inputs), pulling it LOW will make them stop.

4v is not going to cut it.

As mentioned, you need a good battery.

Suggest a 9v (6 AAs) battery pack:


or
12v (8 AAs)

Hi, @mathiasthenoob

What voltage does the 6V pack voltage drop to when you try to drive 4 and then 2 motors?

Thanks.. Tom... :smiley: :+1: :coffee: :australia: