Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use Adafruit DC+Stepper Motor HAT: Examples, Pinouts, and Specs

Image of Adafruit DC+Stepper Motor HAT
Cirkit Designer LogoDesign with Adafruit DC+Stepper Motor HAT in Cirkit Designer

Introduction

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.

Explore Projects Built with Adafruit DC+Stepper Motor HAT

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino UNO and Adafruit Motor Shield Controlled Stepper Motor System with Push Button Interface
Image of Sophmore Vending Machine Project: A project utilizing Adafruit DC+Stepper Motor HAT in a practical application
This circuit consists of an Arduino UNO connected to an Adafruit Motor Shield, which controls two bipolar stepper motors. Additionally, multiple push buttons and an LED with a current-limiting resistor are connected to the Arduino for user input and visual feedback.
Cirkit Designer LogoOpen Project in Cirkit Designer
Wi-Fi Controlled Environmental Monitoring System with Dual Stepper Motor Valve Actuation
Image of MVP : A project utilizing Adafruit DC+Stepper Motor HAT in a practical application
This circuit features two 28BYJ-48 stepper motors controlled by ULN2003A breakout boards, interfaced with a NodeMCU V3 ESP8266 microcontroller. The NodeMCU collects environmental data from a DHT11 temperature and humidity sensor and an MQ-135 air quality sensor. The microcontroller uses WiFi for connectivity and controls the stepper motors based on the sensor inputs, likely for regulating environmental conditions.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino-Controlled Stepper Motor with A4988 Driver and EEPROM Position Saving
Image of stepper-: A project utilizing Adafruit DC+Stepper Motor HAT in a practical application
This circuit controls a bipolar stepper motor using an A4988 stepper motor driver, interfaced with an Arduino UNO microcontroller. The Arduino receives input from multiple pushbuttons to control the motor's direction, step size, and to save or move to preset positions. Additional components like capacitors and resistors are used for power supply decoupling and LED current limiting, while an OLED display is likely used to provide user feedback or display the motor's status.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Nano-Controlled Environment Monitoring and Stepper Motor System
Image of AUTOMATIC CURTAIN: A project utilizing Adafruit DC+Stepper Motor HAT in a practical application
This circuit is designed to control a Nema 17 stepper motor using an A4988 stepper motor driver, with an Arduino Nano as the microcontroller. The Arduino receives input from two potentiometers and a pushbutton, and it interfaces with a DHT11 temperature and humidity sensor and an HC-SR04 ultrasonic sensor. Power is managed by a 12V power supply, a power supply module, and a step-down buck converter, with a rocker switch to control power flow.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Adafruit DC+Stepper Motor HAT

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Sophmore Vending Machine Project: A project utilizing Adafruit DC+Stepper Motor HAT in a practical application
Arduino UNO and Adafruit Motor Shield Controlled Stepper Motor System with Push Button Interface
This circuit consists of an Arduino UNO connected to an Adafruit Motor Shield, which controls two bipolar stepper motors. Additionally, multiple push buttons and an LED with a current-limiting resistor are connected to the Arduino for user input and visual feedback.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of MVP : A project utilizing Adafruit DC+Stepper Motor HAT in a practical application
Wi-Fi Controlled Environmental Monitoring System with Dual Stepper Motor Valve Actuation
This circuit features two 28BYJ-48 stepper motors controlled by ULN2003A breakout boards, interfaced with a NodeMCU V3 ESP8266 microcontroller. The NodeMCU collects environmental data from a DHT11 temperature and humidity sensor and an MQ-135 air quality sensor. The microcontroller uses WiFi for connectivity and controls the stepper motors based on the sensor inputs, likely for regulating environmental conditions.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of stepper-: A project utilizing Adafruit DC+Stepper Motor HAT in a practical application
Arduino-Controlled Stepper Motor with A4988 Driver and EEPROM Position Saving
This circuit controls a bipolar stepper motor using an A4988 stepper motor driver, interfaced with an Arduino UNO microcontroller. The Arduino receives input from multiple pushbuttons to control the motor's direction, step size, and to save or move to preset positions. Additional components like capacitors and resistors are used for power supply decoupling and LED current limiting, while an OLED display is likely used to provide user feedback or display the motor's status.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of AUTOMATIC CURTAIN: A project utilizing Adafruit DC+Stepper Motor HAT in a practical application
Arduino Nano-Controlled Environment Monitoring and Stepper Motor System
This circuit is designed to control a Nema 17 stepper motor using an A4988 stepper motor driver, with an Arduino Nano as the microcontroller. The Arduino receives input from two potentiometers and a pushbutton, and it interfaces with a DHT11 temperature and humidity sensor and an HC-SR04 ultrasonic sensor. Power is managed by a 12V power supply, a power supply module, and a step-down buck converter, with a rocker switch to control power flow.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Robotics projects requiring precise motor control
  • Automated conveyor systems
  • DIY motorized devices
  • Educational projects for learning motor control with Raspberry Pi
  • Multi-motor control in IoT applications

Technical Specifications

The Adafruit DC+Stepper Motor HAT is built around the PCA9685 PWM driver and the TB6612 MOSFET driver, providing efficient and reliable motor control.

Key Technical Details

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

Pin Configuration and Descriptions

The HAT connects directly to the Raspberry Pi GPIO header and provides screw terminals for motor connections. Below is the pin configuration:

GPIO Header Pins

Pin Name Description
SDA I2C Data Line
SCL I2C Clock Line
5V Power supply for logic circuitry
GND Ground

Motor Output Terminals

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

Power Input Terminals

Terminal Label Description
VIN External motor power supply (5-12V)
GND Ground connection

Usage Instructions

How to Use the Component in a Circuit

  1. Attach the HAT to the Raspberry Pi: Align the GPIO header on the HAT with the Raspberry Pi GPIO pins and press gently to secure the connection.
  2. Connect Motors: Use the screw terminals to connect DC or stepper motors to the labeled outputs (M1, M2, M3, M4).
  3. Provide Power: Connect an external power supply (5-12V) to the VIN and GND terminals to power the motors.
  4. Install Software: Install the Adafruit Python library for motor control using the following commands:
    sudo apt-get update
    sudo apt-get install python3-pip
    pip3 install adafruit-circuitpython-motorkit
    
  5. Write and Run Code: Use the Adafruit MotorKit library to control the motors. See the example code below.

Example Code for Raspberry Pi

The following Python code demonstrates how to control a DC motor and a stepper motor using the Adafruit DC+Stepper Motor HAT:


Import the necessary library for motor control

from adafruit_motorkit import MotorKit from time import sleep

Initialize the MotorKit object

kit = MotorKit()

Example: Controlling a DC motor (Motor 1)

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

Example: Controlling a stepper motor (Stepper 1)

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


Important Considerations and Best Practices

  • Power Supply: Ensure the external power supply matches the voltage and current requirements of your motors.
  • Heat Dissipation: The HAT can get warm during operation. Ensure proper ventilation or use a heatsink if necessary.
  • I2C Address Conflicts: If using multiple I2C devices, ensure their addresses do not conflict. The HAT's default address is 0x60, but it can be changed by soldering the address jumpers.
  • Motor Compatibility: Verify that your motors are compatible with the HAT's voltage and current ratings.

Troubleshooting and FAQs

Common Issues and Solutions

  1. Motors Not Running

    • Cause: Insufficient power supply.
    • Solution: Check the external power supply and ensure it meets the motor's voltage and current requirements.
  2. Raspberry Pi Not Detecting the HAT

    • Cause: I2C not enabled on the Raspberry Pi.
    • Solution: Enable I2C using raspi-config:
      sudo raspi-config
      
      Navigate to "Interfacing Options" > "I2C" and enable it.
  3. Erratic Motor Behavior

    • Cause: Loose connections or incorrect wiring.
    • Solution: Double-check all connections, ensuring they are secure and correctly wired.
  4. Overheating

    • Cause: Prolonged high-current operation.
    • Solution: Reduce motor load or add a heatsink to the HAT.

FAQs

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.