All wiring guides

Free wiring guides

Wire the 28BYJ-48 stepper motor (ULN2003) to the ESP32-C3

Stepper motor 28BYJ-48 (5 V) with ULN2003 driver. Turns in exact small steps: good for measuring out a portion.

When buying: The motor plugs into the driver with its own white connector.

Which pin goes where

On the partOn the ESP32-C3
IN1GPIO 0
IN2GPIO 1
IN3GPIO 3
IN4GPIO 4
-GND
+5V

Wire it with the USB cable unplugged. Follow the names printed on your own part: makers sometimes reorder the pins.

In 3D

Example sketch

// Stepper motor 28BYJ-48 (5 V) with ULN2003 driver
// on the ESP32-C3 Super Mini
// https://stem.manusignal.com/en/parts/28byj-48-stepper-uln2003-esp32-c3
#include <Stepper.h>

const int PIN_IN1 = 0;
const int PIN_IN2 = 1;
const int PIN_IN3 = 3;
const int PIN_IN4 = 4;

// The 28BYJ-48 takes 2048 steps a turn, with its coils in the order IN1, IN3, IN2, IN4.
Stepper motor(2048, PIN_IN1, PIN_IN3, PIN_IN2, PIN_IN4);

void setup() {
  motor.setSpeed(10);
}

void loop() {
  motor.step(2048);
  delay(500);
  motor.step(-2048);
  delay(500);
}
  • Tools > Board > ESP32C3 Dev Module (USB CDC On Boot: Enabled), then Tools > Port and choose the board's port.
  • Stepper: install it from Sketch > Include Library > Manage Libraries.

This sketch is compiled for the board before the page is published. It has not been run on real hardware by us.

What you should see

The shaft makes one full turn, pauses, and turns back.

If it does not work

The motor hums but does not turn.
The four IN wires are out of order. They must go IN1, IN2, IN3, IN4 to the pins in the table.
The board restarts when the motor starts.
USB cannot supply enough current. Use a 5 V 2 A charger, not a laptop port.

The same part on the ESP32-S3

More parts on the ESP32-C3