Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use TB6612FNG motor driver: Examples, Pinouts, and Specs

Image of TB6612FNG motor driverDesign with TB6612FNG motor driver in Cirkit Designer

Introduction

The TB6612FNG 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. The IC is compact, efficient, and includes built-in protection features such as overcurrent and thermal shutdown, making it ideal for a wide range of motor control applications.

Explore Projects Built with TB6612FNG motor driver

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Arduino-Controlled Dual Motor Driver with IR Sensing: A project utilizing TB6612FNG motor driver in a practical application
Arduino-Controlled Dual Motor Driver with IR Sensing

This circuit controls two DC motors using a TB6612FNG motor driver, which is interfaced with an Arduino Mega 2560 microcontroller. The Arduino provides PWM signals to control the speed and direction of the motors. Multiple IR sensors are connected to the Arduino's analog inputs, likely for sensing the environment or for line-following capabilities in a robot.

Open Project in Cirkit Designer
Image of Arduino Nano Controlled Robot with Ultrasonic Sensor and Dual Motor Drivers: A project utilizing TB6612FNG motor driver in a practical application
Arduino Nano Controlled Robot with Ultrasonic Sensor and Dual Motor Drivers

This circuit features an Arduino Nano microcontroller interfaced with a TB6612FNG motor driver to control two DC Mini Metal Gear Motors. It also includes an HC-SR04 Ultrasonic Sensor for distance measurement, a 5 channel IR sensor for line tracking, and a Servomotor SG90 for positioning tasks. The system is powered by a 12V battery, with the Arduino Nano managing sensor inputs and motor outputs to perform tasks such as navigation or automation.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

The TB6612FNG has 20 pins. Below is the pinout and description:

Pin Number Pin Name Description
1 VCC Logic power supply (2.7V to 5.5V).
2 GND Ground connection.
3 AIN1 Input 1 for Motor A. Controls direction when combined with AIN2.
4 AIN2 Input 2 for Motor A. Controls direction when combined with AIN1.
5 PWMA PWM input for Motor A. Controls speed.
6 A01 Output 1 for Motor A. Connect to one terminal of Motor A.
7 A02 Output 2 for Motor A. Connect to the other terminal of Motor A.
8 VM Motor power supply (4.5V to 13.5V).
9 STBY Standby control. Pull HIGH to enable the IC, LOW to disable.
10 BIN1 Input 1 for Motor B. Controls direction when combined with BIN2.
11 BIN2 Input 2 for Motor B. Controls direction when combined with BIN1.
12 PWMB PWM input for Motor B. Controls speed.
13 B01 Output 1 for Motor B. Connect to one terminal of Motor B.
14 B02 Output 2 for Motor B. Connect to the other terminal of Motor B.
15 NC No connection.
16 NC No connection.
17 NC No connection.
18 NC No connection.
19 NC No connection.
20 NC No connection.

Usage Instructions

How to Use the TB6612FNG in a Circuit

  1. Power Connections:

    • Connect the logic power supply (2.7V to 5.5V) to the VCC pin.
    • Connect the motor power supply (4.5V to 13.5V) to the VM pin.
    • Connect the GND pin to the ground of the circuit.
  2. Motor Connections:

    • For Motor A, connect its terminals to A01 and A02.
    • For Motor B, connect its terminals to B01 and B02.
  3. Control Inputs:

    • Use AIN1 and AIN2 to control the direction of Motor A.
    • Use BIN1 and BIN2 to control the direction of Motor B.
    • Apply PWM signals to PWMA and PWMB to control the speed of Motor A and Motor B, respectively.
  4. Standby Mode:

    • Pull the STBY pin HIGH to enable the IC.
    • Pull the STBY pin LOW to disable the IC and reduce power consumption.

Important Considerations and Best Practices

Example Code for Arduino UNO

Below is an example of how to control two DC motors using the TB6612FNG with an Arduino UNO:

// Define motor control pins
#define AIN1 7  // Motor A direction pin 1
#define AIN2 8  // Motor A direction pin 2
#define PWMA 9  // Motor A speed (PWM) pin
#define BIN1 10 // Motor B direction pin 1
#define BIN2 11 // Motor B direction pin 2
#define PWMB 3  // 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 pulling STBY HIGH
  digitalWrite(STBY, HIGH);
}

void loop() {
  // Example: Run Motor A forward at 50% speed
  digitalWrite(AIN1, HIGH); // Set direction
  digitalWrite(AIN2, LOW);
  analogWrite(PWMA, 128);   // Set speed (0-255)

  // Example: Run Motor B backward at 75% speed
  digitalWrite(BIN1, LOW);  // Set direction
  digitalWrite(BIN2, HIGH);
  analogWrite(PWMB, 192);   // Set speed (0-255)

  delay(2000); // Run motors for 2 seconds

  // Stop both motors
  analogWrite(PWMA, 0);
  analogWrite(PWMB, 0);

  delay(2000); // Wait for 2 seconds
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. Motors Not Running:

    • Ensure the STBY pin is pulled HIGH to enable the IC.
    • Verify that the motor power supply (VM) is connected and within the specified range.
    • Check the PWM signal and ensure it is being generated correctly.
  2. Overheating:

    • Ensure the current drawn by the motors does not exceed the IC's maximum ratings.
    • Use proper cooling methods, such as heatsinks or fans, if necessary.
  3. Erratic Motor Behavior:

    • Check for loose or incorrect wiring connections.
    • Add decoupling capacitors near the power supply pins to reduce noise.
  4. Arduino Code Not Working:

    • Verify that the pin numbers in the code match your circuit connections.
    • Ensure the Arduino is powered and properly connected to the motor driver.

FAQs

Q: Can the TB6612FNG drive stepper motors?
A: Yes, the TB6612FNG can drive a single stepper motor by controlling its coils using the two H-bridges.

Q: What happens if the IC overheats?
A: The TB6612FNG has a built-in thermal shutdown feature that disables the outputs to protect the IC from damage.

Q: Can I use the TB6612FNG with a 3.3V microcontroller?
A: Yes, the TB6612FNG supports logic levels as low as 2.7V, making it compatible with 3.3V microcontrollers.