SparkFun Forums 

Where electronics enthusiasts find answers.

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!
By chickenhawk
#197299
My grandson and myself are having the following problems with controlling 2 dc motors with a Arduino Uno R3 and a L298 with a simple motor sketch.
We followed the instructions for hooking up the L298 and the Arduino and down loaded the motor sketch . This is what happens.
We plug the 9 volt battery into the Arduino and the green led lights up and L1 and L2 flashes on the L298 but the motors don't turn (motors have there own power supply )

If we unplug the 9 volt battery from the Arduino and put the jumper on the 5v_EN then the 5v and L1-L2-L3-L4 on the L298 all light up. But the motors don't turn.

If we plug in the 9 volt battery into the Arduino and put the jumper on 5v_EN the 5v and L1 and L3 led lights up and the motors turns.

I know this can't be right if you have to plug in the Arduino and keep putting the jumper off and on each time.

He spent 3 hours looking on you tube and there some people said that we had to hook up a ground wire from either the Arduino or the L298 but the instructions never said any thing about this.
Can some one give us a helping hand?
By chickenhawk
#197306
Sorry I don't know what board it is. All it says on it is Keyes L298. I gave my grandson my Visa card and he ordered it. I did print the schematic off but I will have to wait until he gets hear to show me how to upload the schematic .
By jremington
#197308
9V block batteries are unable to supply the current required by motors. They are intended for smoke alarms and the like. Use a "wall wart" (AC to DC power adapter) that can supply 9 to 12V at a couple of Amps and connect all the grounds together.

Furthermore, the L298 is pretty ancient technology and cannot handle the current demanded by many motors. Can you post a link to the product page or data sheet for the motors?
By chickenhawk
#197309
Sorry I'm bad, I had thought of that and did try it with 6 AA batterys. but again we had the same result. But the motors did turn when we put the 5v_EN jumper on.

Are you saying to put a jumper from ground on the Arduino and a jumper from the ground on the L298 to the ground where the batterys that go to the L298 go?
By paulvha
#197311
I am a bit confused about the connections.

The 9V on the Arduino is completely separate to the 9V on the Keyes L298. (looking at the PNG and schematic)

The Arduino needs power to run and so does the Keyes L298. Following your png, you have to put 9V battery for the Arduino or an AC/DC adapter that provides the working voltage. That power is used for the Arduino.

The Keyes L298 needs it's own power source and has 2 options:

That can be 5V, taken from the Arduino, and then connecting that on the 5V on the blue connector and a GND connection from the Arduino to the GND connection on Keyes. In this case however it is advised that you remove the 5V_EN jumper to prevent the 7805 regular to die (as it will get reversed voltage) This can also be used if you source the 5V from another source (e.g. a AC/DC 5V adapter)

OR

You provide a higher voltage between the VMS and GND (like you can do with a battery). That VMS voltage is then regulated DOWN to 5V by the 7805 on Keyes board and as such you must have to leave the 5v_EN jumper in.

In both cases however, you MUST have a wire between GND on the Keyes and GND on the Arduino otherwise the Keyes L298 will NOT be able to read/ understand the "in-pins" value. it's a value is compared to GND, and both (Arduino and Keyes) need to have the same understanding of GND.

So the PNG you provided is in error. It MUST ALWAYS have GND from the Arduino connected to the GND on KEYES.

regards,
Paul
By chickenhawk
#197313
Yes I see what you are saying, and understand what you mean. But now we have to put it on hold for a bit. We had a small opps. My grandson ran a jumper from the 5v from the Arduino and instead of going to the blue 5 volt on the L298 he put it on the blue " + " from the large battery pack. A puff of smoke and no more Arduino. I will order him a new one right away and we will start again. He can for the time being study his Sparkfun Inventor's kit.
In the the mean time many many thanks.
By rcwilcox
#197315
chickenhawk wrote: Sun Dec 24, 2017 12:03 pm Yes I see what you are saying, and understand what you mean. But now we have to put it on hold for a bit. We had a small opps. My grandson ran a jumper from the 5v from the Arduino and instead of going to the blue 5 volt on the L298 he put it on the blue " + " from the large battery pack. A puff of smoke and no more Arduino. I will order him a new one right away and we will start again. He can for the time being study his Sparkfun Inventor's kit.
In the the mean time many many thanks.
Where did the puff come from? I believe there is a thermal fuse on the Arduino and the puff may have some insulation or the reverse voltage diode. If you fried the CPU chip and it is socketed and they are cheap to replace but that won't help if you fried the regulator/power distribution circuity.