Hello all, I am using arduino nano for my project and I try running motors with ln298. The problem is that the motors are not starting to run and I see the onboard led on the arduino flashing every second and clicking noise from the arduino.
The wiring is this: digital pins 2,3,4,5 are used for controling left forward, backward; right forward backward; vin is supplied with 9v and on the same breadboard rail I use ln vin too; gnd is from battery, arduino gnd and ln298 gnd are on the same breadboard rail as the battery supplied gnd.
I am providing a picture of the wiring:
Posting photos of the wiring of a project is almost always a waste of time as it is in this case. Please post a schematic of the wiring. A photo of a pencil and paoer drawing is good enough
As for your code
The easier you make it to read and copy your code the more likely it is that you will get help
Please follow the advice given in the link below when posting code , use code tags and post the code here
If you get errors when compiling please copy them from the IDE using the "Copy error messages" button and paste the clipboard here in code tags
Is that a 9V smoke alarm battery that I see there? Those batteries cannot supply enough current for a motor. Better would be a 6 AA (1.5V) cell pack if you need 9V.
Besides the fact that the ancient and very inefficient L298 is a really crappy motor driver by today's standards. The L298 drops 2 to over 4 Volts of the motor supply as waste heat. Not so good for a battery powered device.
Hello, thank you for the information! I have a nest for 4 1.5V AA batteries and I tested the configuration at first with it and it was behaving well. I have also LIPO batteries(3.7V) and I will connect two of them in series and use the 7.4V from them. As for the driver I do have one pololu driver that I have not used by now not even once. I might try using that. thank you again!
The input voltage for the motor driver can be from 5-35 Volts. So driving it in 9 Volts is okay, but as the other person mentioned the battery is not supplying the needed current. So I changed the battery with 2 Li Po batteries each 3.7 Volts and suming them both I get 7.4 Volts, which is plenty. So everything is okay.