A stepper motor is a brushless DC electric motor that divides a full rotation into a precise number of equal steps. Unlike standard DC motors that spin continuously when voltage is applied, a stepper motor moves in discrete increments—typically 200 steps per revolution, yielding 1.8 degrees per step. This inherent positional accuracy makes it the default choice for open-loop motion control in 3D printers, CNC routers, and robotics.
The Direct Answer: What Is a Stepper Motor and How Does It Work?
Inside a stepper motor, the stator (the stationary outer part) contains multiple electromagnetic coils arranged in phases, while the rotor (the rotating center) features a toothed iron core or permanent magnets. When the controller energizes the stator coils in a specific sequence, the magnetic field pulls the rotor teeth into alignment, causing the shaft to "step" forward.
According to All About Circuits, the most common variant in maker spaces is the bipolar permanent magnet stepper, usually built to the NEMA 17 frame standard (1.7 x 1.7 inches faceplate). By manipulating the current sine waves through the coils, modern drivers can subdivide these physical steps into "microsteps" (e.g., 1/16th or 1/256th of a step), yielding thousands of microsteps per revolution for exceptionally smooth motion.
Stepper vs. Servo vs. DC: Which Motor Fits Your Load Profile?
A common mistake in embedded projects is treating steppers and servos as interchangeable. They are fundamentally different architectures with distinct failure modes and torque profiles. Steppers run open-loop (no position feedback) and excel at low-speed, high-precision holding. Servos run closed-loop (using encoders) and excel at high-speed, high-torque dynamic movements.
| Motor Type | Torque Curve Profile | Control & Feedback Needs | Typical Cost (2026) | Best Load Profile |
|---|---|---|---|---|
| Stepper (Bipolar) | Maximum torque at zero speed (holding); drops sharply as RPM increases. | Open-loop step/direction pulses. No encoder required. | $12 - $25 (NEMA 17) | Low-speed precision positioning, Z-axis lifts, extruders, camera sliders. |
| AC/DC Servo | Constant torque across a wide speed range; peaks at high RPM. | Closed-loop. Requires encoder feedback and complex PID tuning. | $80 - $300+ | High-speed pick-and-place, robotic arms, dynamic conveyors. |
| Brushed DC | Linear torque drop-off from stall torque to no-load speed. | Simple voltage control. Requires external limit switches for positioning. | $3 - $10 | Continuous rotation where exact position is irrelevant (fans, drive wheels). |
Wiring Identification and Driver Selection
Most NEMA 17 steppers used with microcontrollers are 4-wire bipolar motors. Identifying the coil pairs is mandatory before wiring to a driver; crossing the phases will result in violent vibration and stalled movement.
Terminal Identification via Multimeter
- Set your digital multimeter (DMM) to resistance (Ohms) or continuity mode.
- Probe the four motor wires in pairs. You are looking for two distinct pairs that show low resistance (typically 1.5Ω to 5.0Ω).
- Wires that show infinite resistance (OL) belong to different coils.
- Label one pair as Coil A (A+, A-) and the other as Coil B (B+, B-). The polarity (+ or -) within the pair doesn't matter for initial testing; swapping them simply reverses the motor's direction.
Choosing the Right Driver
The driver translates low-voltage GPIO logic (STEP and DIR pins from your ESP32 or Arduino) into high-current coil energization.
- A4988 / DRV8825: The legacy budget choices ($2-$4). They use basic chopper drive circuitry. They are loud, prone to mid-band resonance, and require manual potentiometer tuning for current limits.
- TMC2209 / TMC2226: The modern standard ($8-$14). Trinamic's StealthChop2 technology makes them virtually silent. They support UART configuration, allowing your microcontroller to dynamically adjust RMS current and utilize "StallGuard" for sensorless homing.
Recognizing Failure Signatures
Because steppers operate open-loop, they cannot tell the microcontroller when they fail. You must diagnose by ear and touch:
- Humming/Vibrating without moving: Usually caused by mid-band resonance, a disconnected coil, or the driver's step pulse frequency exceeding the motor's pull-in torque limit. Lower the acceleration profile in your firmware.
- Overheating (Too hot to touch >60°C): The driver's RMS current limit is set too high. For a TMC2209, recalculate the
Vrefor UARTirunvalue based on the motor's rated phase current. Steppers run hot by design, but they shouldn't melt PLA mounts. - Stalling (Missed Steps): The load torque exceeded the motor's available torque at that specific speed. The motor stops, but the firmware continues sending pulses, resulting in a shifted coordinate system.
Sizing Rule of Thumb: A Worked Load Example
The golden rule of stepper sizing is to select a motor whose rated holding torque is 2 to 3 times greater than the maximum calculated load torque. This safety factor accounts for the torque drop-off at speed, friction variations, and the inertia required to accelerate the mass.
Worked Example: Sizing a Z-Axis Lead Screw Motor
Suppose you are building a DIY CNC router and need to lift a 5 kg Z-axis assembly (spindle, carriage, and stepper) using a TR8x8 lead screw (8mm pitch).
- Calculate the downward force (F): Mass × Gravity = 5 kg × 9.81 m/s² = 49.05 N.
- Calculate the theoretical torque to lift (T): The formula for lead screw torque is
T = (F × Lead) / (2 × π × Efficiency). Assuming 90% efficiency (0.9) for an acetal nut on a steel screw:
T = (49.05 × 0.008) / (2 × 3.14159 × 0.9) = 0.069 Nm. - Add friction and breakout torque: Static friction and rail stiction typically add 20-30%. Let's add 0.02 Nm. Total required torque = 0.089 Nm.
- Apply the safety factor: 0.089 Nm × 3 = 0.267 Nm target holding torque.
A standard NEMA 17 motor, such as the LDO-42STH47-1684AC (retailing around $16), boasts a holding torque of 0.45 Nm. Because 0.45 Nm is well above our 0.267 Nm requirement, this motor is perfectly sized for the load. If the calculation had yielded 0.50 Nm, we would need to step up to a NEMA 23 frame or use a 3:1 planetary gearbox.
Frequently Asked Questions
What is a stepper motor used for in Arduino projects?
In Arduino and ESP32 ecosystems, stepper motors are primarily used for precise linear and rotary motion where open-loop control is sufficient. Common applications include 3D printer extruders and gantries, CNC plotter X/Y axes, automated camera sliders for timelapse photography, and motorized telescope mounts. Libraries like AccelStepper or FastAccelStepper handle the complex timing required to generate smooth acceleration ramps without blocking the microcontroller's main loop.
What is the difference between a stepper motor and a continuous rotation servo?
They serve entirely different purposes. A continuous rotation "servo" is actually a modified brushed DC motor with a gearbox and a stripped-out potentiometer; it allows you to control speed and direction via PWM, but you have zero control over exact position or holding torque. A stepper motor provides exact positional control (e.g., move exactly 45.2 degrees and hold there rigidly), but requires a dedicated stepper driver and continuous power to maintain its holding position.
Why is my stepper motor vibrating but not moving?
This is a classic symptom of either a wiring fault or an acceleration fault. First, verify your coil pairs with a multimeter; if one wire from Coil A and one from Coil B are swapped, the magnetic fields will fight each other, causing violent vibration. If the wiring is correct, your firmware is likely commanding a starting speed or acceleration rate that exceeds the motor's "pull-in torque" limit. Lower the initial velocity and acceleration values in your motion profile to allow the rotor inertia to catch up with the stator's rotating magnetic field.
Can I run a 12V stepper motor on a 24V power supply?
Yes, and in most cases, you should. The "12V" printed on a stepper motor's nameplate is merely the nominal voltage calculated from its rated current and coil resistance (V = I × R). Modern chopper drivers (like the TMC2209 or DRV8825) use PWM current limiting. Supplying a higher voltage (up to the driver's maximum rating, usually 35V-45V) forces current through the inductive coils much faster, significantly improving the motor's high-speed torque and allowing for faster acceleration. Just ensure the driver's current limit is configured to match the motor's rated RMS current, not the voltage.






