TB6612FNG Motor Driver Guide and Comparison
What Is the TB6612FNG Motor Driver?
The TB6612FNG is a compact and efficient dual-channel motor driver designed to control two DC motors or a single bipolar stepper motor with precision and minimal heat buildup. Its small size, high efficiency, and robust features make it a favored choice over older drivers like the L298N, especially in space-constrained or power-sensitive projects.
Key Features
- Controls two DC motors (1.2A continuous current per channel, 3.2A peak) or one bipolar stepper motor
- Wide motor supply range (2.5V–13.5V), ideal for battery-powered setups
- Built-in thermal shutdown and short-circuit protection for reliable operation
- Supports PWM frequencies up to 100kHz for smooth and quiet speed adjustments
- Low standby current (less than 1µA) for energy-saving applications
Typical Use Cases
This driver shines in robotics, remote-controlled vehicles, and DIY automation projects where size, efficiency, and control precision matter.
Connecting the TB6612FNG
Control Pins
- PWMA/PWMB: PWM inputs for motor speed control (connect to microcontroller PWM-capable pins, e.g., Arduino pins 3, 5, 6)
- AIN1/AIN2: Direction control for Motor A (use any digital pins, e.g., Arduino pins 8, 9)
- BIN1/BIN2: Direction control for Motor B (use additional digital pins, e.g., Arduino pins 10, 11)
- STBY: Standby pin (set HIGH to activate the driver; LOW puts it in sleep mode)
Power Connections
- VCC: Logic voltage (3.3V–5V) to power the driver’s internal circuitry (match your microcontroller’s voltage)
- VM: Motor power supply (4.5V–13.5V, separate from logic supply for cleaner operation)
- GND: Common ground (tie all grounds—logic, power, and microcontroller—together)
- AO1/AO2, BO1/BO2: Motor output pins (connect directly to motor terminals)
⚠️ Always use decoupling capacitors (e.g., 100µF electrolytic + 0.1µF ceramic) across VM and GND near the driver to filter noise and ensure stable performance under load.
Pinout Diagram Suggestion
For a clearer setup, refer to the TB6612FNG datasheet or create a simple wiring diagram showing connections to a microcontroller like an Arduino Uno.
Motor Control Logic
The TB6612FNG uses logic inputs to dictate motor behavior. Direction is set via AIN1/AIN2 (Motor A) or BIN1/BIN2 (Motor B), while speed is adjusted with PWM signals:
AIN1 | AIN2 | Motor A Action |
---|---|---|
HIGH | LOW | Forward |
LOW | HIGH | Reverse |
LOW | LOW | Coast (free spin, motor disconnected) |
HIGH | HIGH | Brake (active stop, motor shorted) |
Note: The same logic applies to Motor B with BIN1/BIN2. PWM on PWMA/PWMB scales the voltage, controlling speed from 0% to 100%.
Arduino Example Code
#define AIN1 9 // Motor A direction pin 1
#define AIN2 8 // Motor A direction pin 2
#define PWMA 10 // Motor A speed control
#define STBY 7 // Standby pin
void setup() {
pinMode(AIN1, OUTPUT);
pinMode(AIN2, OUTPUT);
pinMode(PWMA, OUTPUT);
pinMode(STBY, OUTPUT);
digitalWrite(STBY, HIGH); // Enable driver
Serial.begin(9600); // For debugging
Serial.println("Motor driver ready");
}
void loop() {
// Rotate forward at 50% speed
digitalWrite(AIN1, HIGH);
digitalWrite(AIN2, LOW);
analogWrite(PWMA, 128); // 0-255 range (50% duty cycle)
Serial.println("Forward at 50%");
delay(2000);
// Rotate reverse at 75% speed
digitalWrite(AIN1, LOW);
digitalWrite(AIN2, HIGH);
analogWrite(PWMA, 192); // 75% speed
Serial.println("Reverse at 75%");
delay(2000);
// Stop motor with braking
digitalWrite(AIN1, HIGH);
digitalWrite(AIN2, HIGH);
analogWrite(PWMA, 0);
Serial.println("Braking");
delay(1000);
}
Code Explanation
- PWM Values: Range from 0 (0% speed) to 255 (100% speed); adjust for desired output
- Standby Pin: HIGH enables the driver; LOW conserves power by disabling outputs
- Braking vs. Coasting: HIGH/HIGH or LOW/LOW on direction pins brakes or coasts, respectively
- Serial Output: Added for debugging and monitoring motor states
Real-World Application: Simple Robot Car
Use the TB6612FNG to power a two-wheeled robot car:
- Hardware: Connect Motor A to the left wheel and Motor B to the right wheel. Power VM with a 7.4V LiPo battery and VCC with Arduino’s 5V pin.
- Control: Program forward motion (AIN1 HIGH, AIN2 LOW; BIN1 HIGH, BIN2 LOW), turns (adjust PWM per motor), and stops (brake or coast).
- Enhancement: Add an ultrasonic sensor (e.g., HC-SR04) to avoid obstacles by reversing or turning when objects are detected.
This setup is lightweight, efficient, and perfect for beginner robotics projects.
Troubleshooting Guide
- Motor Not Spinning
- Verify STBY is HIGH, test PWM signal with a multimeter or oscilloscope, confirm VM voltage and common ground
- Driver Overheating
- Lower motor current (check specs), ensure no stalls or short circuits, confirm VM is 13.5V or less
- Erratic Behavior
- Install decoupling capacitors near the driver, secure all connections, match VCC to microcontroller logic level
- One Motor Works, Other Doesn’t
- Swap motor connections to test outputs (AO1/AO2 vs. BO1/BO2), check pin assignments in code
FAQ: TB6612FNG vs. L298N
- Why is the TB6612FNG more efficient than the L298N?
- The TB6612FNG offers up to 90% efficiency, compared to the L298N's 40–50%. This reduces power loss and heat generation, making it ideal for battery-powered or compact designs.
- Does the TB6612FNG support higher PWM frequencies?
- Yes, the TB6612FNG supports PWM frequencies up to 100kHz, enabling smoother and quieter motor operation than the L298N, which typically supports lower frequencies.
- What makes the TB6612FNG more compact?
- It comes in a space-saving SOP24 surface-mount package, making it perfect for tight layouts. In contrast, the L298N uses a larger through-hole package that can be bulky in small projects.
- Is voltage drop lower with the TB6612FNG?
- Yes. The TB6612FNG has a low voltage drop of about 0.5V, while the L298N can drop around 2V. This means the motor receives more usable voltage and performs better at lower input levels.
- Does the TB6612FNG have built-in protection?
- Absolutely. It features thermal shutdown and short-circuit protection, reducing the need for external protection components and increasing overall circuit reliability.
- When should I still consider the L298N?
- If you need to drive motors that require more than 1.2A continuous current or operate at voltages up to 46V, the L298N might be more suitable despite its inefficiencies.