Supply L298n by 9v batteries connected in series and parallel


My motors are not spinning, my code is fine because i can see the results of my sensors in the serial monitor. I tried looking online to find out about the problem, and basically it said to connect 2 9v batteries in parallel to double its capacitance, so i did. It worked the first time but it only running when i put my scredrivers to the screw headers, after i unscrew the batteries it stopped working again. Should i add another 9v battery in parallell to the series connection, so it can double the voltage making it 18v because of the L298n Dual Bridge Motor Driver has a voltage drop. Is it safe? Will I break my motors?

TL;DR:
Have a 2 9v batteries connected in series parallel planning to add one more 9v battery and connect it in parallel series. Will it work?

EDIT:
I got confused,,, i got mixed up sorry!

fafi_azucar:
I tried looking online to find out about the problem, and basically it said to connect 2 9v batteries in parallel to double its capacitance, so i did.

fafi_azucar:
TL;DR:
Have a 2 9v batteries connected in series...

Which one is it?

fafi_azucar:
It worked the first time but it only running when i put my scredrivers to the screw headers, after i unscrew the batteries it stopped working again.

How do you expect it to work if you disconnect the batteries?

fafi_azucar:
Will I break my motors?

No one can answer that until you tell us exactly what motors you have.

Realistically you'll need to post your code and schematic before anyone can give you any meaningful help.

9V "transistor" or small rectangular smoke alarm batteries are a very poor choice for running motors. Their current capacity is low.

The L298 driver is a poor choice for battery powered projects because it drops 2 to 4 volts. That is power that is dissipated as useless heat. Better to choose a modern driver like one from Pololu.

BJHenry:
Which one is it?
How do you expect it to work if you disconnect the batteries?

No one can answer that until you tell us exactly what motors you have.

Realistically you'll need to post your code and schematic before anyone can give you any meaningful help.

I'm sorry for the confusion.
I'm using this dc geared motor "Redirect Notice"

About the battery connection~
First, I connected my 2 9v batteries in series,,, I was PLANNING to connect ANOTHER 9v battery to the connection, but i will hook it up in parallel compared to the first 2... So a 2s1p (2 series and 1 parallel) connection will be made.

fafi_azucar:
I'm sorry for the confusion.
I'm using this dc geared motor "Redirect Notice"

The product description quite clearly says that it is a 6V battery. Do you think connecting 18V might be a bit too high to connect to it?

BJHenry:
The product description quite clearly says that it is a 6V battery. Do you think connecting 18V might be a bit too high to connect to it?

so would it damage my motor? if 9v batteries even connected in series doesn't work? what batteries should i use? we don't have a local 18650 Li-Po battery seller here. any suggestions?

fafi_azucar:
About the battery connection~
First, I connected my 2 9v batteries in series,,, I was PLANNING to connect ANOTHER 9v battery to the connection, but i will hook it up in parallel compared to the first 2... So a 2s1p (2 series and 1 parallel) connection will be made.

No! That's not what 2S1P means. By connecting just 2 batteries in series you have a 2S1P (18V) batttery. You read it as 2 times 1 = 2 batteries, e.g. 2S3P would mean 3 parallel sets of 2 batteries in series so 6 in total.

And there is no way to connect another single 9V battery to a 2S set without doing damage or at least doing nothing useful.

If you connect your 2 or 3 batteries in PARALLEL then that will increase the capacity but not the voltage so you'll still have a 9V battery but a more capable battery that MIGHT successfully run 6V motors.

If you don't understand the difference between series and parallel please ask before destroying anything.

Steve

slipstick:
No! That's not what 2S1P means. By connecting just 2 batteries in series you have a 2S1P (18V) batttery. You read it as 2 times 1 = 2 batteries, e.g. 2S3P would mean 3 parallel sets of 2 batteries in series so 6 in total.

And there is no way to connect another single 9V battery to a 2S set without doing damage or at least doing nothing useful.

If you connect your 2 or 3 batteries in PARALLEL then that will increase the capacity but not the voltage so you'll still have a 9V battery but a more capable battery that MIGHT successfully run 6V motors.

If you don't understand the difference between series and parallel please ask before destroying anything.

Steve

OOOOOH WAIT sorry!! i got confused~~ I AM VERY SORRY! i just noticed it right now haha,, i'll edit my post later.

I meant to say~
I connected my 9v in parallel first! then i was going to add ANOTHER 9v battery but in series! Again I am sorry

Here is also my code, I made a obstacle and edge avoiding robot using 2 IR sensor and 1 ultrasonic sensor

int trigPin = 6; //trig Pin
int echoPin = 7; //echo Pin
int lm1=8; //left motor output 1
int lm2=9; //left motor output 2
int rm1=10;  //right motor output 1
int rm2=11;  //right motor output 2
int sl=13;    //sensor 1 input (left)
int sr=12;    //sensor 2 input (right)
int SlV=0;
int SrV=0;
//int led = A1;

void setup()
{
  pinMode(trigPin,OUTPUT);
  pinMode(echoPin,INPUT);
  pinMode(lm1,OUTPUT);
  pinMode(lm2,OUTPUT);
  pinMode(rm1,OUTPUT);
  pinMode(rm2,OUTPUT);
  //pinMode(led,OUTPUT);
  pinMode(sl,INPUT);
  pinMode(sr,INPUT);
  Serial.begin(115200);
 sTOP();
}
long duration, distance;

void loop()
//////////IR//////////
{
  SlV=digitalRead(sl);
  SrV=digitalRead(sr);
  
  if(SrV==LOW && SlV== LOW)
  {
    //digitalWrite(led,LOW);
      Serial.println("Table - both IR");
   ForWard();
    }
 
    if(SrV==HIGH && SlV== HIGH)
  {
    //digitalWrite(led,HIGH);
   Serial.println("Table Edge Detected - both IR");
   BackWard();
   delay(400);
   Right();
   delay(550);
   ForWard();
   delay(200);
    }
     if(SrV==LOW && SlV== HIGH)
  {
   //digitalWrite(led,HIGH);
   Serial.println("Edge Detected - left IR");
   BackWard();
   delay(400);
   Right();
   delay(550);
   ForWard();
   delay(200);
    }
     if(SrV==HIGH && SlV== LOW)
  {
   //digitalWrite(led,HIGH);
   Serial.println("Edge Detected - right IR");
   BackWard();
   delay(400);
   Left();
   delay(550);
   ForWard();
   delay(200);
    }
   

/////URS/////
     
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);  
  duration = pulseIn(echoPin, HIGH);
  distance = duration/58.2;
  if(distance<30)
    {
      Serial.println("Baso Piste Yawa - URS");
      sTOP();
      delay(2000);
      Right();
      delay(2000);
      ForWard();
    }
   else
    {
      Serial.println("Waray - URS");
      ForWard();
    }
  delay(0);
}

 void ForWard()
  {
   digitalWrite(lm1,HIGH);
   digitalWrite(lm2,LOW);
   digitalWrite(rm1,HIGH);
   digitalWrite(rm2,LOW);
  } 
  void BackWard()
  {
   digitalWrite(lm1,LOW);
   digitalWrite(lm2,HIGH);
   digitalWrite(rm1,LOW);
   digitalWrite(rm2,HIGH);
  }
  void Left()
  {
   digitalWrite(lm1,LOW);
   digitalWrite(lm2,HIGH);
   digitalWrite(rm1,HIGH);
   digitalWrite(rm2,LOW);
  } 
  void Right()
  {
   digitalWrite(lm1,HIGH);
   digitalWrite(lm2,LOW);
   digitalWrite(rm1,LOW);
   digitalWrite(rm2,HIGH);
  }  

    void sTOP()
  {
   digitalWrite(lm1,LOW);
   digitalWrite(lm2,LOW);
   digitalWrite(rm1,LOW);
   digitalWrite(rm2,LOW);
  }

I think by starting all over with how you are going to supply the project. Others have wrote that the 9V is a poor battery choice and I am writing that a 9V battery is a poor choice for this project. By insisting on using a 9V battery to run this project. it's not going to work... and you will have wasted your time and our time.

My recommendation would be to use batteries from a RC car/truck/boat pack or make your own battery pack from some 18850 and a few regulators.

In my latest project I built a power supply using 2, 2600mAh 188650's in series wired to a small switching regulator to generate 7.5 volts. I then send two linear regulators to power the project.

Others may have other suggestions but the message has been clear 9V square, used in smoke detector, type of batteries are just not up to the task.