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

How to Use SparkFun Motor Driver TB6612FNG (v11): Examples, Pinouts, and Specs

Image of SparkFun Motor Driver TB6612FNG (v11)Design with SparkFun Motor Driver TB6612FNG (v11) in Cirkit Designer

Introduction

The SparkFun Motor Driver TB6612FNG (v11) is a versatile and efficient dual H-bridge motor driver capable of controlling two DC motors independently or one bipolar stepper motor. Its compact form factor and ease of use make it an excellent choice for small robotics projects, educational purposes, and hobbyist applications.

Explore Projects Built with SparkFun Motor Driver TB6612FNG (v11)

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 Nano Controlled Robot with Ultrasonic Sensor and Dual Motor Drivers: A project utilizing SparkFun Motor Driver TB6612FNG (v11) 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
Image of Arduino-Controlled Dual Motor Driver with IR Sensing: A project utilizing SparkFun Motor Driver TB6612FNG (v11) 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

Common Applications and Use Cases

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Number Pin Name Description
1 VM Motor voltage supply, connects to the motor power source
2 VCC Logic voltage supply, connects to the control board (e.g., Arduino)
3 GND Ground pin
4 A01 Motor A output 1
5 A02 Motor A output 2
6 B01 Motor B output 1
7 B02 Motor B output 2
8 PWMA PWM input for motor A speed control
9 AIN1 Direction control for motor A
10 AIN2 Direction control for motor A
11 STBY Standby pin (active low)
12 BIN1 Direction control for motor B
13 BIN2 Direction control for motor B
14 PWMB PWM input for motor B speed control

Usage Instructions

How to Use the Component in a Circuit

  1. Power Connections:

    • Connect the motor power supply to the VM pin.
    • Connect the logic power supply from the control board to the VCC pin.
    • Ensure that the ground from the control board and the motor power supply are common and connected to the GND pin.
  2. Motor Connections:

    • Connect the two terminals of motor A to the A01 and A02 pins.
    • Connect the two terminals of motor B to the B01 and B02 pins.
  3. Control Connections:

    • Connect the control inputs (AIN1, AIN2, BIN1, BIN2) to the digital outputs on the control board.
    • Connect the PWM inputs (PWMA, PWMB) to the PWM-capable outputs on the control board for speed control.
    • The STBY pin must be driven high to take the driver out of standby mode.

Important Considerations and Best Practices

Troubleshooting and FAQs

Common Issues Users Might Face

Solutions and Tips for Troubleshooting

Example Code for Arduino UNO

// Define the connections to the TB6612FNG
const int PWMA = 3; // PWM control for motor A
const int AIN1 = 4; // Direction control for motor A
const int AIN2 = 5; // Direction control for motor A
const int STBY = 6; // Standby

void setup() {
  // Set all the motor control pins to outputs
  pinMode(PWMA, OUTPUT);
  pinMode(AIN1, OUTPUT);
  pinMode(AIN2, OUTPUT);
  pinMode(STBY, OUTPUT);

  // Take the motor driver out of standby
  digitalWrite(STBY, HIGH);
}

void loop() {
  // Set motor A to spin in one direction
  digitalWrite(AIN1, HIGH);
  digitalWrite(AIN2, LOW);
  analogWrite(PWMA, 128); // Set speed (0 to 255)

  delay(1000); // Run for 1 second

  // Set motor A to spin in the opposite direction
  digitalWrite(AIN1, LOW);
  digitalWrite(AIN2, HIGH);
  analogWrite(PWMA, 128); // Set speed (0 to 255)

  delay(1000); // Run for 1 second

  // Stop the motor
  digitalWrite(AIN1, LOW);
  digitalWrite(AIN2, LOW);
  analogWrite(PWMA, 0); // Set speed to zero (motor off)

  delay(1000); // Wait for 1 second
}

This example demonstrates basic forward and reverse control of a motor connected to motor driver A. Adjust the analogWrite value between 0 and 255 to control the speed of the motor.