8V to 35V
8V to 35V
Up to 2A per phase
1/16, 1/8, 1/4, 1/2, full step
Yes
Yes
-20C to 85C
15.5mm (W) x 20.5mm (L) x 1.5mm (H)
Pinout
Input voltage (8V to 35V)
Ground
Enable (active low)
MS1, MS2, MS3 | Microstepping selection pins |
Direction control pin
Step control pin
Motor voltage input
A1, A2 | Phase A motor connections |
B1, B2 | Phase 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.
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.