L298n voltage drop

I am using a 12V DC motor with l298n motor driver. My power supply is 12v and 3.5A. When i remove the motor and make the connection between the motor driver and the arduino, i get 12 V output, but the moment i attach my motor, the Voltage drops to 6V.
Does someone know what could be the problem with my code or connections?
P.S. I have a common ground with arduino and power supply.
Does it have anything to do with voltage droop?

const int motorPin1 = 10; // Pin 7 of L293
const int motorPin2 = 9; // Pin 2 of L293
//int motor_ena= 3;
void setup(){

pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
//pinMode(motor_ena, OUTPUT);
//Motor Control - Motor A: motorPin1,motorpin2 & Motor B: motorpin3,motorpin4

}
void loop() {

//clockwise direction
digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, LOW);
//analogWrite( motor_ena, 255);

}

Still looking for aid in this problem. I would appreciate some help

What current does that motor draw? At higher currents, according to the L298 data sheet (snippet below) it loses almost 5V. That would leave you with 7V. Maybe the power supply is sagging too.

Solution is to get a 21st century driver; perhaps look here.

But I'm confused: your code comments say 293 all over not 298, and you have the EN pin stuff commented out. The EN pin is a 298 thing, but if you don't connect it nothing will work. Have you got 5V hardwired to the EN?

Thank you for responding.

There was a typo with the 293. I am using 298n(the red one). I had put the enable pin in my code initially to control the speed of the motor. But now i have removed the enable pin from both the arduino and the l298n motor driver. I understand this motor driver is outdated and i should use a better one, but the pololu drivers are very expensive and hard to get in my country. Can i make my own H-bridge instead?

Yes, the voltage drop is now 6V.

And secondly, I tried connecting my motor directly with a 12V battery and there was no voltage drop. the current it takes is 3amps.

But when i make the same connection with a 12V wall adapter, the voltage drops to 6V and decreases the speed.
Could you tell me why i have a votage drop with the adapter but not with the battery?

Would a solution to this problem be raising the voltage?

Dear, ahmadmoaz, read what is written on your "adapter". You will see output voltage: 12VDC and current: XXA or XX mA. There you will find the answer :wink: battery act as high current power supply. Battery have capacity XXXXXAh, you can calculate how long you can run motor with battery at XXA curent and XXV voltage. But your "adapter" have max current that it can deliver. And when you connect your 3Amps motor it have quit big drop down voltage.

The most important thing to know before anything else is the stall current of the motor.

Without that you cannot choose a driver.

The adapter states 12V and 3A.
The battery shows 12V and 4 A.

I tried raising the voltage too. Even with an AC to DC adapter supply of 15V DC and 3.5 A, the voltage across the motor is 6V.
But with 12 V battery, the voltage remains 12V.

Does it have anything to do with voltage droop?

When motor starts spinning it have current peak, so your adapter protection can turn on

ahmadmoaz:
The adapter states 12V and 3A.
The battery shows 12V and 4 A.

I tried raising the voltage too. Even with an AC to DC adapter supply of 15V DC and 3.5 A, the voltage across the motor is 6V.
But with 12 V battery, the voltage remains 12V.

Does it have anything to do with voltage droop?

What is the stall current of the motor? That's the first thing to establish, there is no point
continuing without this basic information, since it will determine which motor drivers can
work.

friends, If i have 12V motors and I want to it to be a dual H-bridge what spec H-bridge should I get. Any suggestions preferable in link form?

Thanks in advance,
Bull Engineer

friends, If i have 12V motors and I want to it to be a dual H-bridge what spec H-bridge should I get

Do you actually read the advice and questions that are posted? No one can answer that question till you tell us the STALL CURRENT of the motor.

There are several different threads where you were given advice on the same question. No matter how many times or places that you ask the same question the answers will not change.

Well friend, what is stall current? I cant answer that, can you advise me?

your friend,
BullEngineer

Stall current is the current that a motor will draw when powered and the rotor is locked (unable to rotate). Stall current is also drawn every time the motor starts up from a stopped condition. That is why a motor driver must be able to handle stall current.

In one of your earlier threads I even described how to estimate the stall current by measuring the coil resistance if you don't have the motor data sheet, but i guess you missed that.

You should read this post.

Sorry for responding this late. I checked and the Stall current that i found of my motor is 18A. the nominal current on the other end is 3.25A. (these were checked using the 12 V battery ). I tried to check it by connecting the ammeter and tried to stop the motor. The current rose up untill 18A afterwhich the battery sparked and i removed it. At this point the motor was almost at a stall.

ahmadmoaz:
Stall current that i found of my motor is 18A.

Waaaaay out of the 2A L298 world.

neiklot:
Waaaaay out of the 2A L298 world.

I know. i searched online and found Cytron 10A DC Motor Driver Arduino Shield. But i cant find this in my country. Is there a way i could build my own H-Bridge for these specifications?

ahmadmoaz:
Is there a way i could build my own H-Bridge for these specifications?

Probably, but I have no idea about the details. I'm thinking dabbling at almost 20A is professional territory.

Are you sure about the 18A?- that must be good meter you have, my decent Fluke is only 10A.

neiklot:
Probably, but I have no idea about the details. I'm thinking dabbling at almost 20A is professional territory.

Are you sure about the 18A?- that must be good meter you have, my decent Fluke is only 10A.

I researched online and now i am thinking of getting BTS7960 as a motor driver for it. i am going to try it today and let you know how this turns out.