Hi Good Day! I am having diffuculties running my motor. I have connected my pins correctly from the L298n to my arduino. I am using 18v power supply by connecting 2 9v batteries in series. I am aware of the large voltage drop but 9 volts and 18 volts does the same output. Looking forward to you reply.Thanks!
Could you take a few moments to Learn How To Use The Forum.
Then add many of the missing details ?
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.
Hi ballscrewbob. Sorry for the lack of information. I could not attach a code because it says its too large but the code is fine its working. I managed to make the motor spin but when resistance to the motor is applied it pulses.
That being the case would to me suggest the PSU for the motor may not be up to the task.
Extra details such as motor specifications (links) may be of use.
BTW the 9V square batteries are not the best for motor projects as they often cannot supply sustained current.
Thanks for the reply. So would it be best to use double A batteries instead of a 9v? And what is the recomended voltage to power the L298n and the motor efficiently?
Side comment: how do you add pictures in your post. It says my photo is too large?
Thanks!
Another thing is that it stutters. I dont know if this is a problem in the l298n or on the power supply? Please help.
To add a picture it needs to be a certain size or the forum will not accept it.
The forum also hates pictures with EXIF data.
See the README stickies at the top of the section for help with that and other problems like posting your sketch etc.
It's difficult to recommend a power source when you have told us nothing about the motor you're trying to run.
Generally about 3V more than the motor needs is a good start and AA batteries are better than 9V rectangular 6LR61/PP3 types. 1.2V rechargeable AA batteries are better still because a) they are rechargeable not throw away and b) they can provide more current than ordinary AAs.
Steve
I am using a nine volt motor, how much voltage do I need to power the l298n and motor? And does it really need to be connected to the same ground wire with the arduino uno?
P.S. I will upload a photo tomorrow because it is nightime now in the Philippines
A 9 volt motor means almost nothing without the rest of the specification for it.
Current draw is a very important factor so the exact motor model / spec is really needed.
I was able to get some of the motor specs and details. Here are the details:
Power: 0.63 Watts
Current draw: 70 milliamperes
Voltage: 9
Rpm: 8200
Is this enough details?
The motor looks like this.
The current draw is normally quoted without LOAD on the motor shaft (freewheeling)
You would need to supply slightly more than 9 volts to the driver to achieve a proper 9 volts at the motor as the driver itself consumes some of the voltage
The current would also need to account for any load applied to the motor shaft. ( varies on the application of the motor )
I am sure you will get the hang of posting pictures soon ;D
That link is pooched BTW so I removed the post.
Is it also the same solution for the buffering of the motor. When I start it, it runs good for the first 2 mins, after 2 mins or when resistance is applied, it pulses and moves like a servo motor, what is the solution for this? BTW thanks for the reply
At this point a schematic and the code may also be useful for anyone who may want to help you.
int enA = 5;
int In1 = 7;
int In2 = 8;
int Speed = 210;
void setup() {
// put your setup code here, to run once:
pinMode(enA,OUTPUT);
pinMode(In1,OUTPUT);
pinMode(In2,OUTPUT);
digitalWrite(In1,HIGH);
digitalWrite(In2,LOW);
analogWrite(enA,Speed);
}
void loop() {
// put your main code here, to run repeatedly:
}
Update: I observed how the motor moves when it buffers. It does not move at all. It just goes forward a little bit then back, so it stays in the same location.
I am also planning to change my power supply to double A batteries. Maybe it can work there.
Looking forward to your reply
-Gabriel
I would almost certainly aim any further work at the power supply as 9 volt batteries die very quickly when used with motors.
I tried 18 volts but it has the same result.
Good news is I was able to make the motor run properly. However, when I stop the motor, it needs a jumpstart to run, in other words it needs some force to start.
I am not sure if I need to post another forum for this, so please message me if you're available. :))