Unipolar not working with stepper library

I have hooked up a unipolar stepper motor according to this article- http://arduino.cc/en/Tutorial/StepperUnipolar - and it works just fine with both example sketches but produces erratic results with the stepper library. Mostly just twitching back and forth.
Could someone tell me what the problem might be.

Currently you are the best placed person to answer as only you know any
details of the setup - care to share some details - motor, power supply, wiring,
code...?

Here it would be handy to see both the working example and the failing one...

Sorry for the lack of detail. The motor I'm using is a Mitsumi M42SP-7N unipolar. I set it up exactly as the schematic in the preceding link. It was when I tried with the stepper examples included with the Arduino IDE that I got poor results. Should the stepper examples work or does it require a different shield or something?

Try swapping the motor leads in various combinations. Only a few out of the many possibilities will be useful. However, do not disconnect any motor lead while the power is on, or you could destroy the driver.

I have tried several different combinations of motor lead hook up. I tried reverse engineering the pinout with an ohmmeter. I found the center tap (, this is a 5-wire motor,) but every other combination I tried resulted in twice the rated resistance. i.e. no open circuit between any combination of wires.

The rated resistance should appear only between the center tap and each of the other four wires. All other connections should yield twice that resistance, which is what you observe. There are two versions of this motor, so what is that resistance?

I hope you are well aware that the regulated 5V output of an Arduino cannot be expected to power a typical stepping motor, which is what the tutorial you linked seems to (extremely unwisely) assume.

Thanks for the response.

The stepper I'm using is rated at 40 ohms. I have a separate 12v supply hooked up to the motor and I'm using a uln2003a, actually more like this - http://arduino.cc/en/Reference/StepperUnipolarCircuit -. As I understood it there are two separate windings so I should get open circuit readings between some of the wires.

In a five-wire motor the fifth wire is connected to the center tap of both windings.
So far, you aren't being very helpful about supplying needed details. Your latest link points to two circuits. Which did you use?

To go back to your first post, you say it works fine with the simple examples. So why bother with the stepper library?

I tried my setup with a six wire stepper and it worked fine with the stepper library. This new stepper also checked out as I would expect with an ohmmeter. I can only conclude that the Mitsumi M42SP-7N is wired up in a non-standard form. The datasheet unfortunately does not have much info.

There are 24 ways to wire 4 wires, only 8 ways will work (4 for each direction).

If you leave the same wire on the first output, then there are only 6 possibilities so
you have a smaller search (2 combinations will work, 4 won't).

Check the winding resistances (no broken windings), check each ULN2003 output
is actually working and correctly sequenced with LEDs/resistors, then be methodical.

Thanks for the suggestions. I have used the same circuit with two other unipolar stepper motors with out issue.

Here’s the issue. I have two identical Mitsumi M42SP-7N steppers. They are 5-wire steppers which the limited data sheet says are unipolar. I have determined the red wire to be a common center tap because the rated resistance is seen between it and each of the other four wires. Now the part I don’t understand is that if I measure the resistance between one non center tap wire and each of the other three non center tap wires I get the same reading, i.e. double the rated resistance. According to what I’ve seen I should get one reading at twice the rated resistance and two open circuit readings. I would like to use these two steppers in a project because they are a) identical and b) come mounted with an ideal pulley and gear system.
If push comes to shove I’ll just use different steppers, but I feel as though I might be missing something obvious here.

Thanks for any input.

Yes, you are missing something obvious. The rated winding resistance for a unipolar motor is from the center tap to one end. Between two ends, the resistance is twice that.

In a five wire motor, one wire is the center tap for BOTH windings. So you should see twice the rated resistance between ANY two ends, and no open circuits.

Yes that is embarrassingly obvious, I don't know how I got sidetracked. Thanks for your patience.