L298N vs TB6612FNG Motor Driver: Which One Should Your Robot Use?

Almost every beginner robot kit sold in India ships with the red L298N module with its large black heatsink. It works, but many builders notice that their 6 V motors feel weak and the driver gets hot. The small TB6612FNG breakout board does the same job for two motors with far less loss, but it has lower voltage and current limits.

This tutorial explains what an H-bridge does, why these two chips behave so differently, how to wire each one to an Arduino Uno, and how to write a motor function that works with both. By the end you can pick the right driver from your motor's voltage and current ratings.

What an H-Bridge Does

An H-bridge is four switches arranged around the motor in the shape of the letter H. Closing the top-left and bottom-right switches pushes current through the motor in one direction; closing the other diagonal pair reverses it. Switching the pair on and off rapidly with PWM sets the average voltage and therefore the speed. Closing both bottom switches shorts the motor terminals, which brakes it quickly.

        V_motor
     +----+----+
     |         |
    S1        S3
     |         |
     +--(M)----+
     |         |
    S2        S4
     |         |
     +----+----+
         GND

S1+S4 on -> forward    S3+S2 on -> reverse    S2+S4 on -> brake

Both chips contain two complete H-bridges, so one board drives the left and right motors of a 2WD robot. The difference is the type of switch. The L298N uses bipolar transistors, and the TB6612FNG uses MOSFETs.

Key Differences

A bipolar transistor in saturation always drops a certain voltage, and in an H-bridge current passes through two of them. The L298 datasheet gives a total drop of roughly 2 V or more at 1 A, so a 7.4 V battery may deliver only around 5 V to the motor, and the lost power becomes heat. A MOSFET behaves like a small resistor when on, so at the currents a small robot uses, the TB6612FNG wastes much less voltage.

FeatureL298N moduleTB6612FNG breakout
Switch typeBipolar transistorsMOSFETs
Motor supplyUp to 46 V (chip rating)Up to 15 V (VM pin)
Continuous currentAbout 2 A per channel with heatsink1.2 A per channel average, 3.2 A peak
Voltage lost in driverAbout 2 V or more at 1 ASmall at these currents
Logic supply5 V, from onboard regulator or external2.7 V to 5.5 V on VCC
Control pins per motorENA (PWM), IN1, IN2PWMA, AIN1, AIN2, plus shared STBY
SizeLarge, with heatsinkVery small breakout

The rule of thumb is simple. For small BO or N20 motors running from 6 V to 12 V and drawing under about 1 A each, use the TB6612FNG. For larger motors that need more current or a supply above 15 V, the L298N or a modern MOSFET driver rated for that current is required.

Wiring to an Arduino Uno

The code below uses the same Arduino pins for both drivers so that you can swap the board without changing software. Pins 5 and 6 provide PWM for speed.

Arduino pinL298NTB6612FNG
5 (PWM)ENA (remove ENA jumper)PWMA
7IN1AIN1
8IN2AIN2
6 (PWM)ENB (remove ENB jumper)PWMB
9IN3BIN1
10IN4BIN2
4Not usedSTBY
5 V5V terminal only if jumper removedVCC
GNDGND (shared with battery)GND (shared with battery)

Two-Motor Driver Code

Two-motor control that works with an L298N or a TB6612FNG
// Two-motor driver code. Same pinout works for L298N and TB6612FNG.
// Set USE_TB6612 to 0 when using an L298N module.
#define USE_TB6612 1

const int PWM_A = 5, A_IN1 = 7, A_IN2 = 8;   // left motor
const int PWM_B = 6, B_IN1 = 9, B_IN2 = 10;  // right motor
const int STBY  = 4;                          // TB6612FNG only

// Drive one motor. speed: -255 (full reverse) .. 255 (full forward)
void driveMotor(int pwmPin, int in1, int in2, int speed) {
  speed = constrain(speed, -255, 255);
  if (speed > 0) {
    digitalWrite(in1, HIGH); digitalWrite(in2, LOW);
  } else if (speed < 0) {
    digitalWrite(in1, LOW);  digitalWrite(in2, HIGH);
  } else {
    // Both inputs equal with enable high = brake on both chips
    digitalWrite(in1, HIGH); digitalWrite(in2, HIGH);
    analogWrite(pwmPin, 255);
    return;
  }
  analogWrite(pwmPin, abs(speed));
}

void setMotors(int left, int right) {
  driveMotor(PWM_A, A_IN1, A_IN2, left);
  driveMotor(PWM_B, B_IN1, B_IN2, right);
}

// Let the motors spin freely (coast)
void coast() {
  analogWrite(PWM_A, 0);   // on the L298N, enable low = free running
  analogWrite(PWM_B, 0);
  digitalWrite(A_IN1, LOW); digitalWrite(A_IN2, LOW);  // TB6612: both low = stop
  digitalWrite(B_IN1, LOW); digitalWrite(B_IN2, LOW);
}

void setup() {
  int pins[] = {PWM_A, A_IN1, A_IN2, PWM_B, B_IN1, B_IN2, STBY};
  for (int p : pins) pinMode(p, OUTPUT);
#if USE_TB6612
  digitalWrite(STBY, HIGH);   // STBY low keeps the TB6612FNG outputs off
#endif
}

void loop() {
  setMotors(180, 180);  delay(1500);  // forward
  setMotors(0, 0);      delay(500);   // brake
  setMotors(-150, 150); delay(700);   // spin left on the spot
  coast();              delay(1000);  // free-wheel stop
}

The driveMotor function hides the direction logic. Positive speed sets the first input high, negative speed sets the second input high, and zero applies the brake. Brake stops the robot quickly because the shorted motor acts as a generator loaded by its own winding, while coast lets it roll to a stop. Use brake when you need precise stops, such as in a line follower at a junction.

Troubleshooting

  • Motor does not turn on the L298N: the ENA or ENB jumper is still fitted, so your PWM pin is connected to a pin already held high, or the jumper is removed but nothing drives ENA.
  • Nothing happens on the TB6612FNG: STBY is floating or low. It must be driven high.
  • One motor runs backwards: swap that motor's two wires or invert its speed in software.
  • Arduino resets when motors start: add a 100 uF or larger electrolytic capacitor across the motor supply and check the battery can deliver the current.
  • L298N very hot and motors slow: the motors draw more than expected, or the supply is too low to cover the driver's voltage drop.

Summary

Both chips are dual H-bridges, but the TB6612FNG's MOSFET outputs waste far less voltage and run cool, making it the better choice for small robots under 15 V and about 1 A per motor. The L298N handles higher voltages and currents at the cost of heat and a voltage drop. Writing one driveMotor function with the same pinout lets you move between them freely.