Part

Motor driver, TB6612FNG

Two MOSFET H bridges for two motors. STBY must be high, and PWM low is a brake.

See every part
  • 16 pins
  • In 4 projects
  • In 2 lessons
Drawn live by the editor's own code, at the size you see it.
At a glance

The Motor driver, TB6612FNG in brief

What it is, and where it sits on the bench.

The TB6612FNG is a dual H-bridge on a small breakout, the driver in the SparkFun Inventor’s Kit. Its bridges are MOSFETs with about 0.25 ohm a side, half a volt across a bridge at one amp where an L293D loses more than two, and its logic runs from 2.7 to 5.5 volts, so an ESP32 or Pico can drive it directly. Each channel takes a PWM pin and two direction pins, AIN1 and AIN2 for motor A, while VM takes a separate 2.5 to 13.5 volt motor supply with the grounds joined. Mokxi follows Toshiba’s truth table row for row, including the row people miss: PWM low is a short brake, not a coast, so analogWrite() alternates driving and braking. Every input has a 200 kilohm pull-down inside, so an unwired STBY holds the whole chip in standby, the commonest reason a real board does nothing. With a battery on VM the bridge joins the analog solve and the pack sags under the motors. The SparkFun_TB6612 library’s drive() and brake() calls compile. The current limits, thermal shutdown and flyback diodes are not modeled.

Family
Outputs
Pins
16
Pins

16 pins

Named as the editor names them, so a wire lands where you expect it.

Pin
What it does
PWMA
Each channel's speed: analogWrite here.
AIN2
Channel A's direction.
AIN1
Channel A's direction.
STBY
Must be HIGH, or both channels are off.
BIN1
Channel B's direction.
BIN2
Channel B's direction.
PWMB
Each channel's speed: analogWrite here.
GND1
Three grounds, strapped together on the board.
VM
Motor supply, 2.5 V to 13.5 V (15 V absolute maximum).
VCC
Logic supply, 2.7 V to 5.5 V.
GND2
Three grounds, strapped together on the board.
AO1
Motor A.
AO2
Motor A.
BO2
Motor B.
BO1
Motor B.
GND3
Three grounds, strapped together on the board.
How to use it

How to use the TB6612FNG with an Arduino

The robot drive example wires channel A to pins 2 and 4 for direction and pin 5 for speed, channel B to pins 7, 8 and 6, and STBY to pin 9. VCC takes the Uno’s 5 volts, VM takes a four-AA pack, and the GND pins join both. With SparkFun_TB6612.h, a Motor takes AIN1, AIN2, PWMA, an offset of 1 or -1 and STBY, and drive() takes -255 to 255.

brake() shorts the motor and stops it hard, while standby() pulls STBY low and lets both motors coast. If nothing moves at all, check STBY first: left unwired, the chip’s own pull-down holds it in standby. Watch the pack’s readout as the motors start, since the bridge draws its current from VM.

Part pin
Board pin
PWMA
Pin 5
AIN1
Pin 2
AIN2
Pin 4
STBY
Pin 9
BIN1
Pin 7
BIN2
Pin 8
PWMB
Pin 6
VCC
5 V
VM
Battery pack red lead
GND
GND and the pack’s black lead

Its logic runs from 2.7 to 5.5 volts, so an ESP32 or a Pico can drive the inputs directly with VCC on 3.3 volts.

Arduino Uno: TB6612 robot drivelive0.000 s 0.00x
Click to open it in the editor
This is the simulator itself, running here. Click anything to open it in the editor.
Two motors with the SparkFun library
#include <SparkFun_TB6612.h>
Motor leftMotor = Motor(2, 4, 5, 1, 9);   // AIN1, AIN2, PWMA, offset, STBY
Motor rightMotor = Motor(7, 8, 6, 1, 9);  // BIN1, BIN2, PWMB, offset, STBY
void setup() {}
void loop() {
  forward(leftMotor, rightMotor, 255);
  delay(1500);
  brake(leftMotor, rightMotor);
  delay(1000);
}
How it is modeled

What is true about the Motor driver, TB6612FNG, here

In its help article’s own words: what the simulation gets right, and where it stops.

Modeled

From Toshiba's datasheet:

The truth table, row for row, including the brake on PWM low.

Internal pull-downs. Every input has 200 k to ground inside, so an unwired STBY reads LOW and the chip does nothing at all. That is the first fault on every forum thread about this board.

The volts it keeps. 0.5 V at 1 A across the two transistors of a bridge, which is 0.25 ohm a side.

Where the current comes from. With a battery or a bench supply on VM, the bridge is part of the analog solve, so the motors' current comes out of the motor rail and a battery sags under it.

The supplies. Under 2.7 V of logic, under 2.5 V of motor supply or over the 15 V absolute maximum, the outputs are dead.

Not modeled

The 1.2 A average and 3.2 A peak current limits and the thermal shutdown behind them, the dead time, the 100 kHz PWM ceiling, and the flyback diodes.

From TB6612FNG motor driver, in full.

Projects

See the Motor driver, TB6612FNG in a project

4 built-in projects use it. Each opens in the editor, already wired.

Lessons

Where it turns up in a lesson

2 lessons place it in their own circuits.

Boards

The boards it is shown on

This board has a built-in project with the Motor driver, TB6612FNG in it.

Libraries

Arduino libraries for the Motor driver, TB6612FNG

Built in, so the sketch compiles with nothing to install. Each page has the calls, the wiring and an example to run.

Wire up the Motor driver, TB6612FNG

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.