Stufin
Home Quick Cart Profile

A4988 Stepper Motor Driver Module with Heat Sink For 3D Printer (Green)

Buy Now

Input Voltage

8V to 35V

Output Current

Up to 2A per phase

Microstepping Resolution

1/16, 1/8, 1/4, 1/2, full step

Adjustable Current Limit

Yes

Overcurrent Protection

Yes

Operating Temperature

-20C to 85C

Dimension

15.5mm (W) x 20.5mm (L) x 1.5mm (H)

Pinout

VCC

Input voltage (8V to 35V)

GND

Ground

EN

Enable (active low)

MS1, MS2, MS3Microstepping selection pins

DIR

Direction control pin

STEP

Step control pin

VM

Motor voltage input

A1, A2Phase A motor connections
B1, B2Phase B motor connections

Applications

The A4988 Stepper Motor Driver Module with Heat Sink is designed for use in 3D printing systems, CNC machines, and other applications that require precise motor control. Its compact design, high performance, and reliability make it an ideal choice for a wide range of applications.

Pin Configuration

  • A4988 Stepper Motor Driver Module with Heat Sink For 3D Printer (Green) - Pinout Explanation
  • The A4988 Stepper Motor Driver Module is a popular and widely used component in 3D printing and CNC applications. It's essential to understand the pinout and connections to ensure proper usage and avoid damage to the module or connected components.
  • Pinout:
  • The A4988 Stepper Motor Driver Module has a total of 16 pins, divided into two rows of 8 pins each. Below is a detailed explanation of each pin:
  • Row 1 (left to right):
  • 1. VCC (Input Voltage): This pin is used to supply power to the module. Typically, a voltage range of 8-35V is recommended, with a maximum current rating of 2A.
  • 2. GND (Ground): The ground pin is used to provide a common reference point for the module and connected components.
  • 3. EN (Enable): This pin is used to enable or disable the stepper motor driver. A logic high (VCC) enables the driver, while a logic low (GND) disables it.
  • 4. DIR (Direction): This pin determines the direction of the stepper motor rotation. A logic high (VCC) sets the direction to clockwise, while a logic low (GND) sets it to counter-clockwise.
  • 5. STEP (Step): This pin is used to control the stepper motor's step sequence. A pulse input on this pin advances the motor one step.
  • 6. MS1 (Microstep Resolution 1): This pin is used to set the microstep resolution of the stepper motor. See the Microstep Resolution table below for details.
  • 7. MS2 (Microstep Resolution 2): This pin is used in conjunction with MS1 to set the microstep resolution of the stepper motor.
  • 8. RST (Reset): This pin is used to reset the stepper motor driver to its default state.
  • Row 2 (left to right):
  • 1. MOT_A+ (Motor A Positive): This pin is connected to one terminal of the stepper motor coil A.
  • 2. MOT_A- (Motor A Negative): This pin is connected to the other terminal of the stepper motor coil A.
  • 3. MOT_B+ (Motor B Positive): This pin is connected to one terminal of the stepper motor coil B.
  • 4. MOT_B- (Motor B Negative): This pin is connected to the other terminal of the stepper motor coil B.
  • 5. VM (Voltage Input for Motor): This pin is used to supply power to the stepper motor. Typically, the same voltage as VCC is used.
  • 6. SG (Sense Ground): This pin is used to provide a sense ground for the module's internal circuitry.
  • 7. NC (Not Connected): This pin is not connected internally and should be left unconnected.
  • 8. NC (Not Connected): This pin is not connected internally and should be left unconnected.
  • Microstep Resolution Table:
  • | MS1 | MS2 | Microstep Resolution |
  • | --- | --- | --- |
  • | 0 | 0 | Full Step (default) |
  • | 0 | 1 | Half Step |
  • | 1 | 0 | Quarter Step |
  • | 1 | 1 | Eighth Step |
  • | 0 | 1 | Sixteenth Step (requires additional hardware) |
  • Connection Structure:
  • To connect the A4988 Stepper Motor Driver Module to a stepper motor and microcontroller, follow this structure:
  • Connect VCC to a power source (e.g., a 12V or 24V power supply).
  • Connect GND to the power source's ground and the microcontroller's ground.
  • Connect EN to a digital output pin on the microcontroller to control the driver's enable/disable state.
  • Connect DIR to a digital output pin on the microcontroller to control the stepper motor's direction.
  • Connect STEP to a digital output pin on the microcontroller to control the stepper motor's step sequence.
  • Connect MS1 and MS2 to digital output pins on the microcontroller to set the microstep resolution.
  • Connect MOT_A+ and MOT_A- to the stepper motor's coil A terminals.
  • Connect MOT_B+ and MOT_B- to the stepper motor's coil B terminals.
  • Connect VM to the power source (same voltage as VCC).
  • Leave SG unconnected.
  • Leave NC pins unconnected.
  • Important Notes:
  • Ensure proper heat dissipation for the module by attaching a heat sink and keeping it away from other components that may generate heat.
  • Use a suitable capacitor (e.g., 100nF) to decouple the power supply lines to the module.
  • Follow proper wiring and soldering practices to avoid damage to the module or connected components.
  • By following this documentation, you should be able to properly connect and use the A4988 Stepper Motor Driver Module with your microcontroller and stepper motor.

Code Examples

A4988 Stepper Motor Driver Module with Heat Sink For 3D Printer (Green)
=============================================================
Overview
-----------
The A4988 Stepper Motor Driver Module with Heat Sink is a popular and widely used module for controlling stepper motors in 3D printers, CNC machines, and other applications. This module is based on the A4988 microstepping driver chip, which provides high precision and smooth motor control.
Features
Microstepping: Supports up to 16 microsteps per full step, allowing for precise motor control.
 Adjustable current limit: Allows for adjustable current limiting to prevent overheating and motor damage.
 Over-temperature protection: Built-in thermal protection to prevent overheating.
 Heat sink: Includes a heat sink for efficient heat dissipation.
Pinout and Connections
------------------------
The module has the following pins:
VDD (5V): Power supply input.
 GND: Ground connection.
 STEP: Step input signal.
 DIR: Direction input signal.
 MS1, MS2, MS3: Microstep selection inputs.
 ENABLE: Enable input (active low).
 SLEEP: Sleep input (active low).
 RESET: Reset input (active low).
  Motor output: 4-pin header for connecting the stepper motor.
Code Examples
----------------
Here are some code examples demonstrating how to use the A4988 Stepper Motor Driver Module:
### Example 1: Basic Stepper Motor Control (Arduino)
This example demonstrates how to control a stepper motor using the A4988 module with an Arduino board.
```cpp
const int stepPin = 2;  // STEP pin
const int dirPin = 3;  // DIR pin
const int enablePin = 4; // ENABLE pin
void setup() {
  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
  pinMode(enablePin, OUTPUT);
  digitalWrite(enablePin, LOW); // Enable the driver
}
void loop() {
  // Set direction
  digitalWrite(dirPin, HIGH); // Clockwise
  for (int i = 0; i < 100; i++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(500);
    digitalWrite(stepPin, LOW);
    delayMicroseconds(500);
  }
// Set direction
  digitalWrite(dirPin, LOW); // Counterclockwise
  for (int i = 0; i < 100; i++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(500);
    digitalWrite(stepPin, LOW);
    delayMicroseconds(500);
  }
}
```
### Example 2: Stepper Motor Control with Microstepping (Raspberry Pi)
This example demonstrates how to control a stepper motor using the A4988 module with a Raspberry Pi board, utilizing microstepping for precise motor control.
```python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
step_pin = 17
dir_pin = 23
ms1_pin = 24
ms2_pin = 25
GPIO.setup(step_pin, GPIO.OUT)
GPIO.setup(dir_pin, GPIO.OUT)
GPIO.setup(ms1_pin, GPIO.OUT)
GPIO.setup(ms2_pin, GPIO.OUT)
# Set microstepping mode (16 microsteps per full step)
GPIO.output(ms1_pin, GPIO.HIGH)
GPIO.output(ms2_pin, GPIO.HIGH)
try:
    while True:
        # Set direction
        GPIO.output(dir_pin, GPIO.HIGH)
        for i in range(100):
            GPIO.output(step_pin, GPIO.HIGH)
            time.sleep(0.001)
            GPIO.output(step_pin, GPIO.LOW)
            time.sleep(0.001)
# Set direction
        GPIO.output(dir_pin, GPIO.LOW)
        for i in range(100):
            GPIO.output(step_pin, GPIO.HIGH)
            time.sleep(0.001)
            GPIO.output(step_pin, GPIO.LOW)
            time.sleep(0.001)
except KeyboardInterrupt:
    GPIO.cleanup()
```
Note: These examples are for illustration purposes only and may require modifications to work with your specific setup and application. Always ensure proper connections and motor configuration to avoid damaging the module or motor.