The TB6612FNG, manufactured by Pololu, is a dual H-bridge motor driver IC designed for controlling two DC motors or one stepper motor. It supports PWM (Pulse Width Modulation) for precise speed control and direction management. With a compact design and robust performance, the TB6612FNG is widely used in robotics, automation, and other motor control applications.
The TB6612FNG has 24 pins, but the most commonly used pins for motor control are listed below:
Pin Name | Pin Number | Description |
---|---|---|
VCC | 1 | Logic power supply (2.7V to 5.5V). |
VM | 4 | Motor power supply (2.5V to 13.5V). |
GND | 3, 5, 21 | Ground connection. |
AIN1 | 7 | Input signal for Motor A (controls direction). |
AIN2 | 8 | Input signal for Motor A (controls direction). |
PWMA | 9 | PWM input for Motor A (controls speed). |
BIN1 | 11 | Input signal for Motor B (controls direction). |
BIN2 | 12 | Input signal for Motor B (controls direction). |
PWMB | 13 | PWM input for Motor B (controls speed). |
STBY | 10 | Standby control pin (active HIGH to enable the IC). |
AO1, AO2 | 15, 16 | Output pins for Motor A. |
BO1, BO2 | 18, 19 | Output pins for Motor B. |
NC | Various | No connection (not used). |
Power Connections:
Motor Connections:
Control Signals:
PWM Frequency:
Below is an example of how to control two DC motors using the TB6612FNG and an Arduino UNO.
// Define motor control pins
#define AIN1 2 // Motor A direction pin 1
#define AIN2 3 // Motor A direction pin 2
#define PWMA 5 // Motor A speed (PWM) pin
#define BIN1 7 // Motor B direction pin 1
#define BIN2 8 // Motor B direction pin 2
#define PWMB 6 // Motor B speed (PWM) pin
#define STBY 4 // Standby pin
void setup() {
// Set motor control pins as outputs
pinMode(AIN1, OUTPUT);
pinMode(AIN2, OUTPUT);
pinMode(PWMA, OUTPUT);
pinMode(BIN1, OUTPUT);
pinMode(BIN2, OUTPUT);
pinMode(PWMB, OUTPUT);
pinMode(STBY, OUTPUT);
// Enable the motor driver by setting STBY HIGH
digitalWrite(STBY, HIGH);
}
void loop() {
// Example: Run Motor A forward at 50% speed
digitalWrite(AIN1, HIGH);
digitalWrite(AIN2, LOW);
analogWrite(PWMA, 128); // 50% duty cycle (128/255)
// Example: Run Motor B backward at 75% speed
digitalWrite(BIN1, LOW);
digitalWrite(BIN2, HIGH);
analogWrite(PWMB, 192); // 75% duty cycle (192/255)
delay(2000); // Run for 2 seconds
// Stop both motors
analogWrite(PWMA, 0);
analogWrite(PWMB, 0);
delay(2000); // Wait for 2 seconds
}
Motors Not Running:
Motor Running in the Wrong Direction:
Motor Speed Not Changing:
Overheating:
Can I use the TB6612FNG to drive a stepper motor? Yes, the TB6612FNG can drive a bipolar stepper motor by controlling the two H-bridges independently.
What happens if the STBY pin is left floating? The IC will remain in standby mode. Always pull the STBY pin HIGH to enable operation.
Is it possible to control the TB6612FNG with 3.3V logic? Yes, the TB6612FNG supports logic voltages as low as 2.7V, making it compatible with 3.3V systems.