User avatar
Bigcat123
Posts: 230
Joined: Thu Aug 23, 2012 2:41 pm

HELP... L298 module problems.

Thu Sep 06, 2012 4:09 pm

Yes I know that this has been posted before but I need slightly more detailed instructions and noob terms! :)

Ok... I would like to control 1 DC 6V motor with my Pi and so have purchased an L298 module from eBay. Here it is:

http://www.ebay.co.uk/itm/Dual-H-Bridge ... 6226wt_932

All the connections look quite foreign to me! How do I go about wiring it up? Do I use a screwdriver? Programming it in Python(RPI.GPIO) should be pretty simple and so I probably don't need code help!

REALLY CONFUSED!

Thanks in advance! And sorry for my noobness! :) :) :)
Just a beginner sharing his experiences on his way to geek nirvana...

rugebiker
Posts: 12
Joined: Thu Sep 06, 2012 8:19 pm

Re: HELP... L298 module problems.

Thu Sep 06, 2012 8:27 pm

Go to page 6 of this datasheet http://www.sparkfun.com/datasheets/Robo ... Bridge.pdf and there it is how to connect it ;)

User avatar
Bigcat123
Posts: 230
Joined: Thu Aug 23, 2012 2:41 pm

Re: HELP... L298 module problems.

Thu Sep 06, 2012 8:36 pm

Anybody?

Sorry for my eagerness!
Just a beginner sharing his experiences on his way to geek nirvana...

User avatar
Bigcat123
Posts: 230
Joined: Thu Aug 23, 2012 2:41 pm

Re: HELP... L298 module problems.

Fri Sep 07, 2012 6:58 am

Thanks for answering!

However I still think that you have not answered my question. This is because I still have no idea HOW to connect any wires to the module. I know where they go just not how to attach them! :)

Could somebody who has used the board please help me?

P.S: I am using a MODULE not the chip on its on

:) :) :)
Just a beginner sharing his experiences on his way to geek nirvana...

Ravenous
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK

Re: HELP... L298 module problems.

Fri Sep 07, 2012 8:32 am

Working right now :) will have alook in a few hours, keep your hair on :)

Ravenous
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK

Re: HELP... L298 module problems.

Fri Sep 07, 2012 11:08 am

Hang on, your only question is how do you physically make the connections?

The screw terminals are easy (if fiddly) - just poke reasonably think wires into the sides & tighten the screw at the top. But you need to make sure the little metal tab underneath is pushed in so you can get the wires in, especially after reusing the connection a few times.

The Enable & Input connections - dunno what you need for these, I suggest you try and get something similar to whatever you'll be connecting to the GPIO pins on the raspi itself. (I assume these are just standard thickness pins?)

Good luck and try not to free the magic blue smoke...

User avatar
Bigcat123
Posts: 230
Joined: Thu Aug 23, 2012 2:41 pm

Re: HELP... L298 module problems.

Fri Sep 07, 2012 5:12 pm

OK... I have wired up the screw terminals with what I think is the correct wiring...

But now my problem is how the hell do you connect anything to ENA and ENB????

They are foreign connectors...

I have never ever seen anything like them!

Does anybody know how to connect a wire or jumper wire to them???

Thanks for all the help! :) :) :)
Just a beginner sharing his experiences on his way to geek nirvana...

User avatar
joan
Posts: 14348
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: HELP... L298 module problems.

Fri Sep 07, 2012 5:28 pm

Weren't they jumpered to be always on? If so the motor forward/reverse/stop should work without touching those pins. The motor will run full speed. Why not try that first.

To wire up to them just remove the jumpers (small pair of pliers or fingers and the jumpers should just pull off/push back on as needed).

Jumpers on: the motors will be full speed.
Jumpers off: the motors will vary speed according to the PWM input.

User avatar
Bigcat123
Posts: 230
Joined: Thu Aug 23, 2012 2:41 pm

Re: HELP... L298 module problems.

Fri Sep 07, 2012 6:05 pm

Fixed that bit now.... THANKS.

Now next problem!

I have wired the chip up to the Pi's +5v GPIO pin and it's ground pin.... My motor requires 6v and I am using a 4 AA battery pack to give it that power... But I still have no idea how to connect the battery pack! Do I connect it to the module? Or do I use the board as a giant transistor? Also does the GPIO python program have to be anything special?At current mine is something like this:

import RPi.GPIO as gpio
import time

#This is because I only want to spin the motor one way for now
gpio.setmode(gpio.BCM)
gpio.setup(4.gpio.OUT)

while true:
gpio.output(4, gpio.HIGH)
time.sleep(1)
gpio.output(4, gpio.LOW)
time.sleep(1)

Please tel me what I am doing wrong!!! Thanks for your amazing patience!
Just a beginner sharing his experiences on his way to geek nirvana...

User avatar
Bigcat123
Posts: 230
Joined: Thu Aug 23, 2012 2:41 pm

Re: HELP... L298 module problems.

Fri Sep 07, 2012 6:06 pm

Indentation in the program is correct by the way!
Just a beginner sharing his experiences on his way to geek nirvana...

User avatar
joan
Posts: 14348
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: HELP... L298 module problems.

Fri Sep 07, 2012 6:27 pm

I'd bung the battery positive in the +12V slot, -ve into the ground slot on the module.

I assume you've put the Pi 5V into the +5V slot and the Pi ground into the same ground used for the battery.

kevcook
Posts: 17
Joined: Sat Jan 19, 2013 5:57 pm

Re: HELP... L298 module problems.

Sun Feb 24, 2013 2:17 pm

How did you get on with this? If you did can you send me the wiring setup for the Pi? perhaps on this board or via my e-mail?
[email protected]

Kevin

idem
Posts: 12
Joined: Mon Feb 18, 2013 3:23 pm

Re: HELP... L298 module problems.

Tue May 14, 2013 12:30 am

Hi all,

do you have more info?
I want to use the same board, is the code correct and work?

kevcook
Posts: 17
Joined: Sat Jan 19, 2013 5:57 pm

Re: HELP... L298 module problems.

Tue May 14, 2013 11:17 am

Hi,

Check out my web-site under scutter2 image page and you'll see the module in situ running two motors. The earth is shared. This image shows further details. http://www.terraphotography.co.uk/scutter.html
The four central pins are for GPIO for left fwd, left rev, and right fwd and right rev. The back two are power in 5v and the two side sets are for power to the two motors.

Hope this helps. Have a look at the video. http://www.youtube.com/watch?v=uNy1SyJnm7s
Kevin.

WWW.terraphotography.co.uk for full scutter review and pics.

Return to “Automation, sensing and robotics”