The previous exercise showed how use a commercial unipolar stepper motor on the PIC. But now we're going to get our hands dirty by resuscitating a surplus unit, and work it at the most basic level.
I picked up the one you see in the photo from All Electronics; it cost a dollar. You can probably tell that this is a major duty unit; it weighs a ton. This suggests that it is definitely hungry for current, and it is. I decided to use the ULN2003A Darlington array to drive it. With the stepper's 5 ohm coils, this is borderline, but okay for the demo. If I were constructing this to do some actual work, I'd probably go with power MOSFETs and heatsinks, or else choose a different stepper. During the demo, the ULN2003A definitely ran hot.
Here's the circuit. You might notice how two of the Darlingtons are used as inverters (pins 6/11, 7/10).
The PMP code is simple. Some nested loops take care of stepping the thing along in increments of 7.5 degrees of rotation. XOR commands created the needed bit patterns easily. Here's what it looks like in operation:
Click to get the source code.
Click to get the schematic PDF.
Next Project: Bipolar Stepper Motor