A4988 Microstepping Driver for NEMA-17
The chopper driver every desktop 3D printer uses — microstep a NEMA-17 down to 1/16 of a step with two MCU pins.
Difficulty: Through-hole. Estimated build time: about 60 minutes. Estimated parts cost: about US$12.00. 5-line bill of materials. Compare supplier offers when available. A bipolar stepper motor driver built around the Allegro A4988, the same chip on every red Pololu carrier board used in RepRap-class 3D printers, CNC pen plotters, and small XY-stage rigs.
Mount the A4988 carrier and decoupling
Solder two female header strips into the breadboard or carrier-board socket so the red A4988 module drops in. The board needs a 100 µF, 35 V electrolytic capacitor directly across VMOT and GND — the motor PSU pin will spike hard during chopping and undersized caps blow the IC. Place the cap within a few millimetres of the VMOT pin.
Wire VDD logic supply and microstepping selector
Connect VDD (the logic-side rail) to your MCU's 5 V (or 3.3 V; the chip works at either). Tie all three microstep-select pins (MS1, MS2, MS3) to VDD to enable 1/16 microstepping — the smoothest mode. Tie /RESET and /SLEEP both high to keep the driver enabled. Leave /ENABLE floating (it has an internal pull-down so the chip enables by default).
SET THE CURRENT LIMIT BEFORE CONNECTING THE MOTOR
This is the critical step. With the motor still unplugged, apply VDD to the logic side only (no VMOT yet), then power VMOT to 12 V. Put a multimeter on the small VREF test pad in the centre of the board, ground reference. Turn the tiny pot with a non-conductive screwdriver until VREF reads (Imax × 8 × R_sense). Pololu boards use 0.05 Ω sense resistors, so for 1 A per phase: VREF = 1 × 8 × 0.05 = 0.40 V. Setting VREF too high will cook the motor or the driver.
Connect the NEMA-17 motor coils
A NEMA-17 has four wires forming two coils. Use a multimeter in continuity mode to find which two wires belong to coil A (usually red+blue) and which to coil B (usually green+black, but every brand is different — TEST DON'T GUESS). Connect coil A to the 1A and 2A pins of the driver, coil B to the 1B and 2B pins. Wires plugged into wrong pins will simply make the motor sit and buzz.
Drive it with two Arduino pins
Wire DIR to Arduino pin 2, STEP to pin 3. Upload a sketch that pulses STEP at 1 ms intervals (delayMicroseconds(500); digitalWrite(STEP, HIGH); delayMicroseconds(500); digitalWrite(STEP, LOW);). The motor should turn smoothly — 3200 microsteps per revolution at 1 ms per microstep gives one revolution every 3.2 seconds. Flip DIR to reverse. To go faster, shorten the delay; the practical upper limit with default MS settings is roughly 5000 microsteps/sec before the motor stalls (chopping can't keep up).