
How Stepper Motors Work: Steps, Coils, and Microstepping
A stepper motor turns in fixed steps instead of spinning freely. A standard NEMA 17 motor has a step angle of 1.8 degrees, so it takes exactly 200 steps to turn one full revolution. Each pulse from the driver moves the rotor one step, so counting pulses tells you exactly how far the shaft has turned, with no encoder.
How stepper motors work: what is a stepper motor?
A stepper motor is a brushless DC motor that divides a full rotation into a fixed number of equal steps. Inside the motor, a stator carries coil windings and a rotor carries a permanent magnet or a toothed iron assembly. When current flows through a pair of stator coils, the magnetic field pulls the rotor into line with the energised coils. When the driver energises the next pair of coils in sequence, the rotor moves one step further round. Keep the coils energised and the motor holds its position firmly, with no brake needed.
A standard NEMA 17 motor has 50 rotor teeth and 4 magnetic field orientations from its two phases, which gives 50 times 4, or 200 steps per revolution. Divide 360 degrees by 200 steps and the step angle is 1.8 degrees. A 0.9 degree motor has 400 steps per revolution and gives finer resolution at the cost of less torque per step.
NEMA 17 describes the mounting face, not the motor performance. NEMA 17 means a 1.7 inch square face, or 42.3 mm square. Two NEMA 17 motors can have very different lengths, torques and currents. Always read the current rating and the holding torque of your exact motor, not just the NEMA size.
How does a stepper differ from a DC motor and a servo?
A DC motor spins freely when power is applied, and its speed depends on voltage and load. It has no built in position, so a robot that needs to know how far a wheel turned must add an encoder. A servo moves to a commanded angle and holds it with a closed loop, but its range is usually limited to 180 degrees. A stepper moves in fixed steps over unlimited rotations, and the step count is the position, so it needs no encoder for open loop positioning.
| Spec (unit) | DC motor | Servo | Stepper motor |
|---|---|---|---|
| Motion | Continuous rotation | Limited angle, usually 180 degrees | Fixed steps, unlimited rotation |
| Position feedback | None, add encoder | Built in potentiometer | None, step count is position |
| Typical control | PWM duty for speed | PWM pulse width for angle | STEP pulses for distance |
| Holding torque at rest | None without power | Holds angle under load | Holds position with coils energised |
| Best for | Wheels, fans, pumps | Steering, arms, pan tilt | 3D printers, CNC, precise positioning |
The trade off is speed and efficiency. A stepper draws full current even when it holds still, so it runs hotter and uses more power than a DC motor at rest. A stepper also loses steps when the load exceeds its torque, and because there is no feedback, the controller never knows the steps were lost. Size the motor and the driver for the load with margin, and never trust a stepper position after a stall.
What are unipolar and bipolar steppers?
A unipolar stepper has four coils with centre taps, and it is driven by energising one half of each coil at a time. It has five or six wires, and it is simple to drive with a transistor array such as the ULN2003. The 28BYJ-48 is the common unipolar example: a small 5 V geared stepper with a ULN2003 driver board. Unipolar drive is simple, but it uses only half of each coil at a time, so it gives less torque per size than a bipolar motor.
A bipolar stepper has two coils and four wires, with no centre taps. It is driven by an H-bridge that reverses the current through the full coil, which gives 30 to 40 percent more torque than a unipolar motor of the same size. The NEMA 17 is the common bipolar example, and it needs a bipolar driver such as the A4988 or the TMC2208. Bipolar drive is more complex, but it is the standard for 3D printers and CNC machines, where torque matters.
Identify your motor by its wire count before you buy a driver. Five or six wires means unipolar, and a ULN2003 board is the pick. Four wires means bipolar, and an A4988 board is the pick. A four wire motor on a ULN2003 board does not work, and a five wire motor on an A4988 board does not work either.
How does microstepping work?
Microstepping divides each full step into smaller increments by driving the two coils with different currents at the same time. Instead of switching one coil fully on and the other fully off, the driver sets the two coil currents to intermediate values that hold the rotor between two full step positions. The A4988 supports five resolutions, set by its MS1, MS2 and MS3 pins: full step, 1/2 step, 1/4 step, 1/8 step and 1/16 step.
| MS1 | MS2 | MS3 | Resolution | Steps per revolution (count) |
|---|---|---|---|---|
| LOW | LOW | LOW | Full step | 200 |
| HIGH | LOW | LOW | 1/2 step | 400 |
| LOW | HIGH | LOW | 1/4 step | 800 |
| HIGH | HIGH | LOW | 1/8 step | 1600 |
| HIGH | HIGH | HIGH | 1/16 step | 3200 |
Microstepping makes motion smoother and quieter, and it reduces resonance at low speeds. It does not increase accuracy by the same factor as the step count, because the intermediate positions depend on the exact coil currents and the load. A 1/16 microstep is finer than a full step, but the holding torque at a microstep is lower than at a full step, and the rotor position at a microstep is less exact under load. Use microstepping for smooth motion, not for a promise of 16 times the precision.
How does the 28BYJ-48 work?
The 28BYJ-48 is a geared unipolar stepper. The inner motor takes 32 full steps per turn, at 11.25 degrees per full step, and a gear train of about 64:1 sits behind it, so the output shaft needs about 2,048 steps for one full turn, from 32 times 64. The datasheet ratio is 64:1, so 2,048 is the nominal figure. Teardown counts of the gear teeth give an exact ratio of 63.68395:1, or 283712/4455, on the units counted, which works out to 2037.9 full steps, or 4075.8 half steps, per output turn. The ratio varies by manufacturer, and some units are a true 64:1, so use 2,048 as the nominal value. Over many turns, the small error adds up, so do not use the 28BYJ-48 for long distance odometry without a home sensor.
The 28BYJ-48 runs on 5 V and it is easy to drive with its ULN2003 board, which takes four logic inputs, IN1 to IN4, from the microcontroller. It is slow, under about 15 RPM, and light on torque, but it is ideal for learning, for clocks, for curtain pullers and for a pan tilt head that moves slowly. The standard Arduino Stepper library drives it with 2,048 steps per revolution, and the pin order matters: the sequence 8, 10, 9, 11 is correct for the common wiring, and 8, 9, 10, 11 makes the motor twitch instead of turning.
How does the A4988 driver work?
The A4988, datasheet 4988-DS Rev. 8, April 5, 2022, is a microstepping driver IC from Allegro MicroSystems for bipolar steppers. It drives motors at up to 2 A per coil with proper cooling, and it supports up to 1/16 microstepping. From the microcontroller it needs only two signal pins: STEP, where one pulse advances the motor one microstep, and DIR, where high or low selects the direction. The EN pin enables or disables the driver, and the MS1 to MS3 pins set the microstep resolution.
Setting the current limit correctly is the most important A4988 job. The driver has a small potentiometer that sets Vref, and the current limit follows the formula Vref equals current times 8 times Rsense. Set Vref to about 80 percent of your motor rated current, fit the heatsink, and never power the board with the motor disconnected, because the driver can fail permanently. The motor supply, VMOT, runs from 8 V to 35 V, and a 100 uF capacitor across VMOT close to the board absorbs current spikes.
The A4988 is the standard driver for a NEMA 17 in a 3D printer or a CNC axis. The TMC2208 is the quieter successor, with StealthChop silent operation, but the A4988 is cheaper and its current setting procedure is the one every tutorial covers.
How do you pick a stepper for a project?
| Project type | Pick this motor | Why |
|---|---|---|
| Learning, slow pan tilt, clock | 28BYJ-48 plus ULN2003 | 5 V, simple wiring, cheap, 2,048 steps per turn |
| 3D printer axis, CNC axis | NEMA 17 plus A4988 | 200 steps per turn, 1/16 microstepping, high holding torque |
| Quiet printer axis | NEMA 17 plus TMC2208 | StealthChop silent stepping, same 200 step motor |
| Precise positioning, no feedback | NEMA 17, 0.9 degree version | 400 steps per turn, finer resolution than 1.8 degree |
For the drivers behind the motor signals, see L298N vs TB6612 vs DRV8833: Which Motor Driver for Your Robot.
FAQ
How many steps does a NEMA 17 take per revolution?
200 steps at full step, because its step angle is 1.8 degrees and 360 divided by 1.8 is 200. At 1/16 microstepping, it takes 3,200 microsteps per revolution.
Why does my stepper lose steps?
The load exceeds the motor torque, the speed is too high for the torque curve, or the driver current limit is set too low. Reduce the speed, raise the current limit within the motor rating, or use a larger motor.
Can I drive a stepper directly from a GPIO pin?
No. A stepper coil draws far more current than a GPIO pin supplies. Always use a driver board, such as a ULN2003 for a unipolar motor or an A4988 for a bipolar motor, between the pins and the motor.
Does microstepping increase torque?
No. Microstepping makes motion smoother and quieter, but the holding torque at a microstep is lower than at a full step. Use it for smooth motion, not for more torque.
What is the difference between unipolar and bipolar?
A unipolar motor has centre tapped coils and five or six wires, and it is driven by a ULN2003. A bipolar motor has two coils and four wires, and it is driven by an H-bridge such as the A4988. Bipolar gives more torque per size.
Parts used
28BYJ-48 Stepper Motor 5V plus ULN2003 Driver, 2-Set: the geared unipolar stepper for learning and slow positioning. A4988 Stepper Motor Driver: the bipolar microstepping driver for NEMA 17 motors. Nema 17 Stepper Motor: the bipolar stepper for 3D printer and CNC axes.
Sources
- Allegro A4988 DMOS Microstepping Driver datasheet, 4988-DS Rev. 8, April 5, 2022
- 28BYJ-48 gear tooth count, 283712/4455, 63.68395:1
- 28BYJ-48 vs A4988 guide, 2,048 step math, A4988 current limit formula
- NEMA 17 and A4988 tutorial, 200 steps per revolution, microstepping table
- Stepper motor basics, 200 steps per revolution, STEP and DIR control
Last updated: 2026-11-21. Search volume: not verified. Product links use the store short link form with the product ID; confirm the product slug at publish time.
