Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use Adafruit TB6612 DC and Stepper Motor Driver: Examples, Pinouts, and Specs

Image of Adafruit TB6612 DC and Stepper Motor DriverDesign with Adafruit TB6612 DC and Stepper Motor Driver in Cirkit Designer

Introduction

The Adafruit TB6612 DC and Stepper Motor Driver is a versatile and efficient motor driver designed for controlling both DC and stepper motors. It utilizes a dual-channel H-bridge configuration, allowing for independent control of two motors. This driver is ideal for projects requiring precise motor control, such as robotics, automated machinery, and custom vehicles. Its compatibility with microcontrollers like the Arduino UNO makes it a popular choice for hobbyists and educators alike.

Explore Projects Built with Adafruit TB6612 DC and Stepper Motor Driver

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 Arduino-Controlled Nema 17 Stepper Motor with Soil Moisture Sensing: A project utilizing Adafruit TB6612 DC and Stepper Motor Driver in a practical application
Arduino-Controlled Nema 17 Stepper Motor with Soil Moisture Sensing

This circuit controls a Nema 17 stepper motor using an Adafruit TB6612 motor driver, which is interfaced with an Arduino Leonardo microcontroller. The Arduino provides PWM signals to the motor driver to control the motor's speed and direction. Additionally, the circuit includes an Adafruit STEMMA Soil Sensor for moisture measurement, which communicates with the Arduino via I2C, and a 9V battery that powers the system.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Number Name Description
1 VMOT Motor power supply (4.5V to 13.5V)
2 GND Ground connection
3 A01 Motor A output 1
4 A02 Motor A output 2
5 B01 Motor B output 1
6 B02 Motor B output 2
7 VCC Logic power supply (2.7V to 5.5V)
8 STBY Standby control (active high)
9 PWMA PWM input for motor A
10 AIN2 Direction control for motor A
11 AIN1 Direction control for motor A
12 BIN1 Direction control for motor B
13 BIN2 Direction control for motor B
14 PWMB PWM input for motor B

Usage Instructions

How to Use the Component in a Circuit

  1. Power Connections:

    • Connect VMOT to your motor power supply (4.5V to 13.5V).
    • Connect VCC to your logic power supply (2.7V to 5.5V).
    • Connect GND to the common ground of your power supplies and microcontroller.
  2. Motor Connections:

    • Connect your motor leads to A01 and A02 for motor A, and B01 and B02 for motor B.
  3. Control Connections:

    • Connect STBY to a digital pin on your microcontroller to enable or disable the driver.
    • Connect PWMA and PWMB to PWM-capable digital pins for speed control.
    • Connect AIN1, AIN2, BIN1, and BIN2 to digital pins for direction control.

Important Considerations and Best Practices

Example Code for Arduino UNO

#include <Arduino.h>

// Define the control pins
#define STBY 10
#define PWMA 9
#define AIN1 8
#define AIN2 7
#define PWMB 6
#define BIN1 5
#define BIN2 4

void setup() {
  // Set all the motor control pins to outputs
  pinMode(STBY, OUTPUT);
  pinMode(PWMA, OUTPUT);
  pinMode(AIN1, OUTPUT);
  pinMode(AIN2, OUTPUT);
  pinMode(PWMB, OUTPUT);
  pinMode(BIN1, OUTPUT);
  pinMode(BIN2, OUTPUT);

  // Take the motor driver out of standby
  digitalWrite(STBY, HIGH);
}

void loop() {
  // Drive motor A forward at full speed
  analogWrite(PWMA, 255); // Full speed
  digitalWrite(AIN1, HIGH);
  digitalWrite(AIN2, LOW);

  // Drive motor B backward at half speed
  analogWrite(PWMB, 128); // Half speed
  digitalWrite(BIN1, LOW);
  digitalWrite(BIN2, HIGH);

  delay(2000); // Run for 2 seconds

  // Stop both motors
  digitalWrite(STBY, LOW); // Put the driver in standby mode
  delay(1000); // Wait for 1 second
}

Troubleshooting and FAQs

Common Issues Users Might Face

Solutions and Tips for Troubleshooting

FAQs

Q: Can I drive two stepper motors with this driver? A: Yes, you can control two stepper motors by properly configuring the direction and step inputs for each motor.

Q: What should I do if the motor driver gets hot? A: Check the current draw of the motors and ensure it's within the limit. Add a heat sink or improve airflow if necessary.

Q: Can I use this motor driver with a Raspberry Pi or other microcontrollers? A: Yes, as long as the logic voltage is compatible and you can provide PWM signals, you can use this driver with various microcontrollers.