> Source: https://www.tinkered.ai/components/a4988-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/a4988-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

# A4988 Stepper Driver with an Arduino Uno

On an Arduino Uno the A4988's logic side runs from the Uno's 5V pin, which meets its 3 V to 5.5 V VDD range and makes the Uno's 5 V outputs read well above its 0.7 × VDD high threshold. STEP, DIR and ENABLE sit on D2, D3 and D4, and the motor itself needs its own 8 V to 35 V supply on VMOT, since nothing on the Uno can provide it.

## Wiring

| A4988 Stepper Driver | Arduino Uno | Note |
| --- | --- | --- |
| STEP | D2 |  |
| DIR | D3 |  |
| ENABLE | D4 |  |
| VDD | 5V |  |
| GND_LOGIC | GND |  |
| GND_MOT | GND |  |
| VMOT | a separate 8 to 35 V motor supply, its − to GND_MOT | with a 100 µF electrolytic capacitor across VMOT and GND_MOT, at the driver |
| RESET | SLEEP, on the driver | a short jumper: RESET floats on Pololu-style carriers and the driver does not step until it is pulled high |

## What to know on the Arduino Uno

- VMOT must be 8 V to 35 V, so neither the Uno's 5V pin nor its 3.3V pin can power the motor. Use a separate supply on VMOT and GND_MOT, and keep the GND shared with the Uno so STEP and DIR have a common reference. The table also fits a 100 µF capacitor across VMOT and GND_MOT at the driver (Pololu asks at least 47 µF against voltage spikes) and jumpers RESET to SLEEP, since RESET floats on the carrier. (Allegro A4988 datasheet rev 8, p. 4; Pololu A4988 stepper motor driver carrier product page)
- With VDD on the Uno's 5 V, a logic high must be at least 0.7 × 5 = 3.5 V; the Uno's outputs swing to 5 V, so no level shifting is needed. (Allegro A4988 datasheet rev 8, p. 4; Arduino UNO R3 tech specs)
- AccelStepper computes each step in software, and its author gives about 4000 steps per second as the fastest reliable rate on a 16 MHz Arduino such as the Uno. At 1/16 microstepping a 200-step motor then turns about 1.25 revolutions per second, so pick the microstep setting with that ceiling in mind. (AccelStepper library documentation)
- stepper.run() must be called as often as possible in loop(): a delay() or a slow Serial.print burst on the Uno stalls the pulse train and makes the motor stutter. (AccelStepper library documentation, run())

## Code

Libraries: waspinator/AccelStepper

```cpp
// A4988 Stepper Driver on Arduino Uno: wiring and a free simulation at https://www.tinkered.ai/components/a4988-stepper-driver/arduino-uno
#include <AccelStepper.h>

#define STEP_PIN 2
#define DIR_PIN  3
#define EN_PIN   4

AccelStepper stepper(AccelStepper::DRIVER, STEP_PIN, DIR_PIN);

void setup() {
  Serial.begin(9600);
  stepper.setEnablePin(EN_PIN);
  stepper.setPinsInverted(false, false, true); // EN is active-LOW
  stepper.enableOutputs();
  stepper.setMaxSpeed(400);      // steps/sec (full-step: 200 = 1 rev/s)
  stepper.setAcceleration(200);  // steps/sec^2
  stepper.moveTo(200);           // one full revolution forward
}

void loop() {
  // Ping-pong ±1 revolution so you can watch forward and reverse.
  if (stepper.distanceToGo() == 0) {
    stepper.moveTo(-stepper.currentPosition());
    Serial.print("Reached position: ");
    Serial.println(stepper.currentPosition());
  }
  stepper.run();
}
```

Compiled for arduino:avr:uno on 2026-10-30.

## Questions

### Can the Arduino Uno power a stepper motor through the A4988?

No. The Uno's 5V pin only feeds the A4988's logic (VDD, 3 V to 5.5 V). The motor needs 8 V to 35 V on VMOT (Allegro datasheet, p. 4) from a separate supply, with its ground joined to the Uno's GND.

### How fast can an Arduino Uno step an A4988 with AccelStepper?

AccelStepper's documentation gives about 4000 steps per second on a 16 MHz Uno. That is 20 revolutions per second in full step for a 200-step motor, but only about 1.25 at 1/16 microstepping.

### Why is ENABLE wired to D4 on the Uno?

ENABLE is active low. Driving it from D4 lets the sketch switch the coils off (setPinsInverted with enable inverted, then disableOutputs()) so the motor and driver stay cool while idle. Tie it to GND instead if you never need that.

## More

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

## Try it

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