i have just get out from an old printer a stepper motor and i'm experimenting with it and arduino and easydriver board. the motors has 4 pin and 8 magnets. i can drive it correctly: i run it and change direction. but now i just wondering the best solution to understand when it makes a complete round.

i've done a simple circuit: with a button i get it moving, when i press the button i reset a counter, when the button is pressed the counter is incrementing and then i realease the button the counter is saved. then i print the counter: more or less it is near 1600. this is empiric and for now it works. but: how to find out a precise value?

  • \$\begingroup\$ The datasheet for the motor should say how many steps there are per revolution. \$\endgroup\$
    – NickHalden
    Aug 1, 2012 at 18:22
  • \$\begingroup\$ If you can't find a datasheet, then have it do 1000 revolutions and average your counter to get a more accurate estimate. \$\endgroup\$
    – NickHalden
    Aug 1, 2012 at 18:24
  • 2
    \$\begingroup\$ 1600 sounds like you are at least half- or quarter-stepping (or more!). Are you sure you're making full steps to count? \$\endgroup\$
    – jippie
    Aug 1, 2012 at 19:28
  • \$\begingroup\$ Ah! Here is the answer on the page you link to: It defaults to 8 step microstepping mode. It is indeed in microstepping mode. en.wikipedia.org/wiki/Stepper_motor#Microstepping \$\endgroup\$
    – jippie
    Aug 1, 2012 at 19:38
  • \$\begingroup\$ Keep in mind that if there is sufficient load on the stepper shaft, it will not step at all, and might even jump backwards. \$\endgroup\$
    – Krista K
    Feb 28, 2013 at 18:53

2 Answers 2


Stepper motors usually have a sensible number of steps per revolution, 100, 200, 400 are popular numbers. So my guess would be that 1600 is the precise value for your motor.

The way to check it is simply this:

for (i=0; i<400; i++)

    for (k=0; k<1600; k++)

Watch what happens. If the number is exactly 1600, then you'll simply see the motor rotate 360º 400 times, with a 0.1s pause between each rotation.

If the number was actually 1599, then you'd see the motor pausing at a slightly different place each time. And after 400 revolutions, would end up facing 90º from where it started.

  • \$\begingroup\$ good answer, it is just that your test will take almost 18hrs to complete... \$\endgroup\$
    – jippie
    Aug 1, 2012 at 19:27
  • \$\begingroup\$ @nkint - Fiddle a bit with the MS1 or MS2 pins to ground, check the datasheet ( allegromicro.com/Products/Motor-Driver-And-Interface-ICs/… ) for setting it to full stepping mode. \$\endgroup\$
    – jippie
    Aug 1, 2012 at 19:49
  • 1
    \$\begingroup\$ @jippie, no, it won't. It's pausing every revolution, not every step, so the total pausing would be 40 seconds. Stepper motors aren't the fastest to begin with, so the 400 revs might take a few minutes. But another possibility would be to just have the motor do 100 revs and then stop permanently - with a pointer glued to the shaft and a protractor underneath to measure any error (x100). A few trials of that test would, if the result was repeatable, indicate if the step rate was reliable. But 1600 fractional steps/rev is an extremely likely answer - if it was off, it would be off by a lot. \$\endgroup\$ Aug 1, 2012 at 20:00
  • \$\begingroup\$ @ChrisStratton - you are correct about the pausing, I overlooked that. \$\endgroup\$
    – jippie
    Aug 1, 2012 at 20:02

Motor doesn't have a label? You should find an indication of the step angle (how many degrees the shaft rotates in one full step). Divide 360 by the Step Angle and you get the total steps per revolution.

If there is no label, and you can't find the data sheet for your motor, you can measure the step angle connecting some kind of hand/needle/pointer to the shaft. In almost all stepper motors, you can feel the steps, as the shaft gets "locked" in each step position as you turn it manually. So, use a protractor to read the angular displacement in a single step, and your're done.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.