Skip to content
Motor

NEMA17 Stepper Motor

Standard high-torque stepper used in 3D printers and CNC machines.

The industry-standard stepper motor size for 3D printers, CNC routers, and precision positioning rigs, typically driven via A4988/DRV8825.

Specifications

Step angle1.8° per full step — 200 steps/revolution (microstepping via driver goes much finer, e.g. 3200 steps/rev at 1/16)
Holding torque~40-59 N·cm depending on model — check your specific motor's datasheet, this varies a lot between NEMA17 variants
Rated current~1.2A-1.7A per phase, model-dependent
Winding typeBipolar, 4-wire (two coil pairs — not compatible with unipolar 5/6-wire driver wiring)
Typical driverA4988 or DRV8825, needing a separate 8V-35V motor supply plus 3.3V-5V logic

Pinout

PinNameDescription
1A+Coil A, lead 1 — to driver 1A/1B terminal (order within the pair can be swapped to reverse that coil's direction)
2A-Coil A, lead 2
3B+Coil B, lead 1 — to driver 2A/2B terminal
4B-Coil B, lead 2

Board Integration

Library

AccelStepper by Mike McCauley

Arduino IDE → Tools → Manage Libraries → search "AccelStepper"

Wiring

Component pinESP32 pinNote
STEP (on A4988/DRV8825 driver)GPIO25Pulses HIGH-LOW to advance one microstep each time
DIR (on driver)GPIO26Sets rotation direction
ENABLE (on driver)GPIO27Optional -- pull LOW to enable driver outputs; leave floating if unused
VDD (driver logic supply)3.3V
GND (driver logic)GNDCommon ground with the motor power supply is required
VMOT + GND (driver motor supply)External 12-24V supply, not the ESP32NEMA17 coils draw far more current than the ESP32 can source -- never power them from the board itself
A+ / A- / B+ / B- (motor coil leads)Driver's 1A/1B/2A/2B screw terminalsGoes to the driver board, not directly to the ESP32

Example code

C++

Requires an external stepper driver (A4988, DRV8825, or similar) between the ESP32 and the motor -- the NEMA17 draws far more current than a GPIO can supply directly. Power the driver's motor rail from a separate 12-24V supply, not the ESP32.

View full ESP32 guide