ULN2003 driver array for a stepper
An ESP32 pin can give about 20 mA at 3.3 V; a stepper phase wants 100 mA at 5 V. The ULN2003 has seven Darlington switches, each pulling its output to ground when its input is high, with built-in flyback diodes to the COM pin.

Open this lesson in the labFree, in your browser, no account needed.
How it works
One half-step every 2 ms is 500 half-steps per second. With 4096 half-steps per output turn that is 500 × 60 ÷ 4096 = 7.32 RPM.
Try it on the bench
- Change STEP_MS in the sketch to 1: 1000 steps per second is past what the 28BYJ-48 can follow (about 900), so it misses steps.
Parts on the bench
- Bench power supply
- ESP32 DevKit
- USB charger / port
- ULN2003 driver
- Stepper motor (unipolar)
In the course
Embedded & IoT, module “Actuators”.