

The Adafruit DC+Stepper Motor HAT (Manufacturer Part ID: 2348) is a versatile motor driver board designed to control DC and stepper motors using a Raspberry Pi. It features multiple motor outputs, built-in power management, and an easy-to-use Python library for seamless programming. This HAT (Hardware Attached on Top) is ideal for robotics, automation, and other motor control applications.








The Adafruit DC+Stepper Motor HAT is built around the PCA9685 PWM driver and the TB6612 MOSFET driver, providing efficient and reliable motor control.
| Specification | Value |
|---|---|
| Operating Voltage | 5V (logic) via Raspberry Pi GPIO header |
| Motor Voltage Range | 5V to 12V (external power supply required) |
| Maximum DC Motor Current | 1.2A per channel (3A peak) |
| Stepper Motor Support | Bipolar or unipolar stepper motors |
| PWM Resolution | 12-bit |
| Communication Interface | I2C |
| I2C Address | 0x60 (default, configurable) |
| Dimensions | 65mm x 56mm x 13mm |
The HAT connects directly to the Raspberry Pi GPIO header and provides screw terminals for motor connections. Below is the pin configuration:
| Pin Name | Description |
|---|---|
| SDA | I2C Data Line |
| SCL | I2C Clock Line |
| 5V | Power supply for logic circuitry |
| GND | Ground |
| Terminal Label | Description |
|---|---|
| M1+ / M1- | DC Motor 1 positive/negative output |
| M2+ / M2- | DC Motor 2 positive/negative output |
| M3+ / M3- | DC Motor 3 positive/negative output |
| M4+ / M4- | DC Motor 4 positive/negative output |
| Terminal Label | Description |
|---|---|
| VIN | External motor power supply (5-12V) |
| GND | Ground connection |
sudo apt-get update
sudo apt-get install python3-pip
pip3 install adafruit-circuitpython-motorkit
The following Python code demonstrates how to control a DC motor and a stepper motor using the Adafruit DC+Stepper Motor HAT:
from adafruit_motorkit import MotorKit from time import sleep
kit = MotorKit()
print("Running DC Motor 1...") kit.motor1.throttle = 0.5 # Set speed (range: -1.0 to 1.0) sleep(2) # Run for 2 seconds kit.motor1.throttle = 0 # Stop the motor
print("Running Stepper Motor 1...") kit.stepper1.onestep(direction=1) # Move one step forward sleep(0.1) # Pause briefly kit.stepper1.onestep(direction=-1) # Move one step backward
0x60, but it can be changed by soldering the address jumpers.Motors Not Running
Raspberry Pi Not Detecting the HAT
raspi-config:sudo raspi-config
Navigate to "Interfacing Options" > "I2C" and enable it.Erratic Motor Behavior
Overheating
Q: Can I control more than 4 motors with this HAT?
A: Yes, by stacking multiple HATs and configuring unique I2C addresses for each.
Q: Does the HAT support servo motors?
A: No, this HAT is specifically designed for DC and stepper motors. For servo motors, consider using the Adafruit Servo HAT.
Q: Can I use this HAT with Arduino?
A: No, this HAT is designed specifically for Raspberry Pi and uses the I2C interface for communication.
Q: What is the maximum number of steps per second for stepper motors?
A: The maximum step rate depends on the motor and power supply but is typically around 1000 steps per second.
By following this documentation, you can effectively use the Adafruit DC+Stepper Motor HAT in your projects.