Skip to content
motors / 28byj-48.md

28BYJ-48 Stepper (5 V / 12 V) + ULN2003

A cheap unipolar geared stepper, sold with a matching ULN2003 Darlington driver board. 4096 half-steps per revolution after the 64:1 gearbox.

In stock Manufacturer 2 files · 2.0 MB

Specs (5 V version)

Spec Value
Voltage 5 V (most common) or 12 V
Phase Unipolar, 4 phase, 5 wire
Steps per rev (motor) 32
Gear ratio 1 : 64
Steps per rev (output shaft) 2048 full / 4096 half
Pull-in torque ~300 g·cm
Current per phase ~160 mA

Wiring

ULN2003 board → Arduino:

ULN2003 Arduino
IN1 D8
IN2 D9
IN3 D10
IN4 D11
GND
+ 5 V (separate supply for higher torque)

The motor's white 5-pin JST plugs straight into the ULN2003 board.

Code

#include <Stepper.h>
const int STEPS_PER_REV = 2048;     // 28BYJ-48 in full-step mode

// Note: order is IN1, IN3, IN2, IN4 due to library's pin sequencing
Stepper motor(STEPS_PER_REV, 8, 10, 9, 11);

void setup() { motor.setSpeed(10); }    // RPM (max ~15 for 28BYJ-48)

void loop() {
  motor.step(STEPS_PER_REV);   delay(500);     // 1 turn CW
  motor.step(-STEPS_PER_REV);  delay(500);     // 1 turn CCW
}

Schematic

The ULN2003 board is just the chip + 4 LEDs + a 4-pin connector for the motor + a 6-pin header for the control inputs. Reference circuit on page 8 of the ULN2003 datasheet.

Last updated: 2026-05-13 · Source on GitHub