Contact Sales & After-Sales Service

Contact & Quotation

  • Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
  • Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Drag & Drop Files, Choose Files to Upload You can upload up to 3 files.

Notes:
For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.

TB6612FNG Arduino: Modern Motor Driver Tutorial

After years of using the L298N for motor control projects, switching to the TB6612FNG felt like upgrading from a CRT monitor to an LED display. The difference isn’t just incremental—it’s transformational. The efficiency gains, reduced heat generation, and compact form factor make the TB6612FNG Arduino combination the smart choice for modern robotics projects.

When I first encountered the TB6612FNG on a client’s PCB layout, I was skeptical about abandoning the familiar L298N. But after measuring the voltage drop characteristics and thermal performance under real-world loads, the engineering advantages became impossible to ignore. This tutorial shares what I’ve learned implementing this MOSFET-based driver across dozens of Arduino motor control systems.

Why the TB6612FNG Outperforms Traditional Drivers

The TB6612FNG represents a fundamental shift in H-bridge motor driver design. Unlike the L298N’s bipolar junction transistor (BJT) architecture, the TB6612FNG uses MOSFET technology throughout the H-bridge circuit. This seemingly simple change cascades into significant performance improvements.

MOSFETs have dramatically lower on-resistance compared to BJTs. While the L298N wastes 2-4V across its internal transistors, the TB6612FNG typically drops only 0.2-0.5V at equivalent currents. For a 6V motor, this means the difference between delivering 4V (L298N) versus 5.7V (TB6612FNG) to your motor terminals. That’s 30% more usable voltage reaching your motors.

The thermal story is equally compelling. At 1A continuous current, the L298N dissipates approximately 4W as heat (2V drop × 2A across both channels). The TB6612FNG generates roughly 0.5W under identical conditions. This four-fold reduction in heat generation means smaller PCB footprints, no mandatory heatsinks for moderate loads, and improved reliability.

TB6612FNG Arduino Technical Specifications

Understanding the electrical limits prevents costly mistakes during design. Here’s the complete specification table:

ParameterSpecificationNotes
Motor Supply Voltage (VM)2.5V – 13.5VAbsolute maximum 15V
Logic Supply Voltage (VCC)2.7V – 5.5VCompatible with 3.3V and 5V logic
Continuous Output Current1.2A per channelPer H-bridge, ambient temp dependent
Peak Output Current3.2A per channelBrief transients only, milliseconds
Output Voltage Drop0.2V – 0.5VMOSFET saturation voltage
PWM Frequency RangeDC – 100kHzOptimal range 1kHz – 20kHz
Logic Input HIGH (VIH)VCC × 0.7 minimumTypically 3.5V for 5V logic
Logic Input LOW (VIL)VCC × 0.3 maximumTypically 1.5V for 5V logic
Thermal Shutdown175°C junction tempAutomatic protection
Standby Current1μA typicalSTBY pin LOW
Operating Temperature-20°C to 85°CAmbient temperature
Package TypeSSOP24Surface mount on breakout boards

Current Rating Reality Check

The 1.2A continuous rating deserves careful attention. This value assumes adequate thermal management and 25°C ambient temperature. In practice, continuous current capability decreases with rising ambient temperature and poor airflow.

For conservative design, I recommend limiting continuous current to 1A per channel when operating in enclosed spaces without forced cooling. The 3.2A peak rating applies to motor startup transients lasting under 100ms. Sustained operation at 3A will trigger thermal shutdown.

TB6612FNG Pinout and Connections

The TB6612FNG breakout modules organize pins logically: control inputs on one side, power and motor outputs on the opposite side. This separation simplifies PCB layout and reduces the risk of wiring errors.

Complete Pin Reference Table

Pin NameTypeFunctionVoltage Level
VMPower InputMotor power supply2.5V – 13.5V
VCCPower InputLogic power supply2.7V – 5.5V
GNDGroundCommon ground reference0V
STBYDigital InputStandby control (active HIGH)VCC level
AIN1Digital InputMotor A direction control 1VCC level
AIN2Digital InputMotor A direction control 2VCC level
PWMAPWM InputMotor A speed control0V – VCC
AO1Power OutputMotor A output terminal 1Variable
AO2Power OutputMotor A output terminal 2Variable
BIN1Digital InputMotor B direction control 1VCC level
BIN2Digital InputMotor B direction control 2VCC level
PWMBPWM InputMotor B speed control0V – VCC
BO1Power OutputMotor B output terminal 1Variable
BO2Power OutputMotor B output terminal 2Variable

The Critical STBY Pin

Here’s a detail that catches beginners constantly: the STBY (standby) pin must be driven HIGH for motors to operate. When STBY is LOW, the TB6612FNG enters low-power mode with all outputs disabled, drawing only 1μA.

Many breakout boards don’t include pull-up resistors on STBY, so leaving it floating results in non-functional motors. Your options:

  1. Connect STBY directly to VCC for always-on operation
  2. Connect STBY to an Arduino GPIO pin for software power management
  3. Add external 10kΩ pull-up resistor to VCC

For battery-powered applications, controlling STBY via GPIO enables significant power savings when motors aren’t needed.

Motor Control Logic and Truth Table

The TB6612FNG uses a straightforward two-input direction control scheme for each motor channel. Understanding this logic is essential for correct operation.

Motor Channel Control Truth Table

AIN1/BIN1AIN2/BIN2PWMA/PWMBMotor Action
HIGHLOWPWMForward rotation at PWM speed
LOWHIGHPWMReverse rotation at PWM speed
LOWLOWAnyShort brake (fast stop)
HIGHHIGHAnyShort brake (fast stop)
AnyAnyLOW (0V)Stop (coast)
N/AN/AN/ASTBY LOW = All outputs disabled

Short Brake vs Coast: When both direction inputs are equal (both HIGH or both LOW), the motor terminals short together through the low-resistance MOSFETs. This creates electromagnetic braking, rapidly stopping rotation. With PWM at 0V, the motor coasts freely to a stop via mechanical friction.

Wiring TB6612FNG Arduino Connection

Proper wiring prevents the majority of issues. Follow this systematic approach for reliable connections.

Basic Dual Motor Configuration

Power Connections:

– Battery/PSU Positive (6-12V) → VM

– Arduino 5V → VCC

– Battery GND → GND

– Arduino GND → GND (critical: common ground)

Motor A Control:

– Arduino Pin 5 (PWM) → PWMA

– Arduino Pin 7 (Digital) → AIN1

– Arduino Pin 8 (Digital) → AIN2

Motor B Control:

– Arduino Pin 6 (PWM) → PWMB

– Arduino Pin 9 (Digital) → BIN1

– Arduino Pin 10 (Digital) → BIN2

Standby Control:

– Arduino Pin 11 → STBY (or connect directly to VCC)

Motor Outputs:

– Motor A terminals → AO1, AO2

– Motor B terminals → BO1, BO2

Critical Grounding Rule: Arduino ground, TB6612FNG ground, and motor power supply ground MUST connect together. Missing common ground causes erratic behavior, random operation, and potential damage.

PWM Pin Requirements: PWMA and PWMB must connect to Arduino pins capable of PWM output (marked with ~ on Arduino UNO: pins 3, 5, 6, 9, 10, 11). Direction pins (AINx, BINx) can use any digital GPIO.

Basic TB6612FNG Arduino Code

Let’s implement motor control without external libraries first, demonstrating the fundamental principles.

// TB6612FNG Motor Driver – Basic Control

// Single motor example

// Motor A pin definitions

const int PWMA = 5;   // PWM pin for speed control

const int AIN1 = 7;   // Direction control

const int AIN2 = 8;   // Direction control

const int STBY = 11;  // Standby control

void setup() {

  // Configure all pins as outputs

  pinMode(PWMA, OUTPUT);

  pinMode(AIN1, OUTPUT);

  pinMode(AIN2, OUTPUT);

  pinMode(STBY, OUTPUT);

  // Enable the driver (exit standby mode)

  digitalWrite(STBY, HIGH);

  // Initialize motor stopped

  digitalWrite(AIN1, LOW);

  digitalWrite(AIN2, LOW);

  analogWrite(PWMA, 0);

}

void loop() {

  // Forward at 70% speed

  digitalWrite(AIN1, HIGH);

  digitalWrite(AIN2, LOW);

  analogWrite(PWMA, 179);  // 179/255 ≈ 70%

  delay(2000);

  // Stop (coast)

  analogWrite(PWMA, 0);

  delay(1000);

  // Reverse at 50% speed

  digitalWrite(AIN1, LOW);

  digitalWrite(AIN2, HIGH);

  analogWrite(PWMA, 128);  // 128/255 = 50%

  delay(2000);

  // Short brake

  digitalWrite(AIN1, HIGH);

  digitalWrite(AIN2, HIGH);

  delay(500);

  // Enter standby mode to save power

  digitalWrite(STBY, LOW);

  delay(1000);

  // Exit standby for next cycle

  digitalWrite(STBY, HIGH);

  delay(100);

}

Robot Car Implementation with SparkFun Library

For production projects, using SparkFun’s TB6612FNG library simplifies code and reduces errors. The library provides clean abstractions for motor control operations.

Library Installation

Open Arduino IDE → Sketch → Include Library → Manage Libraries. Search for “SparkFun TB6612FNG” and install the latest version.

Alternatively, download from GitHub:

https://github.com/sparkfun/SparkFun_TB6612FNG_Arduino_Library

Dual Motor Robot Car Code

#include <SparkFun_TB6612.h>

// Motor A connections

#define AIN1 7

#define AIN2 8

#define PWMA 5

// Motor B connections

#define BIN1 9

#define BIN2 10

#define PWMB 6

// Standby pin

#define STBY 11

// Motor offset values (1 or -1 to correct direction)

const int offsetA = 1;

const int offsetB = 1;

// Initialize motor objects

Motor motorLeft = Motor(AIN1, AIN2, PWMA, offsetA, STBY);

Motor motorRight = Motor(BIN1, BIN2, PWMB, offsetB, STBY);

void setup() {

  // Nothing required – library handles pin modes

}

void loop() {

  // Move forward for 2 seconds

  forward(motorLeft, motorRight, 200);

  delay(2000);

  // Turn right

  right(motorLeft, motorRight, 150);

  delay(800);

  // Move backward

  back(motorLeft, motorRight, 180);

  delay(2000);

  // Turn left

  left(motorLeft, motorRight, 150);

  delay(800);

  // Stop and brake

  brake(motorLeft, motorRight);

  delay(2000);

}

// Custom movement functions

void forward(Motor motor1, Motor motor2, int speed) {

  motor1.drive(speed);

  motor2.drive(speed);

}

void back(Motor motor1, Motor motor2, int speed) {

  motor1.drive(-speed);

  motor2.drive(-speed);

}

void left(Motor motor1, Motor motor2, int speed) {

  motor1.drive(-speed);

  motor2.drive(speed);

}

void right(Motor motor1, Motor motor2, int speed) {

  motor1.drive(speed);

  motor2.drive(-speed);

}

void stop() {

  motorLeft.drive(0);

  motorRight.drive(0);

}

void brake(Motor motor1, Motor motor2) {

  motor1.brake();

  motor2.brake();

}

Advanced Speed Control Techniques

PWM frequency affects motor performance in subtle ways. Arduino’s default PWM frequency varies by pin: approximately 490Hz for most pins, 980Hz for pins 5 and 6.

Optimizing PWM Frequency

For quieter, smoother operation, increase PWM frequency to 8kHz-31kHz range:

void setup() {

  // Increase PWM frequency on pins 5 & 6 to ~31kHz

  TCCR0B = TCCR0B & 0b11111000 | 0x01;

  // Increase PWM frequency on pins 9 & 10 to ~31kHz  

  TCCR1B = TCCR1B & 0b11111000 | 0x01;

  // Note: This affects delay() and millis() timing

  // Use micros() for accurate timing after modification

}

Higher frequencies reduce audible motor whine but slightly increase switching losses in the MOSFETs. For most applications, 8-16kHz represents the optimal balance.

Troubleshooting Common TB6612FNG Arduino Issues

Motors Don’t Run

Check STBY pin first: Verify STBY is HIGH. Measure with multimeter—should read VCC voltage (typically 5V). If STBY is floating or LOW, motors remain disabled.

Verify power supply: Measure VM pin voltage under load. Should remain within 2.5-13.5V range. Weak power supplies sag under motor startup current, causing brownouts.

Confirm PWM connections: PWMA and PWMB must connect to Arduino PWM-capable pins. Check your board’s pin capabilities—not all digital pins support PWM.

Motors Run Weakly

Insufficient supply voltage: Remember the minimal voltage drop. For 6V motors, supply at least 6.5V to VM to account for the 0.5V maximum drop at 1A.

Power supply current limiting: Motors draw peak current during startup and under load. Ensure power supply provides 2A+ continuous capacity for dual motor operation.

Code PWM value too low: Verify analogWrite() values. Remember 255 is full speed, 128 is half speed. Values below 50 may not generate enough torque to overcome friction.

Random Direction Changes

Ground loop problems: Verify all grounds connect together at a single point. Use thick wire (22AWG minimum) for ground connections. Poor grounds cause voltage reference fluctuations.

EMI interference: Motor switching generates electrical noise. Add 0.1μF ceramic capacitors across each motor terminal to suppress high-frequency noise.

Driver Overheating

Excessive current draw: Measure motor current with ammeter. If exceeding 1A continuous, motors are too large for this driver. Upgrade to higher-current driver or reduce load.

Inadequate cooling: While the TB6612FNG generates less heat than L298N, sustained 1A+ operation requires airflow or heatsinking. Add small aluminum heatsink to SSOP24 package.

TB6612FNG vs L298N Comparison

Engineers frequently ask which driver to choose. Here’s the objective comparison:

FeatureTB6612FNGL298N
TechnologyMOSFET H-BridgeBJT H-Bridge
Continuous Current1.2A per channel2A per channel
Peak Current3.2A3A
Voltage Drop0.2V – 0.5V2V – 4V
Operating Voltage2.5V – 13.5V5V – 46V
Efficiency~95%~70%
Power DissipationLowHigh
Heatsink RequiredOptionalMandatory
PCB FootprintSmall (20mm × 20mm typical)Large (45mm × 45mm typical)
Low Voltage MotorsExcellent (3V-6V)Poor (minimum 5V)
High Voltage MotorsLimited (13.5V max)Excellent (up to 46V)
CostModerateLow

Choose TB6612FNG when:

  • Using low-voltage motors (3V-12V)
  • Efficiency matters (battery-powered projects)
  • Space is limited
  • Heat generation is a concern
  • Motors draw under 1.2A continuous

Choose L298N when:

  • Using high-voltage motors (>13.5V)
  • Motors require >1.2A continuous current
  • Working with very high-power motors
  • Cost is the primary constraint
  • Voltage drop is less critical

Practical Applications

Line Following Robot

Combine motor control with sensor feedback for autonomous navigation:

// Line follower using IR sensors and TB6612FNG

const int leftSensor = A0;

const int rightSensor = A1;

void loop() {

  int leftValue = analogRead(leftSensor);

  int rightValue = analogRead(rightSensor);

  if (leftValue < 500 && rightValue < 500) {

    // Both sensors on white – move forward

    forward(motorLeft, motorRight, 200);

  } else if (leftValue > 500) {

    // Left sensor on black – turn left

    left(motorLeft, motorRight, 150);

  } else if (rightValue > 500) {

    // Right sensor on black – turn right

    right(motorLeft, motorRight, 150);

  }

}

Obstacle Avoiding Robot

Integrate ultrasonic sensor for collision avoidance:

// Obstacle avoidance with HC-SR04 ultrasonic sensor

#include <NewPing.h>

#define TRIGGER_PIN 12

#define ECHO_PIN 13

#define MAX_DISTANCE 200

NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);

void loop() {

  int distance = sonar.ping_cm();

  if (distance > 30 || distance == 0) {

    forward(motorLeft, motorRight, 180);

  } else {

    brake(motorLeft, motorRight);

    delay(500);

    back(motorLeft, motorRight, 150);

    delay(800);

    right(motorLeft, motorRight, 180);

    delay(600);

  }

}

Useful Resources and Downloads

Official Documentation

Arduino Libraries

Design Resources

Learning Tutorials

Component Sources

Frequently Asked Questions

Q: Can the TB6612FNG control stepper motors?

Yes, the TB6612FNG can control one bipolar stepper motor using both channels. Connect stepper coil A to AO1/AO2 and coil B to BO1/BO2. You’ll need to implement proper stepping sequences in your code, toggling the direction pins in the correct order to create rotation. The SparkFun library doesn’t include stepper functions, so you’ll need to write custom stepping logic or use a dedicated stepper library adapted for the TB6612FNG pinout.

Q: Why does my motor direction reverse unexpectedly?

This typically indicates either loose wire connections that intermittently make contact, or EMI from the motors coupling into the control wires. Solutions: First, ensure all screw terminal connections are tight. Second, add 0.1μF ceramic capacitors directly across motor terminals to suppress electrical noise. Third, use twisted pair wiring for the AINx/BINx connections to reduce electromagnetic interference pickup. Finally, verify your code logic—accidental pin state changes can cause apparent direction reversals.

Q: Can I parallel both channels to drive a single high-current motor?

No, paralleling channels is not recommended and not supported by Toshiba. The TB6612FNG lacks the necessary current-sharing circuitry to ensure equal distribution between paralleled outputs. Small timing differences in MOSFET switching can cause one channel to carry most of the current, leading to thermal shutdown or damage. For motors requiring >1.2A continuous, use a higher-current driver like the BTS7960 (43A capability) or VNH5019 (12A capability).

Q: What’s the minimum motor voltage the TB6612FNG can drive effectively?

The TB6612FNG works excellently with motors as low as 3V, making it ideal for small hobby motors and micro gearmotors. The 0.2-0.5V voltage drop means a 3V motor receives 2.5-2.8V at full PWM—still 83-93% of rated voltage. This is where the TB6612FNG shines compared to the L298N, which would drop the 3V supply below the motor’s operating threshold entirely. For 1.5V motors, expect marginal performance as the voltage drop becomes significant relative to supply voltage.

Q: How do I implement soft start to prevent current spikes?

Implement gradual PWM ramping in your code rather than instantly switching to full speed. This reduces inrush current and mechanical stress on gears:

void softStart(Motor motor, int targetSpeed, int rampTime) {

  int steps = 50;

  int delayPerStep = rampTime / steps;

  for (int speed = 0; speed <= targetSpeed; speed += (targetSpeed / steps)) {

    motor.drive(speed);

    delay(delayPerStep);

  }

}

This approach gradually increases current draw, preventing voltage sag on the power supply and reducing gear wear in robotic applications.

Conclusion

The TB6612FNG Arduino combination represents modern motor control engineering done right. MOSFET technology delivers the efficiency and thermal performance that BJT-based drivers simply cannot match. The minimal voltage drop preserves precious battery capacity in portable projects, while the compact form factor enables smaller, lighter robot designs.

From a PCB engineering perspective, the TB6612FNG demonstrates how component-level improvements cascade into system-level advantages. Lower power dissipation means simplified thermal management, reduced PCB copper requirements, and improved reliability. The integrated protection features—thermal shutdown, undervoltage lockout—provide defense-in-depth against common failure modes.

Understanding the current limitations is critical for successful implementation. The 1.2A continuous rating is real and must be respected in thermal budget calculations. For motors drawing 800mA-1A continuously, add heatsinking and ensure adequate airflow. Beyond 1.2A sustained, migrate to higher-current drivers.

The TB6612FNG excels in the 3V-12V motor range where most hobby robotics, educational platforms, and prototype systems operate. This sweet spot encompasses TT motors, BO motors, micro gearmotors, and small brushed motors that power the majority of DIY projects. Combined with Arduino’s accessible programming environment and the mature SparkFun library, the TB6612FNG enables reliable motor control with minimal development effort.

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Sales & After-Sales Service

Contact & Quotation

  • Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.

  • Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.

Drag & Drop Files, Choose Files to Upload You can upload up to 3 files.

Notes:
For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.