What Is the TB6612FNG Motor Driver?
The TB6612FNG is a compact and efficient dual-channel motor driver capable of controlling two DC motors or a stepper motor with high precision and low heat generation.
Connecting the TB6612FNG
- PWMA/PWMB: Motor speed control
- AIN1/AIN2: Control Motor A direction
- BIN1/BIN2: Control Motor B direction
- VCC: Logic power (3.3V–5V)
- VM: Motor voltage (4.5V–13.5V)
Arduino Example Code
#define AIN1 9
#define AIN2 8
#define PWMA 10
void setup() {
pinMode(AIN1, OUTPUT);
pinMode(AIN2, OUTPUT);
pinMode(PWMA, OUTPUT);
}
void loop() {
digitalWrite(AIN1, HIGH);
digitalWrite(AIN2, LOW);
analogWrite(PWMA, 128);
delay(2000);
digitalWrite(AIN1, LOW);
digitalWrite(AIN2, HIGH);
analogWrite(PWMA, 128);
delay(2000);
}