Stufin
Home Quick Cart Profile

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

Buy Now

Driver IC

A4988

Maximum Current Rating

2A per phase

Microstepping Resolution

1/16 step

Logic Voltage

5V

Motor Voltage

8-35V

Operating Temperature

-20C to 85C

Dimensions

15mm x 20mm x 5mm

Package Includes

1 x A4988 Stepper Motor Driver Module with Heat Sink

1 x Connection Cable

Applications

3D Printers

CNC Machines

Robotics

Automation Systems

Other applications requiring precise stepper motor control

Pin Configuration

  • A4988 Stepper Motor Driver Module with Heat Sink For 3D Printer (Red)
  • Pin Description:
  • The A4988 Stepper Motor Driver Module has a total of 16 pins, which are divided into two rows of 8 pins each. The pins are labeled as follows:
  • Row 1 (Top Row):
  • 1. VDD (Voltage Supply):
  • This pin supplies power to the driver module.
  • Connect to a 5V to 35V power source (recommended 5V or 12V for most stepper motors).
  • 2. GND (Ground):
  • This pin serves as the ground connection for the driver module.
  • Connect to the negative terminal of the power source or a ground point on your system.
  • 3. VMOT (Motor Voltage):
  • This pin connects to the voltage supply for the stepper motor.
  • Typically, this pin is connected to the same power source as VDD (5V to 35V).
  • 4. EN (Enable):
  • This pin enables or disables the driver module.
  • Connect to a digital output on your microcontroller (e.g., Arduino, Raspberry Pi) to control the driver's state:
  • + High (1) or VCC: Enable the driver (default state).
  • + Low (0) or GND: Disable the driver (puts the motor in a low-power state).
  • 5. MS1 (Microstep Resolution 1):
  • This pin sets the microstep resolution for the stepper motor.
  • Connect to a digital output on your microcontroller to set the resolution:
  • + Low (0) or GND: Full step (1-step resolution).
  • + High (1) or VCC: Half step (2-step resolution).
  • 6. MS2 (Microstep Resolution 2):
  • This pin sets the microstep resolution for the stepper motor in conjunction with MS1.
  • Connect to a digital output on your microcontroller to set the resolution:
  • + Low (0) or GND: Quarter step (4-step resolution) when MS1 is high.
  • + High (1) or VCC: Eighth step (8-step resolution) when MS1 is high.
  • 7. MS3 (Microstep Resolution 3):
  • This pin sets the microstep resolution for the stepper motor in conjunction with MS1 and MS2.
  • Connect to a digital output on your microcontroller to set the resolution:
  • + Low (0) or GND: Sixteenth step (16-step resolution) when MS1 and MS2 are high.
  • + High (1) or VCC: Not used ( reserved for future use).
  • Row 2 (Bottom Row):
  • 8. DIR (Direction):
  • This pin sets the direction of the stepper motor rotation.
  • Connect to a digital output on your microcontroller to set the direction:
  • + Low (0) or GND: Clockwise rotation.
  • + High (1) or VCC: Counterclockwise rotation.
  • 9. STEP (Step):
  • This pin generates a step pulse to advance the stepper motor.
  • Connect to a digital output on your microcontroller to generate step pulses.
  • 10. SLEEP (Sleep):
  • This pin puts the driver module in a low-power sleep mode.
  • Connect to a digital output on your microcontroller to control the sleep mode:
  • + Low (0) or GND: Sleep mode enabled.
  • + High (1) or VCC: Sleep mode disabled (default state).
  • 11. RST (Reset):
  • This pin resets the driver module to its default state.
  • Connect to a digital output on your microcontroller to reset the driver:
  • + Low (0) or GND: Reset the driver (active low).
  • 12. A1 (coil A):
  • This pin connects to one terminal of the stepper motor's coil A.
  • Connect to the corresponding terminal on the stepper motor.
  • 13. A2 (coil A):
  • This pin connects to the other terminal of the stepper motor's coil A.
  • Connect to the corresponding terminal on the stepper motor.
  • 14. B1 (coil B):
  • This pin connects to one terminal of the stepper motor's coil B.
  • Connect to the corresponding terminal on the stepper motor.
  • 15. B2 (coil B):
  • This pin connects to the other terminal of the stepper motor's coil B.
  • Connect to the corresponding terminal on the stepper motor.
  • 16. GND (Ground):
  • This pin serves as an additional ground connection for the driver module.
  • Connect to the negative terminal of the power source or a ground point on your system.
  • Connection Structure:
  • To connect the A4988 Stepper Motor Driver Module to your microcontroller and stepper motor, follow this structure:
  • 1. Power Supply:
  • Connect VDD to a 5V to 35V power source.
  • Connect VMOT to the same power source (typically 5V or 12V for most stepper motors).
  • Connect GND to the negative terminal of the power source or a ground point on your system.
  • 2. Microcontroller Connections:
  • Connect EN to a digital output on your microcontroller to control the driver's state.
  • Connect MS1, MS2, and MS3 to digital outputs on your microcontroller to set the microstep resolution.
  • Connect DIR to a digital output on your microcontroller to set the direction of the stepper motor rotation.
  • Connect STEP to a digital output on your microcontroller to generate step pulses.
  • Connect SLEEP to a digital output on your microcontroller to control the sleep mode.
  • Connect RST to a digital output on your microcontroller to reset the driver.
  • 3. Stepper Motor Connections:
  • Connect A1 and A2 to the corresponding terminals on the stepper motor's coil A.
  • Connect B1 and B2 to the corresponding terminals on the stepper motor's coil B.
  • Important Notes:
  • Ensure proper heat dissipation by installing the heat sink provided with the module.
  • Use a suitable power supply and stepper motor combination to avoid overheating or damage to the driver module.
  • Refer to the datasheet for the specific stepper motor you are using to ensure correct wiring and configuration.
  • Always double-check your connections and programming before applying power to the system.

Code Examples

A4988 Stepper Motor Driver Module with Heat Sink For 3D Printer (Red)
===============================================================
Overview
-----------
The A4988 Stepper Motor Driver Module with Heat Sink is a popular and widely used driver for stepper motors in 3D printers and other applications. This module is based on the A4988 microstepping driver IC from Allegro, which provides precise control over stepper motors. The module comes with a heat sink to dissipate heat generated by the driver.
Features
Microstepping: 16 microsteps per full step
 Current rating: 1A per phase
 Voltage range: 8V to 35V
 5V logic compatible
 Heat sink for improved thermal performance
Pinout
----------
The module has the following pins:
VDD: 5V power supply
 GND: Ground
 DIR: Direction input (high = clockwise, low = counter-clockwise)
 STEP: Step input (rising edge triggers a step)
 MS1, MS2, MS3: Microstep resolution selection inputs
 ENABLE: Enable input (low = enabled, high = disabled)
 RESET: Reset input (low = reset, high = normal operation)
Example 1: Basic Stepper Motor Control using Arduino
---------------------------------------------------
In this example, we will use the A4988 module to control a stepper motor using an Arduino Uno board.
Hardware Requirements
A4988 Stepper Motor Driver Module
 Arduino Uno board
 Stepper motor
 Breadboard and jumper wires
Software Requirements
Arduino IDE
Code
```c++
const int dirPin = 2;  // Direction pin
const int stepPin = 3; // Step pin
const int enablePin = 4; // Enable pin
void setup() {
  pinMode(dirPin, OUTPUT);
  pinMode(stepPin, OUTPUT);
  pinMode(enablePin, OUTPUT);
  digitalWrite(enablePin, LOW); // Enable the driver
}
void loop() {
  // Set direction to clockwise
  digitalWrite(dirPin, HIGH);
  
  // Take 100 steps
  for (int i = 0; i < 100; i++) {
    digitalWrite(stepPin, HIGH);
    delay(1);
    digitalWrite(stepPin, LOW);
    delay(1);
  }
  
  // Set direction to counter-clockwise
  digitalWrite(dirPin, LOW);
  
  // Take 100 steps
  for (int i = 0; i < 100; i++) {
    digitalWrite(stepPin, HIGH);
    delay(1);
    digitalWrite(stepPin, LOW);
    delay(1);
  }
}
```
Example 2: Microstepping Control using Raspberry Pi (Python)
-----------------------------------------------------------
In this example, we will use the A4988 module to control a stepper motor using a Raspberry Pi board and Python.
Hardware Requirements
A4988 Stepper Motor Driver Module
 Raspberry Pi board
 Stepper motor
 Breadboard and jumper wires
Software Requirements
Python 3.x
 RPi.GPIO library
Code
```python
import RPi.GPIO as GPIO
import time
# Set up GPIO mode
GPIO.setmode(GPIO.BCM)
# Define pin numbers
DIR_PIN = 17
STEP_PIN = 23
ENABLE_PIN = 24
# Set up pins as output
GPIO.setup(DIR_PIN, GPIO.OUT)
GPIO.setup(STEP_PIN, GPIO.OUT)
GPIO.setup(ENABLE_PIN, GPIO.OUT)
# Enable the driver
GPIO.output(ENABLE_PIN, GPIO.LOW)
try:
    while True:
        # Set direction to clockwise
        GPIO.output(DIR_PIN, GPIO.HIGH)
        
        # Take 100 microsteps
        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 to counter-clockwise
        GPIO.output(DIR_PIN, GPIO.LOW)
        
        # Take 100 microsteps
        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:
    # Clean up GPIO
    GPIO.cleanup()
```
Note: In both examples, make sure to adjust the pin numbers and connections according to your specific setup. Additionally, consult the datasheet and documentation for the A4988 module and your microcontroller board for specific details on usage and configuration.