TB6612FNG Dual DC Motor Driver
TB6612FNG Dual DC Motor Driver
The TB6612FNG is a dual DC motor driver integrated circuit (IC) designed to control two independent DC motors. This versatile component is commonly used in robotics, automation, and IoT projects that require precise motor control.
The TB6612FNG motor driver IC is designed to operate two DC motors independently, allowing for forward, backward, and stop control. The IC features two full-bridge drivers, each capable of driving a single DC motor. The device can handle motor currents up to 1.2A per channel, making it suitable for small to medium-sized motors.
The IC operates on a single power supply voltage (VM) ranging from 4.5V to 13.5V, and it has built-in overcurrent protection, thermal shutdown, and undervoltage lockout to ensure safe and reliable operation.
The TB6612FNG has a total of 24 pins, with the following pinout |
| Pin # | Function |
| --- | --- |
| 1-4 | Motor A Output (OUT1-OUT4) |
| 5-8 | Motor B Output (OUT5-OUT8) |
| 9-10 | Input Logic (IN1-IN2) for Motor A |
| 11-12 | Input Logic (IN3-IN4) for Motor B |
| 13 | Enable Input (EN) |
| 14 | VCC (Power Supply) |
| 15 | GND (Ground) |
| 16-17 | Sense Lines for Motor A (VSENSA, GND) |
| 18-19 | Sense Lines for Motor B (VSENSB, GND) |
| 20-23 | Unused (NC) |
| 24 | Thermal Pads (TP) |
The TB6612FNG dual DC motor driver IC is commonly used in |
Robotics and automation projects
IoT devices with motor control requirements
Small to medium-sized motor control systems
Battery-powered devices with motor control needs
Home appliances with motor control requirements
The TB6612FNG is a versatile and reliable dual DC motor driver IC that offers a range of features and benefits for motor control applications. Its compact size, high current capability, and built-in protection features make it an ideal choice for a wide range of applications.
TB6612FNG Dual DC Motor Driver Documentation
Overview
The TB6612FNG is a dual DC motor driver IC that can operate two DC motors independently with a wide range of voltage and current ratings. It features a compact package, low power consumption, and high accuracy, making it suitable for various robotics, automation, and IoT applications.
Pinout and Pin Functions
The TB6612FNG has a total of 16 pins, with the following pin functions:
| Pin No. | Pin Name | Function |
| --- | --- | --- |
| 1 | VCC | Power supply (5-15V) |
| 2 | GND | Ground |
| 3 | AIN1 | Input 1 for Motor A |
| 4 | AIN2 | Input 2 for Motor A |
| 5 | PWMA | PWM input for Motor A |
| 6 | AOUT1 | Output 1 for Motor A |
| 7 | AOUT2 | Output 2 for Motor A |
| 8 | BIN1 | Input 1 for Motor B |
| 9 | BIN2 | Input 2 for Motor B |
| 10 | PWMB | PWM input for Motor B |
| 11 | BOUT1 | Output 1 for Motor B |
| 12 | BOUT2 | Output 2 for Motor B |
| 13 | STBY | Standby pin (active low) |
| 14 | NC | No connection |
| 15 | NC | No connection |
| 16 | NC | No connection |
Block Diagram
The block diagram of the TB6612FNG is as follows:
```
+---------------+
| VCC |
+---------------+
|
|
v
+---------------+ +---------------+
| Input Stage | | Motor A |
| (AIN1, AIN2) | | (AOUT1, AOUT2)|
+---------------+ +---------------+
|
|
v
+---------------+ +---------------+
| PWM Stage | | Motor B |
| (PWMA) | | (BOUT1, BOUT2)|
+---------------+ +---------------+
|
|
v
+---------------+
| Standby |
| (STBY) |
+---------------+
```
Example Code
### Example 1: Basic Motor Control using Arduino
In this example, we will use the TB6612FNG to control two DC motors using an Arduino board.
```c++
const int AIN1 = 2; // Input 1 for Motor A
const int AIN2 = 3; // Input 2 for Motor A
const int PWMA = 4; // PWM input for Motor A
const int BIN1 = 5; // Input 1 for Motor B
const int BIN2 = 6; // Input 2 for Motor B
const int PWMB = 7; // PWM input for Motor B
void setup() {
pinMode(AIN1, OUTPUT);
pinMode(AIN2, OUTPUT);
pinMode(PWMA, OUTPUT);
pinMode(BIN1, OUTPUT);
pinMode(BIN2, OUTPUT);
pinMode(PWMB, OUTPUT);
}
void loop() {
// Set Motor A to rotate clockwise
digitalWrite(AIN1, HIGH);
digitalWrite(AIN2, LOW);
analogWrite(PWMA, 128); // 50% PWM duty cycle
// Set Motor B to rotate counterclockwise
digitalWrite(BIN1, LOW);
digitalWrite(BIN2, HIGH);
analogWrite(PWMB, 128); // 50% PWM duty cycle
delay(1000);
// Set Motor A to rotate counterclockwise
digitalWrite(AIN1, LOW);
digitalWrite(AIN2, HIGH);
analogWrite(PWMA, 128); // 50% PWM duty cycle
// Set Motor B to rotate clockwise
digitalWrite(BIN1, HIGH);
digitalWrite(BIN2, LOW);
analogWrite(PWMB, 128); // 50% PWM duty cycle
delay(1000);
}
```
### Example 2: PWM Speed Control using Raspberry Pi
In this example, we will use the TB6612FNG to control the speed of two DC motors using a Raspberry Pi.
```python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
# Define motor pins
AIN1 = 17
AIN2 = 23
PWMA = 24
BIN1 = 25
BIN2 = 12
PWMB = 16
# Set up GPIO pins
GPIO.setup(AIN1, GPIO.OUT)
GPIO.setup(AIN2, GPIO.OUT)
GPIO.setup(PWMA, GPIO.OUT)
GPIO.setup(BIN1, GPIO.OUT)
GPIO.setup(BIN2, GPIO.OUT)
GPIO.setup(PWMB, GPIO.OUT)
# Set initial motor speeds to 0
GPIO.PWM(PWMA, 50).start(0)
GPIO.PWM(PWMB, 50).start(0)
try:
while True:
# Set Motor A to rotate clockwise at 50% speed
GPIO.output(AIN1, GPIO.HIGH)
GPIO.output(AIN2, GPIO.LOW)
GPIO.PWM(PWMA).ChangeDutyCycle(50)
# Set Motor B to rotate counterclockwise at 25% speed
GPIO.output(BIN1, GPIO.LOW)
GPIO.output(BIN2, GPIO.HIGH)
GPIO.PWM(PWMB).ChangeDutyCycle(25)
time.sleep(1)
# Set Motor A to rotate counterclockwise at 75% speed
GPIO.output(AIN1, GPIO.LOW)
GPIO.output(AIN2, GPIO.HIGH)
GPIO.PWM(PWMA).ChangeDutyCycle(75)
# Set Motor B to rotate clockwise at 50% speed
GPIO.output(BIN1, GPIO.HIGH)
GPIO.output(BIN2, GPIO.LOW)
GPIO.PWM(PWMB).ChangeDutyCycle(50)
time.sleep(1)
except KeyboardInterrupt:
# Stop motors and clean up
GPIO.PWM(PWMA).stop()
GPIO.PWM(PWMB).stop()
GPIO.cleanup()
```
These examples demonstrate the basic usage of the TB6612FNG dual DC motor driver IC in various contexts. The code can be modified and extended to suit specific application requirements.