Arduino/L298 schematic

Does anybody know of an Arduino/L298 schematic?

Hi,
I made this a while ago

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.

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.

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

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

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: My first Arduino shield adds 70 outputs can drive LEDs, motors, etc - YouTube. 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.

How does the ENABLE pin connect to Arduino?

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 :smiley:

How does the ENABLE pin connect to Arduino?

A wire to an output pin? ::slight_smile:

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.

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.

My students and I appreciate your assistance. Thank you.

newbie to all this here... trying to build a simple stepper motor pulley system for a camera... based on this guy's setup.... Using the Canon HF100 PAL HD Camcorder: DIY camera motion control

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...

but to which motor wires?

A motor has two wires, connect one of them to Output 1 and the other to Output 2.

how does the motor get power?

Down these wires from the Vin line of the shield.

am i supposed to hook the Motor V+ Supply from the L298N to one of the motor wires?

No

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:

The motor has two coils.

Wire one coil to out 1 and out 2 and the second coil to out 3 and out 4.

Look at the data sheet for the L298.

wow! thanks so much for your replys guys...

you are right, my motor (the one in the diagram i linked to) does have four wires... i am guessing that each pair in the diagram correspond to a direction (?) so i just need to pick one pair (i only need the motor to go in one direction), say, red and green, and connect these to output 1 and 2 ... is this correct?

the controller board you linked to... how would i use that? in between the L298N and the arduino? it says "Connect a 4-wire stepper motor and a microcontroller ", would the microcontroller be the arduino or the L298N? read more on that page... it would be instead of the L298N, seems super easy and made exactly for the purpose...

still seems like people are making it work with the arduino and L298N boards....hmmm...

i am open to all ideas...

again thank you so much for the help...

i am guessing that each pair in the diagram correspond to a direction

No the two coils work together. For an explanation read:-
http://www.thebox.myzen.co.uk/Workshop/Motors_4.html

haha, i've been reading non-stop for the past 48-hours.. someone shoulda told me this stuff was complicated!

yeah, i have since learned about that and realized i was on the wrong track completely but what originally made me think that was the dude who said

"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"

on the previous page... i am confused as to what he meant since he only mentioned two wires (output 1 and 2) to the motor... any idea what he meant? i will be getting a easydriver board soon but would still like to get this working with the L298N

and as always, thanks so much for the help!

.. and for the second Motor:

Output 3 & output 4 to motor 2
Input 3 & 4 & enable B to arduino.

Enable B has to be high for motor to work
If input 3 is high and 4 is low, motor will go one way.
If input 4 is high and 3 is low, motor will go other way.