This is the English version of
this earlier blogpost.
Also check
this blogpost on how to change the motor into a bipolar model with a lot more torque.


This must be the cheapest stepper motor I know. I guess the reason why it's so popular among hobbyists is simple: its price. I don't know many real steppers cheaper than 20€ and if you find one, you still need to take into account that it usually runs at high currents, so driving the thing with a microcontroller takes some high power circuitry which again is way too expensive for my purposes. I just want to have some fun with small projects where torque and speed are not really main issues. Accuracy is, though!
That's why I bought a whole bunch of
these on AliExpress.com. If you buy larger quantities (which usually is the only option on that site), these babies only cost $2.5 each.

That's even including this small driver board equipped with a ULN2003 chip. That little thing makes driving the motor with an Arduino real easy and
really really really cheap.
I found this
datasheet which is actually describing the 12V version of the motor, but I don't see any difference between the two versions, other than its voltage. I prefer my 5V version though because it gives me the opportunity to use the thing in battery operated projects. There's no need for seperate power sources for the motor and the project that it belongs to. I also found
this wiki page online with a lot of info on the motor.
Using the driverboard on an Arduino is real easy. All you need is four outputs that connect to four of the seven circuits in the ULN2003 chip on the small board. Actually three inputs of the chip remain unused, you could even drive some extra high power things like a power LED or a relay with the board. The inputs are there (inputs 5,6,7) but accessing the outputs might be a bit more tricky.
Now basically, all you should do is switching on the four outputs you defined in your Arduino program one by one. That's what makes the motor turn in on direction. Reversing the order would change its direction. If you repeat these steps about 500 times, then the motor should do
almost one revolution. The word
almost is a bit strange when used in this context, I'll try to clear that up a bit further. All this seems pretty straight forward and of course: it is. Too bad that it doesn't work that way. Ik had to search a bit further, because driving a thing like this (a unipolar stepper motor) can be done in a few different manners, as I found out later.
My gut feeling was not wrong. It just doesn't work on
this motor. This table shows four different ways of driving a unipolar stepper, and the first one is called
wave drive. That's what my initial thougts were, but again: it doesn't work with this motor. I tried it, but most of the time it didn't even start. When it did, there was no torque whatsoever and it made the little thing completely useless.
Half stepping is what it should be according to the manufacturer. That's number three in this table. It's a bit more complicated, but not that big a deal. All you need to do is use 8 steps instead of 4. If you would name the wires A,B,C and D, then the scheme would be the following: first activate wire A, then A and B together, then only B, then B and C together... and so on. So half the time, there's one wire active and the rest of the time there's two wires active. It should give the motor the smoothest movement and that's probably the reason why this is what the datasheet recommends. Well, actually it just says to do it like this. There's no alterative in the sheet. According to this table, there's a better way if you worry about torque, because
half stepping only provides about 70% of the maximum torque available.
If you really want the full potential, try the second option called
Full stepping. Get back to four steps, but this time always put a voltage on two of the four wires. The scheme would be AB, BC, CD an DA. This gives the motor its full torque.
There's a fourth way to drive a stepper motor, that's using
Microstepping. That takes expensive circuitry, so I won't bother about that for this page.
But my first concern was definitely its accuracy and torque. Though moving heavy objects is not really my goal, the worst nightmare when driving stepper motors must be that the thing skips steps due to a heavy load. You probably wouldn't notice this phenomenon at first, but when you want to move an object at an angle of exactly 46,7° in one direction, then this is a major concern. The application that I have in mind for this motor requires this kind of accuracy, and if a part that only costs $2.5 could accomplish that, it would make me one happy camper.
That's why I did the following tests. I made this little Youtube clip which only shows
half stepping. I tried measuring the
real torque of the motor, because the initial tests using this
wave drive method went completely wrong. With
half stepping being the prefered method according to the datasheet, this would be my next approach. I want to know what torque to expect in real life, and equally important: at which speed it can do this. This is the result:
First of all, I measured one piece of important information. Its current is about 120mAmps in
half stepping. Theoretically, that would take it to 160mAmps in
full stepping, but I never measured this.
But again, the major concern was torque and speed. A torque of 300 gcm (0,03 Nm / 4.25 oz inch - nice conversion website
here) can be measured by applying 300g weight on a lever of exactly one cm distance away from the center of the rotor. This is not very convenient in real life, so I tried a lever of 10cm with a weight of 30g attached at the end.
300 gcm was no problem, but when I tried 350, the motor hesitated. It was missing steps, as you can see when it returned and pushed away the whole construction. These tests were done at a a speed of 333pps (pulses per second in some datasheets) or 3ms delay between pulses. At this speed, one revolution takes 12.6 seconds.
I tried to speed things up to 500pps (2ms delay between steps), but then the motor also failed the test. The maximum speed
without any load was 800 pps (1.2 ms delay or 5.0 seconds for one revolution). At higher pulses, the motor just stopped.
I also tried
full stepping when no camera was running, and I found that 380 gcm was its maximum torque at 333 pps (3ms delay). Those numbers produce the absolute max torque this motor can produce (when connected as unipolar with the driver board that's included, check
this blogpost to see how I converted this motor into a bipolar model,
which increased its torque even more dramatically!!). Why
full stepping is not the preferred method is not clear to me, it just says so in the datasheet. I found no downside to this method, the motor does not seem to make more noise or run less fluently than in
half stepping.
The number of steps in one revolution is a bit of a mystery to me. I found different numbers online, but all tests I did resulted in 508 or 509 steps for one revolution. 508 doesn't really make a complete turn, and 509 overshoots the 360° a bit.
The truth no doubt lies somewhere between the two. What bothered me was the fact that it's not an integer value. Probably this is due to the fact that these motors are geared internally. Also, there seem to be a few versions of the motor on the market and not all models seem to have the same gearset inside. I found this
topic that talks about this strange phenomenon.
Another really major problem is the fact that I measured a lack of almost 6° when the motor changes direction. This problem is huge when I need to be as accurate as I mentionned earlier. There's an easy solution though, and I plan to make a manual correction with the software that drives the motor. My plan is to always move the motor in one direction for accurate positioning. If I
do need to move back, I'll overshoot 10° and move back. This keeps the gears always positioned in one exact direction.
I wrote some very simple Arduino code, which you can find
here. Four functions define the two methods
half stepping and
full stepping. You can choose to test one function by uncommenting it in the major loop(). The
half stepping functions are called forwards() and backwards(),
full stepping is accomplished by uncommenting forwardsFull() or backwardsFull(). It may be a good idea to set all outputs back to LOW afterwards (function motorOff()).