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);
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.
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?
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?
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 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 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.
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
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.
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.
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.
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?