Source: https://mokxi.com/parts/nema17
Updated: 2026-11-10

Part

# Stepper motor, NEMA 17

Two coils, 200 steps a turn, and lost steps if you ask it to go faster than it can.

See every part

- 4 pins
- 6 settings
- In 9 projects
- In 5 lessons

Drawn live by the editor's own code, at the size you see it.

At a glance

## The Stepper motor, NEMA 17 in brief

What it is, and every setting the properties panel gives it.

The NEMA 17 is the square 3D printer stepper, a 17HS4401-style bipolar motor with four wires and two coils: A1 and A2 (black and green) and B1 and B2 (red and blue), with no common. It cannot run from board pins or a ULN2003; it needs two H bridges, usually an A4988, DRV8825 or TMC2209 on 12 V, and the board only sends STEP and DIR from any pins on an Uno, or from an ESP32 with the driver’s logic on 3.3 V. Mokxi models each coil as a 1.5 ohm winding rated 1.7 A, reads the two coil currents and turns the rotor’s 50 teeth to the field they point: 200 full steps a turn, 1.8 degrees each. The rotor follows at most 1000 full steps a second (300 rpm); a field that runs further ahead makes it slip four steps at a time, the lost step a printer shows as shifted layers. Under 5 percent of the rated current the shaft is free. The classic mistake is one wire from each coil on the same bridge; a coil reads about 1.5 ohms on a meter. Inductance, back EMF, torque, load and resonance are not modeled.

Family

Outputs

Pins

4

model

custom (or 17HS4023 pancake, NEMA 14 35x28, NEMA 14 35x36, NEMA 23 57x56, NEMA 23 57x76)

resistance

1.5

ohms per coil, 1.5.

current

1.7

the rated current, 1.7 A.

steps

200

full steps per turn, 200.

max_steps

1000

the fastest full-step rate the rotor
follows, 1000 a second (300 rpm).

angle

0

where the shaft starts.

Pins

## 4 pins

Named as the editor names them, so a wire lands where you expect it.

Pin

What it does

A1

Coil A, black and green.

A2

Coil A, black and green.

B1

Coil B, red and blue.

B2

Coil B, red and blue.

How to use it

## How to use a NEMA 17 stepper with an Arduino

A NEMA 17 never goes on board pins. Its four wires are two coils, A1 and A2 (black and green) and B1 and B2 (red and blue), and they go to a driver’s two bridges: here a TMC2209 on 12 V, M1A and M1B to coil A, M2A and M2B to coil B. The Uno only sends STEP on pin 2, DIR on pin 3 and an active-low EN on pin 4, and a knob on A0 sets the speed.

The driver is at 1/8 step, so one turn of the 200-step motor is 1600 pulses. AccelStepper’s DRIVER mode pulses STEP and DIR, and the sketch eases every speed change, because a field that runs more than 1000 full steps a second ahead of the rotor leaves it behind and it slips four steps at a time. Leave the knob in the middle for two seconds and the outputs turn off: under 5 percent of its rated current the shaft holds nothing.

If a motor buzzes and does not turn, one wire from each coil has gone to the same bridge. Find the pairs with a meter: a coil reads about 1.5 ohms, two wires from different coils read open.

Part pin

Board pin

A1

TMC2209 M1A

A2

TMC2209 M1B

B1

TMC2209 M2A

B2

TMC2209 M2B

The motor does not care which board sends the pulses. On an ESP32 put the driver’s logic supply (VIO on a TMC2209, VDD on an A4988) on 3.3 V and keep the motor on its own 12 V.

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

How it is modeled

## What is true about the Stepper motor, NEMA 17, here

In its help article’s own words: what the simulation gets right, and where it stops.

### Modeled

Each coil is a resistor, so the motor loads its driver as the real one does. The
current in each coil is read off the volts across it, the two currents point a
magnetic field, and the rotor's 50 teeth line up with it: one turn of the field is
four full steps, 7.2 degrees of shaft. So full step, wave drive, half step and any
microstep a driver produces all come out of one rule, and a full step is 1.8
degrees.

The rotor goes the short way around to the field. A field that jumps exactly half a
turn pulls it both ways at once and it stays put. Under 5 percent of the rated
current the field holds nothing and the shaft stays wherever it was left, which is
what disabling the driver is for.

Lost steps. The rotor turns at most max_steps full steps a second. A field that
runs ahead faster than that leaves it behind, and once it is more than half a turn
of the field behind, the short way is backwards: it slips four whole steps and ends
up somewhere the sketch does not think it is. That is what a printer that moves too
fast without acceleration does to its layers.

### Not modeled

Inductance and back EMF, which together are what really make a stepper's torque
fall off with speed: here the ceiling is flat and does not depend on the supply.
Torque and load: nothing is hung on the shaft, so a motor at 10 percent of its
current holds as well as one at 100. Resonance, and the small error a real rotor
has between full steps. The rotor moves at its top rate or not at all, with no
acceleration of its own. The 1000 steps a second is a typical unloaded start-stop
rate on a 12 V driver, not a datasheet figure, because every datasheet draws that
curve for a different supply.

From NEMA 17 stepper motor, in full.

Projects

## See the Stepper motor, NEMA 17 in a project

9 built-in projects use it. Each opens in the editor, already wired.

Lessons

## Where it turns up in a lesson

5 lessons place it in their own circuits.

### Learn articles

5 lessons

- DIY Stream Deck and Camera Slider With Arduino
- Arduino A4988 and NEMA 17 Stepper: Wiring and Code
- A4988 Pinout: Pins, Microstep Table and Vref
- Arduino DRV8825: Wiring, Code and Microstepping
- Stepper Motor Wiring: 4, 5 and 6 Wire Motors

Boards

## The boards it is shown on

Each of these 2 boards has a built-in project with the Stepper motor, NEMA 17 in it.

- Arduino Uno R3
- Arduino Nano

Libraries

## Arduino libraries for the Stepper motor, NEMA 17

Built in, so the sketch compiles with nothing to install. Each page has the calls, the wiring and an example to run.

- FastAccelStepper
- TMCStepper

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## Wire up the Stepper motor, NEMA 17

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.

Start building free Open the editor
