Stepper motor 28BYJ-48 + ULN2003
precise turning, step by step
A small motor that turns in exact steps, so you know exactly how far it has turned without a sensor. It comes with a ULN2003 driver board with 4 LEDs that show which coil is on.
Open the course →How it works
The motor has 4 coils (electromagnets). When you switch them on in order, the rotor follows them step by step. With half-steps (8 combinations) you get 4096 steps per turn (thanks to the built-in 1:64 gearbox). The ESP32 cannot supply enough current for the coils, so the ULN2003 is an "amplifier": 4 transistors that switch the coils on when the GPIO goes HIGH.
Pins and wiring
| Pin | What it is | Where it connects / why |
|---|---|---|
| IN1 – IN4 | Coil inputs | → 4 GPIO (e.g. 14, 27, 26, 25). |
| + (5–12 V) | Motor supply | → VIN (5 V). |
| − (GND) | Ground | → GND, shared with the ESP32. |
| Connector (white) | 5-wire motor cable | Fits only one way round. |
Specifications
Voltage5 V
Steps4096 half-steps / turn
Speedmax ~15 RPM
Current~240 mA
Gearbox1:64
Tips and typical mistakes
- The motor only shakes? The IN pin order is wrong, or the steps are too fast (under ~1 ms).
- Gets warm while standing still? Turn all 4 coils off when it does not move.
- Never connect the motor directly to GPIO, always through the ULN2003.