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.
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 |
Power Connections:
Motor Connections:
Control Connections:
#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
}
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.