28BYJ-48 Stepper

A 5V unipolar geared stepper motor: 4 phases, 5 wires and a 1/64 reduction gearbox for fine, low-speed positioning, almost always driven through a ULN2003 board.

  • Supply voltage5 V
  • Maximum supply voltage5 V
  • InterfaceGPIO
  • Dimensions42 × 42 × 30 mm
28BYJ-48 Stepper, A 5V unipolar geared stepper motor: 4 phases, 5 wires and a 1/64 reduction gearbox for fine, low-speed positioning, almost always driven through a ULN2003 board.
In short

The 28BYJ-48 is a 5 V, 4-phase stepper motor with a 1/64 gearbox and 50 Ω coils, so its output shaft moves 5.625°/64 per step (Kiatronics 28BYJ-48 datasheet, p.1). Plug its 5-wire connector into a ULN2003 driver board, wire IN1 to IN4 to four GPIO pins, power the board from 5 V and share ground with the microcontroller; one output revolution is 2,048 steps with the Arduino Stepper library.

The 28BYJ-48 is a small permanent-magnet stepper motor with a built-in reduction gearbox and a 28 mm diameter body. It is a 4-phase unipolar design brought out on five wires: four coil ends (blue, pink, yellow, orange) plus a red common that ties to +5 V. It is one of the most common motors in Arduino starter kits because it is inexpensive and positions precisely at low speed.

The datasheet gives a stride angle of 5.625° with a 1/64 gear reduction, so the output shaft advances about 0.088 degrees per step in half-step drive. That works out to about 4,096 half-steps (HALF4WIRE) or 2,048 full steps (FULL4WIRE) per output-shaft revolution. The datasheet rates the idle in-traction frequency above 600 Hz and the pull-in torque at 300 gf·cm, so the motor is slow and light-duty: it is made for precise positioning rather than speed or heavy loads.

The red wire connects to +5 V and the four phase wires are switched to ground in sequence. A ULN2003 Darlington-array board is the standard driver: it sinks the coil current the microcontroller cannot, and its built-in clamp diodes absorb the inductive kickback from the coils. The microcontroller only toggles four GPIO pins (IN1 to IN4) in a stepping sequence.

28BYJ-48 Stepper pinout

tinkered.ai/components/stepper-28byj-4828BYJ-48 StepperBLUEDigitalPINKDigitalYELLOWDigitalORANGEDigitalRED_COMPower
PinFunctionType
BLUEDigitalfree
PINKDigitalfree
YELLOWDigitalfree
ORANGEDigitalfree
RED_COMRed / +5V common5 Vpower in

How to wire the 28BYJ-48 Stepper

BLUEULN2003 Stepper Driver M_BLUEMotor coil harness (plug)
PINKULN2003 Stepper Driver M_PINK
YELLOWULN2003 Stepper Driver M_YELLOW
ORANGEULN2003 Stepper Driver M_ORANGE
RED_COMULN2003 Stepper Driver M_RED_COM

28BYJ-48 Stepper code

Every example here compiles for its board.

Libraries: arduino-libraries/Stepper
// 28BYJ-48 Stepper on Arduino Uno: wiring and a free simulation at https://www.tinkered.ai/components/stepper-28byj-48
#include <Stepper.h>

const int STEPS_PER_REV = 2048;   // 28BYJ-48 with internal gearing

// 28BYJ-48 quirk: pass the pins as (IN1, IN3, IN2, IN4) so the coil field
// rotates in order. Wiring above on an Uno: IN1=D2, IN2=D3, IN3=D4, IN4=D5
Stepper stepper(STEPS_PER_REV, 2, 4, 3, 5);

void setup() {
  stepper.setSpeed(10);    // RPM
}

void loop() {
  stepper.step(STEPS_PER_REV);    // one full revolution forward
  delay(500);
  stepper.step(-STEPS_PER_REV);   // one full revolution back
  delay(500);
}
Compiled for arduino:avr:uno on 2026-10-30

Before you wire it

Do
  • Connect the ULN2003 board's IN1,IN2,IN3,IN4 each to an MCU digital pin.
  • Power the board's VCC from 5V (it powers both the logic and the motor) and share GND with the MCU.
  • The 28BYJ-48 motor plugs into the board's 5-pin socket: wire its coil pins BLUE/PINK/YELLOW/ORANGE to the board's M_BLUE/M_PINK/M_YELLOW/M_ORANGE and its RED_COM to M_RED_COM.
  • Coils must be energised in sequence. With the Stepper library the classic 28BYJ-48 pin order is Stepper(2048, IN1, IN3, IN2, IN4): note IN3/IN2 are swapped so the field rotates smoothly.
Don’t
  • No driving the 28BYJ-48 coil wires directly from MCU GPIOs: they must go through the ULN2003 (the coils need far more current than a GPIO can source).
  • No analogRead / PWM speed: this is a discrete step sequence.
  • Power the motor through the ULN2003 board from 5 V. Each coil is 50 Ω, so it draws about 100 mA at 5 V and about 200 mA with two phases on; on a busy USB-powered board, a separate 5 V supply avoids brownouts.
  • Tie the driver board ground to the microcontroller ground so the IN1 to IN4 signals share a common reference.
  • The red wire is the common and connects to +5 V. The blue, pink, yellow and orange phase wires are pulled to ground in sequence by the ULN2003 outputs.
  • Never wire the coils straight to GPIO pins. About 100 mA per coil (5 V across 50 Ω) is far beyond a pin's limit; the ULN2003 carries the current and provides the clamp diodes the coils need.
  • With the Arduino Stepper library pass the pins as (IN1, IN3, IN2, IN4) and 2,048 steps per revolution, so the field rotates in order.
  • Keep the step rate low. The datasheet rates the idle in-traction frequency above 600 Hz; stepping faster than the motor can follow makes it buzz and stall instead of turning.

Specifications

Supply voltage
5 V
Maximum supply voltage
5 V
Interface
GPIO
Dimensions
42 × 42 × 30 mm
Weight
35 g

From the Generic / Mouser STEP-D01's datasheet, published by Generic / Mouser STEP-D01.

Common mistakes

  1. Driving the coils directly from Arduino pins

    The 28BYJ-48 needs a ULN2003 or equivalent transistor array. Each 50 Ω coil draws about 100 mA at 5 V, far more than a GPIO pin can safely sink, so connecting coils directly stalls the motor and can damage the pin.

  2. Mixing up full-step and half-step counts

    One output revolution is about 2,048 full steps but about 4,096 half-steps. Using the wrong steps-per-revolution in code (for example 2,048 with a HALF4WIRE setup) makes every commanded rotation half or double the intended angle.

  3. Wiring the phases in the wrong order

    The IN1 to IN4 coil mapping and the stepping sequence must match. With the Stepper library, passing the pins as IN1, IN2, IN3, IN4 instead of IN1, IN3, IN2, IN4 makes the motor vibrate in place or run rough.

  4. Powering a loaded build from a weak 5V rail

    With two phases on, the motor draws about 200 mA. Added to the rest of a USB-powered project, that can drop the rail and reset the board. Feed the ULN2003 board from a separate 5 V supply and share only ground.

  5. Expecting high speed or strong torque

    This is a heavily geared, low-torque motor: the datasheet's pull-in torque is 300 gf·cm. Stepping faster than it can follow causes missed steps and stalling, and it cannot move heavy loads.

28BYJ-48 Stepper questions

How do I connect a 28BYJ-48 to an Arduino?

Plug the motor's 5-pin connector into a ULN2003 driver board, wire the board's IN1 to IN4 to four digital pins, and power the board from 5 V with its ground shared with the Arduino. In code use Stepper(2048, IN1, IN3, IN2, IN4) and a speed of about 10 RPM.

How many steps per revolution does the 28BYJ-48 have?

The datasheet gives a 5.625° stride angle and a 1/64 gearbox (Kiatronics 28BYJ-48 datasheet, p.1), which makes about 4,096 half-steps or 2,048 full steps per output-shaft revolution. Use 2,048 with the Arduino Stepper library and 4,096 with AccelStepper in HALF4WIRE mode.

Can I run a 28BYJ-48 from an ESP32 or other 3.3V board?

Yes, through the ULN2003 board: its inputs switch from 3.3 V GPIO, since the ULN2003A needs at most 2.4 V at 200 mA of output (TI ULN2003A datasheet, p.5). Power the board and motor from 5 V (VIN), not 3V3, because the motor is rated 5 V (Kiatronics 28BYJ-48 datasheet, p.1).

Why does my 28BYJ-48 vibrate but not turn?

The phase order is wrong or the motor is stepped too fast. With the Stepper library pass the pins as IN1, IN3, IN2, IN4, check that all four ULN2003 LEDs light in turn, and lower the speed; the datasheet's idle in-traction frequency is only above 600 Hz (Kiatronics 28BYJ-48 datasheet, p.1).

How much current does the 28BYJ-48 draw?

Each coil is 50 Ω ±7% (Kiatronics 28BYJ-48 datasheet, p.1), so at 5 V a coil draws about 100 mA and two coils on together about 200 mA. That is well within the ULN2003A's 500 mA per channel (TI ULN2003A datasheet, p.1).

28BYJ-48 vs NEMA 17: which stepper should I use?

The 28BYJ-48 is a small 5 V geared motor with 300 gf·cm of pull-in torque (Kiatronics 28BYJ-48 datasheet), fine for dials, blinds and turntables. A NEMA 17 such as the 17HS4401 holds 40 N·cm at 1.7 A per phase (MotionKing 17HS catalogue) and needs a current-limiting driver like the TMC2209, for printers and CNC axes.

Build something with the 28BYJ-48 Stepper

  • Geared clock and indicator dials

    The fine 4,096 half-step resolution and low speed suit analog-style clock hands, gauge needles or slowly rotating indicator dials.

    Build this
  • Automated blinds or curtain opener

    Paired with a ULN2003 and a small pulley, it can open and close light window coverings on a schedule or button press.

    Build this
  • Camera pan or small pan-tilt rig

    Its small angular steps are handy for slowly panning a lightweight camera or sensor to a repeatable position.

    Build this
  • Rotating display turntable

    A common build spins a small object on a platform at a slow, steady rate for photography or a showcase.

    Build this
  • Precise positioning mechanisms

    The gearbox holds the output shaft between steps, which suits dial pointers, small valve or knob actuators and other repeatable low-load tasks.

    Build this
For AI assistants

This page as plain Markdown, for ChatGPT, Claude or your own agent. /components/stepper-28byj-48.md

What will you build with it?