28BYJ-48 stepper motor + ULN2003 driver
28BYJ-48 5 V stepper motor with ULN2003 driver board: IN1–IN4 and power pins, 2048 steps per turn, separate power, and the Stepper library.
Community draft — report a mistake
3.3 V or 5 V? The ULN2003 inputs accept 3.3 V or 5 V logic, so ESP32 and Pico drive IN1–IN4 directly. Power the motor from 5 V — not from a 3.3 V pin — and share GND with the board.
The 28BYJ-48 is a small geared stepper motor sold with a ULN2003 transistor board. It moves in precise steps rather than spinning freely, so you can turn a dial, open a curtain or rotate a turntable by an exact amount — slowly, but with decent torque thanks to the gearbox.
In full-step mode one output-shaft turn is roughly 2048 steps (about 4096 in half-step mode). The four LEDs on the driver board show which coils are energised.
Power the motor from a 5 V supply that can deliver at least 300 mA, not from a microcontroller pin, and connect the supply’s ground to your board’s ground.
Pinout
| Pin | What it does |
|---|---|
IN1 | Coil A driver input |
IN2 | Coil B driver input |
IN3 | Coil C driver input |
IN4 | Coil D driver input |
+ | Motor supply (5 V for the 5 V motor) — header marked “5-12V +” |
- | Ground — shared with the board |
Library
Stepper by Arduino
Arduino IDE → Library Manager → search the name above. Each guide lists the exact version we compile against.
Use it with
Common errors
Motor vibrates but doesn’t turn
The coil order is wrong. With the Arduino Stepper library, pass the pins as IN1, IN3, IN2, IN4.
Turns slower than expected or skips
This geared motor tops out around 10–15 RPM. Lower the speed setting.
One turn isn’t exactly 2048 steps
The gearbox ratio is about 63.68:1, so a full turn is close to 2038 full steps. Calibrate if you need exact angles.
Driver and motor get hot when idle
The coils stay energised. Set all four inputs LOW when the motor doesn’t need to hold position.