Go Down

Topic: How to connect L298N Motor Driver Board [SOLVED] (Read 52676 times) previous topic - next topic

Mastino

Dec 24, 2011, 01:06 pm Last Edit: Dec 25, 2011, 10:34 am by Mastino Reason: 1
Hello everybody,
I have ordered this cheap and funny Motor Driver Board and there are no manual or documentation for this board :)



Maybe somebody can tell me how should I connect it to arduino? I want to control 2 DC motors with this board.
There are a lot f inputs like "ENA" "IN1" "IN2" "ENB" and so on.. All so a lot of jumpers CSA, CSB U1 and so on.. You can see it on the photo.
And I really don`t know which inputs to use and which jumpers must be on or off..:(
Also a little code sample or a link to a code would be very helpful:)
Thank you very much for your answers!

CrossRoads

Do you have a link to what you ordered?
Or a reabable picture showing the IC part number?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Mastino

This is the link where have I ordered it : http://www.ebay.com/itm/L298N-Stepper-Motor-Driver-Controller-Board-Arduino-/200659789109?pt=LH_DefaultDomain_0&hash=item2eb8416535
And this is a link: http://www.bristolwatch.com/L298N/L298N_arduino.htm
From a guy who has connected it to a stepper motor, maybe it can help?

Lurch


Mastino

Yes, but still no answer..:( I think it must be connected this way:
On input:
ENA to arduino 3 pin. And if I turn it to HIGH MotorA will be enable.
IN1 to arduino PWM pin. And when this pin will be analogwrite the motorA will turn left.
IN2 to arduino PWM pin. And when this pin will be analogwrite the motorA will turn right.
IN3 to arduino PWM pin. And when this pin will be analogwrite the motorB will turn right.
IN4 to arduino PWM pin. And when this pin will be analogwrite the motorB will turn right.
ENB to arduino 4 pin. And if I turn it to HIGH MotorB will be enable.
What you think?
Only question with this jumpers..For what are they?

Lurch

Looking at the board there isn't much on it. Probably the easiest thing to do would be draw out a schematic of what is going where and then read the datasheet for the L298N and see what the jumpers are meant to be doing.

Mastino

Thank you all for your replays! It is working well! How I told:
ENA - Turns motorA ON and OFF(if HIGH ON).
IN1 - Turn right with PWM motorA.
IN2 - Turn left with PWM motorA.
IN3 - Turn right with PWM motorB.
IN4 - Turn left with PWM motorB.
ENB - Turns motorB ON and OFF(if HIGH ON).

Jumpers do nothing, maybe they do something if you trying to control stepper motor.

xvetox

Not sure if this has been mentioned anywhere else. I couldn't find it on this site so I thought this could help :)

http://blog.pennybuying.com/down/f/F815A.pdf

rlaviles

Thanks xvetox, the link you provided works good to me and the information is acceptable though not perfect.
I have found is not clear what to do with, example, ENA or ENB, say, if you do not need to declare it it your script.
Also, in the PDF you provided, the ARDUINO GND is connected to the L298N board GND. After some experimentation it seems not really needed, however, which is weird to me, if you turn OFF your L298N power supply, the board stills drains from the arduino, this is, if you do not like to see the 'direction leds' ON or worst blinking, seems to be needed to disconnect both the power supply AND the ARDUINO USB from your computer.
I like more the Brian Schmalz Easy and Big Easy Driver behaviour (based in Allegro A4988) though the problem of the absence of a heatsink which means is easy to blow the A4988 device if your stepper demands too much energy! (say, a transient over 2A which is the upper limit ....)
Anyway, thanks a lot.

Tom99

#9
Aug 03, 2013, 01:08 am Last Edit: Aug 03, 2013, 01:57 am by Tom99 Reason: 1
I believe you will find that the ENA & ENB are the step input pins and that IN1 and IN2 determine the direction of the A motor; pins IN3 & IN4 determine the direction of the B motor.

The IN pins seem to be state signals that should be established before a pulse (or a string of pulses) are sent to the ENA or ENB pins.  Also if left unconnected the EN pins are off.  To assure that you might tie an unused EN input to ground.

hth.  I have been looking for more information for stepper motor drivers/controllers.  And it seems surprisingly difficult to get explicit information for these and other driver cards.  Particularly hard to find info for driving bi-polar steppers from these cards.

see my post:
http://forum.arduino.cc/index.php?topic=180804.0

Tom99

mbr6486

https://www.sparkfun.com/products/9815

I hope this can help you. The link above is the link to the Sparkfun Ardumoto shield. It uses the same chip, L298 Hbridge driver, but in a different package. I have personally used the Ardumoto and it is very easy to connect to the Arduino Uno.

https://www.sparkfun.com/datasheets/DevTools/Arduino/Ardumoto_v13.pdf

The next link is the link to the schematic that they have or this board. I think this might be able to help you figure out the connections

magomar

Although this post is a bit old, I think this could be still useful for other people seeking this information.
I have found this link particularly useful to understand how to connect motor drivers based on the L298N
http://www.geekonfire.com/wiki/index.php?title=Dual_H-Bridge_Motor_Driver

Go Up