Go Down

Topic: Arduino/L298 schematic (Read 12 times) previous topic - next topic

frankcalzia

Does anybody know of an Arduino/L298 schematic?  

airman00

#1
Mar 03, 2009, 02:00 am Last Edit: Mar 03, 2009, 02:00 am by airman00 Reason: 1
Hi,
I made this a while ago

http://bp0.blogger.com/_DLeG8x1l9dw/R__OZ0Pg0RI/AAAAAAAAAEA/jHWmi9gPqm0/s1600-h/L298.jpg
Check out the Roboduino Arduino-compatible board!


frankcalzia

Your schematic is the most detailed I have seen after endless hours of searching but I am still at a loss deciding which pins go where,  specifically, the IN and ENABLE pins.  How do these connect to Arduino? Thanks for the help.  

frankcalzia

Your schematic is the most detailed I have seen after endless hours of searching but I am still at a loss deciding which pins go where,  specifically, the IN and ENABLE pins.  How do these connect to Arduino? Thanks for the help.

darudude

l298 allows you to control 2 motors.

So for Motor 1:

Output 1 & output 2 to motor
Input 1 & 2 & enable A to arduino.

Enable A has to be high for motor to work
If input 1 is high and 2 is low, motor will go one way.
If input 2 is high and 1 is low, motor will go other way.

hope this help

frankcalzia

I forgot to mention that the motor is a unipolar stepper. Does this change the pin configuration?  

vxir

The L298 drives bipolar stepper motors.  Luckily, a 6+ wire unipolar stepper motor can be wired bipolar and in fact may be "better" to do so because you get more torque.  I'm doing here in this video: http://www.youtube.com/watch?v=E0D8hDt2M60.  The video is actually about my first Arduino shield so you'll have to fast-forward to the end to see the motor go.

This is how you wire it:

1. Measure the resistance across the 6 wires.  You should find 2 pairs of 3 wires that are connected together.
2. Within each group of 3 wires, measure the resistance.  You should find that 1 pair has twice the resistance as the other 2 pairs.  This "pair" is going through BOTH coils, so those are what you want to connect to 2 of the the L298 output pins.

I have a L298 driver C code if you want it.





frankcalzia

How does the ENABLE pin connect to Arduino?

agent smith

I'm using a L298 too but with a normal brushed motor.
just put it in a digital pin, then you made a digital write HIGH or LOW if you want to turn the motor on or off.
I wonder if you could put two diodes that run from the input pins to the enable pin and then save a pin on the arduino.
It's assumed that if you have at least one of the input pins high, it means that you want the motor running :D

Grumpy_Mike

Quote
How does the ENABLE pin connect to Arduino?


A wire to an output pin?  ::)

When high the chip is enabled, that is it outputs a high or low, when low it is disabled, the outputs of the chip are high impedance.

vxir

Yes, just connect it to a digital output.  The enable pin lets current flow though that H bridge (there are actually 2 enable pins).  For DC motors this would be how the motor is stopped.

For stepper motors, shutting off the power removes the torque caused by the electromagnets in the stepper motor, so essentially, it makes the shaft easier to turn by hand.  So in english, if you want to "apply the brakes" on a stepper motor, keep enable on and set the output of both H-bridges to be the same.  If you want to "coast to a stop", de-assert the "enable" pins.  Personally, I never want to coast, so I just tie the enable pins high.


frankcalzia

My students and I appreciate your assistance.  Thank you.

brianhockenstein

newbie to all this here... trying to build a simple stepper motor pulley system for a camera... based on this guy's setup....  canon-hf100.blogspot.com/2009/07/diy-camera-motion-control_09.html

anyways, not sure how i ended up at this point but right now, i am working with an Ardunio Nano, an L298N IC chip and a 12v stepper motor (sparkfun.com/datasheets/Robotics/SM-42BYG011-25.pdf )

what i am confused about is which wires to connect on the motor side... you say Output 1 & output 2 to motor but to which motor wires? also, how does the motor get power? am i supposed to hook the Motor V+ Supply from the L298N to one of the motor wires?

thanks in advance for all your help...

Grumpy_Mike

Quote
but to which motor wires?

A motor has two wires,  connect one of them to Output 1 and the other to Output 2.
Quote
how does the motor get power?

Down these wires from the Vin line of the shield.  
Quote
am i supposed to hook the Motor V+ Supply from the L298N to one of the motor wires?

No

PaulS

If you have a stepper motor, it has more than two wires. It will have 4, 5, or 6, depending on the type of stepper motor it is. The one in the pdf file you posted is a 4 wire.

I suspect you're going to want to spring for one of these:
http://www.sparkfun.com/commerce/product_info.php?products_id=9402


Go Up