I have a large bipolar stepper motor. What's the simplest circuit to drive it with a microcontroller (arduino)?


I have a large stepper motor with 4 wires (bipolar) from an old printer and I assume it's 12 volts, or at least higher than 5v. I have plenty of transistors: 2n3904, 2n2222, 2n4401 and 2n3906 (PNP). How do I drive the stepper with output from an arduino? (simple H-bridge schematic?)

Also, how can i find how many steps it has?

Thanks!

sort by: active | newest | oldest
Bot13985 years ago
Here is a nice tutorial on how to drive a bipolar stepper and here is the stepper Library for the arduino!.
rickharris7 years ago
Picaxe is a BASIC operating system and much easier to experiment with then Arduino IMHO unless your a C expert. It's cheaper as well.

There are also specific commands for driving stepper motors - Have a look at their free on line manuals at http://www.picaxe.com

Unless you need a great deal of speed from the micro.

There are also dedicated stepper driver boards out there.

Vick Jr (author)  rickharris7 years ago
I might eventually get a picax, but since I already have an ardiuino, I'll use that for now. I'm pretty good at java, c++ and c, so programming is no problem. Arduino also has libraries for stepper motors, and I've gotten it to work with a very small bipolar stepper, but I need a circuit to use an external power supply so I can use a bigger stepper.

Would some sort of duel H-Bridge work. Something like this or this without the IC at the bottom?
extrernal power is a good idea, though it will have to share a common ground with your arduino, I find that unless you do this, it won't work properly, or won't work at all.
Why not look for an L239D as I said they are pretty cheap and designed to do the job?
The L293B put's out 40% + current then the L293D, but doesn't have the internal rectifiers... so you have to place them!

The circuit is pretty simple, I'm working on this one right now:
https://www.instructables.com/id/Arduino-Dual-L293B-Motor-Drive-Shield-work-in-pro/

I wan't to put 2 full circuits on the same shield, to be able to drive 2 steppers (unipolar or bipolar) at same time.

This circuit will work with the SN754410 as a direct substitute, I'm not sure about the diferences between the ICs but they're 100% compatible (pin and logic).

Apparently the L298N can also be used as a direct substitute for the L293B on this setup. The L298N handles 2x more current (3A per channel) and have a wider working voltage range (up to 50V).
fonyat fonyat7 years ago
One more thing... after lot's of research on making my own h-bridge with cheap, discrete components, I finnaly came up to the conclusion that the IC would be the best choice...
...as stated many times on other replies! hehehe
The circuit is even more simple with the IC, and I say that as an absolute begginer with electronics.
Vick Jr (author)  rickharris7 years ago
There's so many of them!

And I don't think Radioshack has anything like this. : (
I think you may as well learn C as learn any language. I do eveephe ascerything in Delphi, Freepascal, or many other flavours of Pascal, for embedded systems (and one for the atmega), but I found writing on the arduino to be very simple , and the code very fast. And its not proprietary. BAsic should be given a decent burial now.
yaly6 years ago
you can use uln2003 between the motor and the arduino and control it from the serial monitor and you compose the code or if you can find any online.
maewert7 years ago
If you wish to construct your own H bridge, This figure appears to have all the usual features: http://www.circuitstoday.com/wp-content/uploads/2008/04/stepper-motor-control-circuit.JPG

(I noted that  H-bridge links you quoted to rickharris do not have diodes to bleed off the back EMF from the steppers.  They do show caps across the leads though...  I am not sure the circuit you quoted is good or not, others may chime in with their thoughts.)

If you are pulling in a lot of current, you must provide good heat sinks to the transistors and possibly a fan to keep them cool.

You should be able to use a variable power supply and manually step the motor by applying first 5v to a wire pair and rotating the motor with your fingers.  If it turns rather easily, step up the voltage until the motor is harder to turn.  How hard depends on your application.  Start at smaller voltage and work up.  Measure the current to get an idea of how much power the motor requires both when stopped and when you turn manually against it.  I have driven 5v stepper motors with 12v to get faster response/more power from them with no apparent ill effects.

As others have noted Stepper motor controllers are available and are relatively inexpensive.  If you use one be sure to match its power capability to the motor you are driving.

To determine the step size, you can temporarily attach a protractor to the shaft being sure that the center of the protractor is mounted to the center of the shaft and apply power to one of the coils using a lower voltage than normal (just to make moving the shaft easier).  Manually rotate the shaft to the next stopping point.  With one coil energized the motor should 'lock' into position every fourth step.  You can then determine the step size by reading how many degrees are swept between stopping positions.  The most common stepper has 200 steps per revolution which sweeps out 1.8 degrees per step.  With my method above the motor should sweep 7.2 degrees per stopping position.

Best wishes.
Depends on how good you are with circuits, you certainly CAN make an H bridge, but a 293 is cheaper.
rickharris7 years ago
Grab an L293 its a dual Hbridge. Data sheet will show how to drive it although I would use a Picaxe unless you need the faster speed

http://www.picaxe.com

Vick Jr (author)  rickharris7 years ago
I found a LB1641 - Bidirectional Motor Driver if that helps.

Why do you suggest PICAX?

Is there any practical way to do this without buying an IC H-Bridge chip?