Ir directamente al contenido

All items ship from our office in Colorado USA - $5.95 Flat-Rate US shipping & free shipping on orders over $75!

A4988 Stepper Motor Driver Module User Guide

A4988 Stepper Motor Driver Module

📋 Overview

This stepper motor driver module is a breakout/carrier board for Allegro's A4988 DMOS Microstepping Driver with built-in translator and overcurrent protection. It is Pololu / StepStick compatible and designed for easy integration with Arduino microcontrollers, 3D printers (RAMPS boards), CNC machines, and robotics projects.

The A4988 lets you control a bipolar stepper motor using just two pins from your microcontroller — one for direction and one for stepping. No complex phase-sequence tables or high-frequency control lines are needed.

Key highlights

  • Up to 2A per coil (with adequate cooling)
  • 1A continuous per phase without a heatsink
  • Five microstepping resolutions (full, half, 1/4, 1/8, 1/16)
  • Built-in overcurrent and over-temperature protection
  • Onboard potentiometer for current limit adjustment
  • Compatible with popular stepper motors like NEMA 17 and smaller NEMA 23 motors

📐 Specifications

Parameter Value
Driver Chip
Allegro A4988
Motor Type
Bipolar stepper motor
Output Current
1A continuous per phase (no heatsink), 2A max per coil (with cooling)
Motor Supply Voltage (VMOT)
8V – 35V DC
Logic Supply Voltage (VDD)
3.3V – 5V DC
Microstepping Resolutions
Full, 1/2, 1/4, 1/8, 1/16 step
Protection
Overcurrent, short-to-ground, shorted load, over-temperature (165°C)
Current Sense Resistors
0.068Ω (typical for this module variant)
Board Dimensions
~20mm × 15mm (0.8 x 0.6 inches)
Operating Temperature
-20°C to +85°C (-4°F to +185°F)

🔌 Pinout

The A4988 module has 16 pins arranged in two rows of 8. Here is the complete pinout:

Power Pins

Pin Description
VMOT
Motor power supply input (8V–35V DC). Powers the stepper motor.
GND (motor side)
Ground for the motor power supply.
VDD
Logic power supply input (3.3V–5V DC). Powers the internal logic.
GND (logic side)
Ground for the logic power supply.

Motor Output Pins

Pin Description
1A, 1B
Output connections to Coil 1 of the stepper motor.
2A, 2B
Output connections to Coil 2 of the stepper motor.

Control Pins

Pin Description
STEP
Each HIGH pulse on this pin moves the motor one microstep.
DIR
Sets the rotation direction. HIGH = one direction, LOW = the other.
EN (ENABLE)
Active LOW. When pulled LOW (or left unconnected), the driver is enabled. Pull HIGH to disable the motor outputs.

Microstepping Selection Pins

Pin Description
MS1
Microstep resolution selector (see table below).
MS2
Microstep resolution selector (see table below).
MS3
Microstep resolution selector (see table below).

Other Pins

Pin Description
SLEEP
Active LOW. Pull LOW to put the driver into sleep mode (saves power). Internally connected to RESET on many boards — if not using sleep, leave connected to RESET.
RESET
Active LOW. Pull LOW to reset the translator to the home position. Internally connected to SLEEP on many boards.

⚙️ Microstepping Resolution Table

The MS1, MS2, and MS3 pins control the microstepping resolution. All three pins have internal pull-down resistors, so leaving them unconnected defaults to full-step mode.

MS1 MS2 MS3 Microstep Resolution Steps/Rev (1.8° motor)
LOW
LOW
LOW
Full step
200
HIGH
LOW
LOW
Half step
400
LOW
HIGH
LOW
Quarter step
800
HIGH
HIGH
LOW
Eighth step
1,600
HIGH
HIGH
HIGH
Sixteenth step
3,200

Tip: Higher microstepping resolutions produce smoother, quieter motor operation but require faster step pulse rates to achieve the same rotational speed.


🔧 Setting the Current Limit (VREF)

This is the most important step before using your A4988 driver. Setting the current limit correctly protects both your motor and the driver from overheating or damage.

Why It Matters

If the current limit is set too high, the motor and driver will overheat and may be permanently damaged. If set too low, the motor won't have enough torque and may skip steps.

What You Need

  • A small flathead screwdriver (or ceramic/plastic trimmer tool)
  • A multimeter set to DC voltage mode

The Formula

The current limit is set by adjusting the onboard potentiometer (the small brass screw on top of the board). The relationship between the reference voltage (VREF) and the maximum current is:

VREF = 8 × I_MAX × R_CS

Where:

  • VREF = the voltage you measure on the potentiometer (in volts)
  • I_MAX = the desired maximum current per phase (in amps)
  • R_CS = the value of the current sense resistors on the board (in ohms)

For this module, the current sense resistors are typically 0.068Ω, so the formula simplifies to:

VREF = 8 × I_MAX × 0.068

Or rearranged to find the current:

I_MAX = VREF / (8 × 0.068) = VREF / 0.544

Common VREF Values

Desired Current (I_MAX) VREF Setting
0.5A
0.272V
0.8A
0.435V
1.0A
0.544V
1.2A
0.653V
1.5A
0.816V
2.0A
1.088V

⚠️ Important: Check your specific motor's datasheet for its rated current per phase. A good starting point is to set the current limit to 70–90% of the motor's rated current.

Step-by-Step Procedure

  1. Disconnect the stepper motor from the driver (or at minimum, do not send step pulses).
  2. Power the board — connect both VDD (3.3–5V logic supply) and VMOT (8–35V motor supply), along with their respective grounds.
  3. Set your multimeter to DC voltage mode.
  4. Measure VREF — place the positive (red) probe on the metal potentiometer screw on top of the board, and the negative (black) probe on a GND pin.
  5. Adjust the potentiometer — use a small screwdriver to turn the brass screw:
    • Clockwise = increases current limit (higher VREF)
    • Counter-clockwise = decreases current limit (lower VREF)
  6. Turn slowly and check the voltage reading until you reach your target VREF value.

⚠️ Caution: The potentiometer is delicate. Turn it gently and slowly. Over-tightening or forcing it can damage the potentiometer.


🔗 Wiring Guide — Arduino UNO

Basic Wiring Diagram

Below is the standard wiring configuration to connect the A4988 to an Arduino UNO and a bipolar stepper motor (e.g., NEMA 17):

Arduino UNO          A4988 Module          Stepper Motor
-----------          ------------          -------------
                     VMOT ◄──────────────── 8-35V DC Power Supply (+)
                     GND (motor) ◄──────── 8-35V DC Power Supply (-)
5V ────────────────► VDD
GND ───────────────► GND (logic)
Pin 3 ─────────────► STEP
Pin 2 ─────────────► DIR
                     1A ─────────────────► Coil 1 Wire A
                     1B ─────────────────► Coil 1 Wire B
                     2A ─────────────────► Coil 2 Wire A
                     2B ─────────────────► Coil 2 Wire B
                     RESET ──┐
                     SLEEP ──┘ (connect together)

Important Wiring Notes

  • Electrolytic capacitor (100µF, 25V or higher): Place a capacitor across VMOT and GND (motor side), as close to the board as possible. This protects the driver from voltage spikes generated by the motor.
  • RESET and SLEEP: If you are not using the SLEEP or RESET functions, connect these two pins together. This keeps the driver active and out of sleep mode.
  • ENABLE pin: Leave unconnected (it is active LOW with an internal pull-down, so the driver is enabled by default). Connect to an Arduino pin only if you need to programmatically enable/disable the motor outputs.
  • Never connect or disconnect the motor while the driver is powered on. This can cause voltage spikes that destroy the driver chip.

A4988 Schematic

A4988 Stepper Motor Driver Module Electrical Schematic

💻 Arduino Code Examples

Example 1: Basic Rotation (Full Steps)

This simple sketch rotates the motor one full revolution in each direction.


// A4988 Basic Stepper Motor Control
// Envistia Mall - envistiamall.com

const int stepPin = 3;   // STEP pin
const int dirPin = 2;    // DIR pin
const int stepsPerRev = 200;  // 200 steps = 1 revolution (1.8° motor)

void setup() {
  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
}

void loop() {
  // Rotate clockwise one full revolution
  digitalWrite(dirPin, HIGH);
  for (int i = 0; i < stepsPerRev; i++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(1000);   // Adjust for speed (lower = faster)
    digitalWrite(stepPin, LOW);
    delayMicroseconds(1000);
  }

  delay(1000);  // Pause 1 second

  // Rotate counter-clockwise one full revolution
  digitalWrite(dirPin, LOW);
  for (int i = 0; i < stepsPerRev; i++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(1000);
    digitalWrite(stepPin, LOW);
    delayMicroseconds(1000);
  }

  delay(1000);  // Pause 1 second
}
  

Example 2: Speed Control

Adjust the delayMicroseconds() value to change the motor speed. A smaller delay means faster rotation.


// A4988 Variable Speed Control
// Envistia Mall - envistiamall.com

const int stepPin = 3;
const int dirPin = 2;

void setup() {
  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
  digitalWrite(dirPin, HIGH);  // Set direction
}

void loop() {
  // Slow speed
  for (int i = 0; i < 200; i++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(2000);   // Slow
    digitalWrite(stepPin, LOW);
    delayMicroseconds(2000);
  }
  delay(500);

  // Medium speed
  for (int i = 0; i < 200; i++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(1000);   // Medium
    digitalWrite(stepPin, LOW);
    delayMicroseconds(1000);
  }
  delay(500);

  // Fast speed
  for (int i = 0; i < 200; i++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(500);    // Fast
    digitalWrite(stepPin, LOW);
    delayMicroseconds(500);
  }
  delay(500);
}

Example 3: Microstepping (1/16 Step)

To use microstepping, connect the MS1, MS2, and MS3 pins to HIGH (5V) for 1/16 step resolution. Then multiply the number of steps accordingly.


// A4988 Microstepping Example (1/16 step)
// Envistia Mall - envistiamall.com

const int stepPin = 3;
const int dirPin = 2;
const int stepsPerRev = 3200;  // 200 * 16 = 3200 microsteps per revolution

void setup() {
  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
  // MS1, MS2, MS3 should be wired to HIGH (5V) for 1/16 microstepping
}

void loop() {
  digitalWrite(dirPin, HIGH);

  // One full revolution in 1/16 microstepping
  for (int i = 0; i < stepsPerRev; i++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(500);
    digitalWrite(stepPin, LOW);
    delayMicroseconds(500);
  }

  delay(2000);
}

Example 4: Using the AccelStepper Library

For more advanced control including acceleration and deceleration, use the popular AccelStepper library. Install it via the Arduino IDE Library Manager (search for "AccelStepper").


// A4988 with AccelStepper Library
// Envistia Mall - envistiamall.com

#include 

// Define stepper motor connection type (1 = driver with STEP/DIR interface)
AccelStepper stepper(AccelStepper::DRIVER, 3, 2);  // STEP pin 3, DIR pin 2

void setup() {
  stepper.setMaxSpeed(1000);      // Maximum speed in steps/second
  stepper.setAcceleration(500);   // Acceleration in steps/second²
}

void loop() {
  stepper.moveTo(800);   // Move to position 800 steps
  stepper.runToPosition();
  delay(1000);

  stepper.moveTo(0);     // Return to position 0
  stepper.runToPosition();
  delay(1000);
}

🌡️ Heatsink and Cooling

The A4988 module typically comes with a small adhesive heatsink. Proper thermal management is important:

  • Without a heatsink: The driver can safely deliver approximately 1A continuous per phase.
  • With a heatsink: The driver can deliver up to 2A per phase, depending on airflow.
  • With a heatsink + active cooling (fan): Best performance for sustained high-current operation.

Installing the Heatsink

  1. Peel the adhesive backing off the heatsink.
  2. Carefully align it over the A4988 chip (the largest IC on the board).
  3. Press firmly to adhere.

Tip: If your motor draws more than 1A per phase, always use the heatsink. For currents approaching 2A, add a small fan for active airflow.


⚡ Power Supply Requirements

The A4988 requires two separate power supplies:

Supply Pin Voltage Range Purpose
Logic Supply
VDD
3.3V – 5V DC
Powers the driver's internal logic
Motor Supply
VMOT
8V – 35V DC
Powers the stepper motor

Important Power Notes

  • Always connect the motor supply (VMOT) with a 100µF electrolytic capacitor between VMOT and GND, placed as close to the driver board as possible. This capacitor absorbs voltage spikes from the motor's inductive load and prevents damage to the driver.
  • Do NOT exceed 35V on VMOT. Voltage spikes from the motor can push the actual voltage above the supply voltage, so leave some headroom (e.g., use a 12V supply rather than pushing close to 35V).
  • Connect the logic supply (VDD) before or at the same time as VMOT. Powering VMOT without VDD can damage the driver.
  • A 12V power supply is the most common choice for NEMA 17 motors and works well for most applications.

🔍 Identifying Stepper Motor Wires

If your stepper motor has 4 wires, it is a bipolar motor and is directly compatible with the A4988. You need to identify which two wires belong to each coil:

Method 1: Check the Datasheet

The motor's datasheet will list the wire colors for Coil A and Coil B.

Method 2: Use a Multimeter

  1. Set your multimeter to resistance (Ω) mode.
  2. Touch the probes to different pairs of wires.
  3. Two wires that show low resistance (typically 1–10Ω) belong to the same coil.
  4. The other two wires form the second coil.

Common NEMA 17 Wire Colors

Coil Wire 1 Wire 2
Coil 1
Black
Green
Coil 2
Red
Blue

Note: Wire colors vary by manufacturer. Always verify with a multimeter or datasheet.

6-Wire Stepper Motors

If your motor has 6 wires, it is a unipolar motor. You can still use it with the A4988 by leaving the center-tap wires unconnected and using only the four end wires (two per coil).


❓ Troubleshooting

Motor doesn't move

  • Verify all power connections (both VDD and VMOT must be connected).
  • Check that the ENABLE pin is LOW (or unconnected).
  • Ensure RESET and SLEEP are connected together (if not used individually).
  • Confirm the STEP pin is receiving pulses from your Arduino.
  • Check that the current limit (VREF) is set high enough for your motor.

Motor vibrates but doesn't rotate

  • The coil wires are likely swapped. Try swapping the two wires of one coil (e.g., swap 1A and 1B connections).
  • Verify the correct coil pairs using a multimeter.

Motor gets very hot

  • The current limit (VREF) is set too high. Reduce it using the potentiometer.
  • Motors do get warm during normal operation (up to ~50–60°C is typical), but they should not be too hot to touch for more than a second.

Driver chip gets very hot or burns out

  • Missing capacitor on VMOT — always install a 100µF capacitor.
  • Current limit set too high for the motor.
  • Motor was connected or disconnected while the driver was powered on — this causes destructive voltage spikes.
  • VMOT voltage exceeds 35V (including spikes).

Motor skips steps or loses position

  • Current limit (VREF) may be set too low — increase it gradually.
  • The step pulse rate may be too fast for the motor — increase the delay between pulses.
  • The motor may be mechanically overloaded — reduce the load or use a larger motor.
  • Try using microstepping for smoother operation.

Motor only turns in one direction

  • Check the DIR pin connection and ensure it is properly toggling between HIGH and LOW in your code.

⚠️ Important Safety Warnings

  1. Never connect or disconnect the stepper motor while the driver is powered. This will almost certainly destroy the A4988 chip.
  2. Always use a decoupling capacitor (100µF, 25V or higher) across VMOT and GND.
  3. Do not exceed 35V on the motor power supply.
  4. Set the current limit before running the motor to prevent overheating.
  5. Do not touch the driver chip or heatsink during operation — they can become very hot.
  6. Power VDD before or simultaneously with VMOT to avoid damaging the logic circuitry.

🛒 Where to Buy the A4988 Stepper Motor Driver

A4988 Stepper Motor Driver →


📚 Additional Resources


This guide is provided by Envistia Mall for educational and technical reference purposes. The manufacturer and Envistia LLC (dba Envistia Mall) are not responsible for any damages or losses resulting from the use of this product. Always follow proper electrical safety practices when working with electronic components. Specifications are based on manufacturer data and are subject to change without notice.


Share this guide:
in

🛒 Related Products

Find the components mentioned in this guide in our store.

Browse Products →