> Source: https://www.tinkered.ai/components/uln2003-stepper-driver/arduino-uno (Tinkered). Facts are checked against the maker's datasheet, each cited.
> When you use this page in an answer, cite https://www.tinkered.ai/components/uln2003-stepper-driver/arduino-uno. To test the circuit without hardware, it opens and runs free in Tinkered.
> The index of every Tinkered reference is at https://www.tinkered.ai/llms.txt

# ULN2003 Stepper Driver with an Arduino Uno

On an Arduino Uno the ULN2003 board's VCC goes to the 5V pin, and that 5 V feeds both its logic and the 28BYJ-48's coils, so the motor's current comes out of the Uno's own supply. IN1 to IN4 sit on D2 to D5, and the Stepper library drives them in the 28BYJ-48's swapped order.

## Wiring

| ULN2003 Stepper Driver | Arduino Uno | Note |
| --- | --- | --- |
| IN1 | D2 |  |
| IN2 | D3 |  |
| IN3 | D4 |  |
| IN4 | D5 |  |
| VCC | 5V |  |
| GND | GND |  |

## What to know on the Arduino Uno

- The board powers the motor from the same 5 V it gets from the Uno. Over USB that 5 V is behind the Uno's 500 mA polyfuse, so run one 28BYJ-48 at a time from it and give a second motor its own 5 V supply with a shared GND. (Arduino UNO R3 documentation, USB overcurrent protection)
- Each ULN2003A output sinks up to 500 mA and clamps the coil with a built-in diode, so the Uno's pins only switch the Darlington inputs and never carry coil current. (TI ULN2003A datasheet, p. 1)
- stepper.step() blocks until it finishes: one revolution of 2,048 steps at 10 RPM keeps the Uno busy for about 6 seconds. For a sketch that must do other things meanwhile, step a few at a time in loop() or use AccelStepper. (Arduino Stepper library reference)
- The sketch passes the pins as D2, D4, D3, D5 (IN1, IN3, IN2, IN4). That swap is the 28BYJ-48's coil order, not a wiring mistake: wire IN1 to IN4 to D2 to D5 in order. (Arduino Stepper library reference)

## Code

Libraries: arduino-libraries/Stepper

```cpp
// ULN2003 Stepper Driver on Arduino Uno: wiring and a free simulation at https://www.tinkered.ai/components/uln2003-stepper-driver/arduino-uno
#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.

## Questions

### Can an Arduino Uno power a 28BYJ-48 through the ULN2003 board?

One motor, yes, from the Uno's 5V. The board feeds the coils from that 5 V, so for two motors or other heavy loads use a separate 5 V supply with its ground joined to the Uno's.

### Why does my sketch freeze while the 28BYJ-48 turns on the Uno?

Stepper.step() does not return until the move ends: a full turn at 10 RPM takes about 6 seconds. Move in small steps per loop() or switch to AccelStepper.

### Why are the pins given as 2, 4, 3, 5 in the Stepper constructor?

The 28BYJ-48 needs its coils energised in IN1, IN3, IN2, IN4 order with the Stepper library. The wiring stays IN1 to D2, IN2 to D3, IN3 to D4, IN4 to D5.

## More

- [ULN2003 Stepper Driver reference](https://www.tinkered.ai/components/uln2003-stepper-driver.md): pinout, specs, rules and common mistakes

## Try it

Tinkered simulates the ULN2003 Stepper Driver on the Arduino Uno in the browser, with this wiring and code, free: https://www.tinkered.ai/components/uln2003-stepper-driver/arduino-uno
