From the workshop: Arduino Uno R3 Development Board (ATmega328P) With USB Cable

View product
All articles
Robotics

⚙️L298N vs TB6612FNG vs DRV8833: Which Motor Driver Should You Use?

Voltage and current ratings, the 2 V the L298N wastes, logic levels, standby, heat, and which driver suits BO, N20 and bigger motors, with wiring diagrams and code.

TThinking Robot Team 12 min read
L298N, TB6612FNG and DRV8833 motor driver boards compared with a voltage drop chart
In this article (14)

L298N vs TB6612FNG vs DRV8833: which motor driver should you use for your robot? All three are dual H-bridge drivers that let an Arduino or ESP32 run two DC motors forwards, backwards and at any speed. On paper they look interchangeable. On a battery-powered robot car they are not, because one of them quietly throws away about 2 V of your battery as heat.

This comparison uses numbers from the ST, Toshiba and Texas Instruments datasheets to cover ratings, voltage drop, logic levels, standby and heat, then shows which to pick for BO, N20 and bigger motors, with wiring diagrams, code and a multimeter experiment.

Short answer: for small battery robots with BO or N20 motors, use a TB6612FNG, or a DRV8833 if your battery stays under 10.8 V. Both use MOSFETs and lose only a fraction of a volt. Keep the L298N for learning, for motor supplies above about 13 V, and for motors drawing up to about 2 A continuously, and expect it to run warm and give your motors roughly 2 V less.

L298N vs TB6612FNG vs DRV8833: specs side by side

L298N module (ST L298)TB6612FNGDRV8833
Switch typeBipolar (BJT)MOSFETMOSFET
Motor supplyUp to 46 V (chip); at least 2.5 V above the logic HIGH level4.5–13.5 V (15 V absolute max)2.7–10.8 V
Continuous current per channel2 A1.2 A average1.5 A RMS (with good PCB cooling)
Peak current per channel3 A (non-repetitive, 100 µs)3.2 A (single 10 ms pulse)2 A
Voltage lost inside1.8–3.2 V total at 1 AI × 0.5 Ω (typical)I × 0.36 Ω (typical)
Logic supply5 V (module regulator or Arduino)VCC 2.7–5.5 VNone needed (internal)
Sleep / standbyNo standby pinSTBY pinnSLEEP pin
Built-in protectionOver-temperatureThermal shutdown, low-voltage detectionOver-current, thermal, under-voltage, nFAULT output
Typical boardLarge red module, heatsink, screw terminalsSmall breakout, pin headersSmall breakout, pin headers

Sources: ST L298 datasheet, Toshiba TB6612FNG datasheet and TI DRV8833 datasheet. Module boards add their own regulators, capacitors and diodes, so check the listing too.

Bar chart of motor supply ranges: L298N from 7.5 V with 5 V logic (5.8 V with 3.3 V logic) up to 46 V; TB6612FNG 4.5 to 13.5 V; DRV8833 2.7 to 10.8 V; with markers for 1S, 4 AA, 2S and 3S batteriesWhich battery suits which driver. A full 3S pack (12.6 V) is too high for the DRV8833; one Li-ion cell is too low for the TB6612FNG.

Why the L298N loses about 2 V: bipolar vs MOSFET

The L298N's switches are bipolar transistors. Motor current flows through two of them (high-side and low-side), and each has a saturation voltage of around a volt that barely shrinks at low current. The TB6612FNG and DRV8833 use MOSFETs, which act like small resistors when on, so their loss scales with current.

Bipolar (L298N): V_motor ≈ V_battery − V_CE(sat) total (1.8–3.2 V at 1 A) MOSFET drivers: V_motor = V_battery − I × R_on(high + low) Heat per motor: bipolar P ≈ V_drop × I MOSFET P = I² × R_on

Bar chart: from a 7.4 V battery, at 0.25 A the motor gets about 5.4 V through an L298N, 7.28 V through a TB6612FNG and 7.31 V through a DRV8833; at 1 A it gets 4.2 to 5.6 V, 6.90 V and 7.04 VSame battery, same motor: the MOSFET drivers pass almost all of the battery voltage to the motor.

Driver, 7.4 V battery, 0.25 A motorVoltage at motorShare of battery voltage reaching the motorHeat for two motors
L298N≈ 5.4 V≈ 73 %≈ 1 W
TB6612FNG≈ 7.28 V≈ 98 %≈ 0.06 W
DRV8833≈ 7.31 V≈ 99 %≈ 0.05 W

That missing 2 V is why the same robot feels faster on a TB6612FNG and why a 4 × AA pack (6 V) feels weak through an L298N. On-resistance rises as a chip warms, but the gap stays large. Battery choices are compared in our robot battery guide.

Logic levels, standby and the pins you must not forget

All three drivers work with 5 V Arduino signals and with 3.3 V ESP32 signals, with one catch on the TB6612FNG.

L298NTB6612FNGDRV8833
Pins per motorENx (PWM) + IN1, IN2PWMx + xIN1, xIN2xIN1, xIN2 (PWM goes on these)
Pins for two motors67 (6 + STBY)4 (+ nSLEEP if not pulled up)
3.3 V logic (ESP32)Works: input HIGH is 2.3 V minimumWorks when VCC = 3.3 VWorks
Must not forgetRemove ENA/ENB jumpers to use PWMSTBY HIGH, or nothing movesnSLEEP HIGH, or nothing moves
Idle current with motors stoppedTens of mA (chip, regulator, LED)About 1 µA in standbyMicroamps in sleep
Stop modesBrake or coastShort brake or stop (coast)Brake (slow decay) or coast (fast decay)

The TB6612FNG's inputs need at least 0.7 × VCC to read HIGH. If VCC is 5 V, that is 3.5 V, which an ESP32's 3.3 V output does not reach. Tie VCC to 3.3 V on an ESP32 robot and the problem disappears.

Which motor driver for BO motors, N20 motors and bigger motors?

Match the driver to your battery voltage first, then to the motor's stall current. A driver's peak rating should be above the motor's stall current, and its continuous rating above the running current.

Your robotBest pickAlso OKAvoid
2 × BO motors on 4 × AA or 2S Li-ion, Arduino carTB6612FNGDRV8833 (2S stays under 8.4 V); L298N on 2S only—
N20 6 V micro gear motors, small robotDRV8833TB6612FNGL298N (bulky, wastes voltage)
N20 12 V motors on a 3S packTB6612FNG (12.6 V full is close to its 13.5 V limit)L298NDRV8833 (above 10.8 V)
Tiny robot on one Li-ion cell (3.7 V)DRV8833—TB6612FNG (needs 4.5 V), L298N
12 V gear motors: about 1 A running, stall under 3 AL298N with heatsink—TB6612FNG and DRV8833 (current)
Motors whose stall current is above about 3 AA high-current MOSFET driver—All three
Classroom kit that gets rough handlingL298N (screw terminals)TB6612FNG—

To find your motor's stall current, put a multimeter on its 10 A range in series with the motor and hold the wheel still for no more than a second or two. For voltage and current in long wires, try the wire gauge voltage drop calculator.

Wiring the TB6612FNG to an Arduino Uno

The TB6612FNG drops into the same pins as our L298N robot car, plus one extra pin for STBY.

Wiring: Arduino D5 to PWMA, D7 to AIN1, D8 to AIN2, D4 to STBY, D9 to BIN1, D10 to BIN2, D6 to PWMB, 5V to VCC, GND to GND; motors on A01/A02 and B01/B02; battery on VM and GNDTB6612FNG with an Arduino Uno. Pin order differs between breakout boards, so follow the printed labels.

Arduino UnoTB6612FNGPurpose
D5 (PWM)PWMALeft motor speed
D7, D8AIN1, AIN2Left motor direction
D6 (PWM)PWMBRight motor speed
D9, D10BIN1, BIN2Right motor direction
D4STBYHIGH = run, LOW = standby
5VVCCLogic supply
GNDGNDCommon ground with the battery
cpp
// TB6612FNG + Arduino Uno: two motors, speed -255 ... 255
const int PWMA = 5, AIN1 = 7, AIN2 = 8;    // left motor
const int PWMB = 6, BIN1 = 9, BIN2 = 10;   // right motor
const int STBY = 4;                        // HIGH = driver on

void setMotor(int pwmPin, int in1, int in2, int speed) {
  speed = constrain(speed, -255, 255);
  if (speed > 0) {
    digitalWrite(in1, HIGH); digitalWrite(in2, LOW);   // forwards
  } else if (speed < 0) {
    digitalWrite(in1, LOW);  digitalWrite(in2, HIGH);  // backwards
  } else {
    digitalWrite(in1, HIGH); digitalWrite(in2, HIGH);  // short brake
  }
  analogWrite(pwmPin, abs(speed));
}

void drive(int left, int right) {
  setMotor(PWMA, AIN1, AIN2, left);
  setMotor(PWMB, BIN1, BIN2, right);
}

void setup() {
  const int pins[] = {PWMA, AIN1, AIN2, PWMB, BIN1, BIN2, STBY};
  for (int i = 0; i < 7; i++) pinMode(pins[i], OUTPUT);
  digitalWrite(STBY, HIGH);
}

void loop() {
  drive(180, 180);   delay(2000);   // forwards
  drive(0, 0);       delay(800);    // brake
  drive(-150, 150);  delay(600);    // spin left
  drive(0, 0);       delay(800);
  digitalWrite(STBY, LOW);  delay(2000);  // standby: outputs off
  digitalWrite(STBY, HIGH);
}

Wiring the DRV8833 to an ESP32

The DRV8833 has no separate speed pin. You send PWM to the two input pins of each motor, which saves pins on small boards.

Wiring: ESP32 GPIO25 to AIN1, GPIO26 to AIN2, GPIO27 to BIN1, GPIO32 to BIN2, GPIO33 to nSLEEP, GND to GND; motors on AOUT and BOUT; 4 AA or 2S battery on VMDRV8833 with an ESP32. Only signal wires and ground go to the ESP32; the driver makes its own logic supply from VM.

xIN1xIN2Motor
00Coast (outputs off)
10Forwards
01Backwards
11Brake
1PWMForwards, speed set by the time IN2 is LOW (slow decay)
PWM1Backwards, speed set by the time IN1 is LOW (slow decay)
cpp
// DRV8833 + ESP32 (Arduino-ESP32 core): PWM on the IN pins, slow decay
const int AIN1 = 25, AIN2 = 26;   // left motor
const int BIN1 = 27, BIN2 = 32;   // right motor
const int SLEEP_PIN = 33;         // nSLEEP: HIGH = awake

// speed: -255 ... 255. 0 = brake.
void setMotor(int in1, int in2, int speed) {
  speed = constrain(speed, -255, 255);
  if (speed >= 0) {
    analogWrite(in1, 255);           // IN1 held HIGH
    analogWrite(in2, 255 - speed);   // forwards while IN2 is LOW
  } else {
    analogWrite(in1, 255 + speed);   // backwards while IN1 is LOW
    analogWrite(in2, 255);           // IN2 held HIGH
  }
}

void setup() {
  pinMode(SLEEP_PIN, OUTPUT);
  digitalWrite(SLEEP_PIN, HIGH);
}

void loop() {
  setMotor(AIN1, AIN2, 200);  setMotor(BIN1, BIN2, 200);   delay(2000);
  setMotor(AIN1, AIN2, 0);    setMotor(BIN1, BIN2, 0);     delay(800);
  setMotor(AIN1, AIN2, -160); setMotor(BIN1, BIN2, 160);   delay(600);
  setMotor(AIN1, AIN2, 0);    setMotor(BIN1, BIN2, 0);     delay(800);
}

analogWrite() works on ESP32 pins in current versions of the Arduino-ESP32 core. If the ESP32 resets every time the motors start, see why an Arduino or ESP32 resets when a motor starts and the ESP32 brownout fix.

Experiment: measure what reaches your motor

You need a multimeter, a fully charged 2S pack (or fresh 4 × AA), one motor and whichever drivers you have.

  1. Lift the robot so the wheels spin freely and note the battery voltage with the motor stopped.
  2. Run one motor at full speed (drive(255, 0) on the TB6612FNG or L298N; setMotor(AIN1, AIN2, 255) on the DRV8833). At 255 the PWM output is fully on, so a DC voltmeter reads correctly.
  3. Measure the DC voltage across the motor's two terminals.
  4. Subtract: battery voltage − motor voltage = driver loss.
  5. Repeat with each driver; after a minute, check whether the driver is warm.
DriverBattery (V)Motor (V)Loss (V)Warm?
L298N
TB6612FNG
DRV8833

What you learn: the L298N's loss should be roughly 1.5–2.5 V; the MOSFET drivers' loss should be a small fraction of a volt. Measure wheel speed with the wheel RPM and speed calculator to see what that loss costs you, and fine-tune speeds with the PWM duty cycle calculator.

Common mistakes

MistakeWhat happensFix
TB6612FNG STBY left unconnectedMotors never moveTie STBY to VCC or a HIGH pin
DRV8833 nSLEEP left floating on a bare breakoutMotors never moveDrive it HIGH (it has an internal pull-down)
3S Li-ion (12.6 V) on a DRV8833Above the 10.8 V maximum; driver can failUse 2S, or a TB6612FNG
TB6612FNG VCC at 5 V with an ESP32Inputs may not read HIGH reliablyPower VCC from 3.3 V
L298N on 4 × AAMotors get about 4 V and crawlUse 2S Li-ion, or a MOSFET driver

Find drivers, BO and N20 motors and battery holders on our motor driver products page, or start with a complete robot kit.

Frequently asked questions

Is the TB6612FNG better than the L298N?

For small battery robots, yes. It loses about 0.125 V at 0.25 A instead of roughly 2 V, runs cool and is much smaller. The L298N is better only when you need more than 13.5 V or close to 2 A per motor, or rugged screw terminals for a classroom.

Can the DRV8833 drive BO motors?

Yes. BO motors run on 3–6 V and typically draw a few hundred milliamps, well within the DRV8833's 1.5 A RMS rating. Keep the battery at 10.8 V or less; 4 × AA or a 2S Li-ion pack is ideal.

Do these motor drivers work with an ESP32's 3.3 V logic?

Yes. The L298N reads 2.3 V and above as HIGH, the DRV8833 accepts 3.3 V signals, and the TB6612FNG works when its VCC pin is powered from 3.3 V.

Why does my L298N get hot?

It turns its 1.8–3.2 V internal drop (at 1 A) into heat: about 2–3 W per motor at 1 A. That is normal for a bipolar driver. Keep the heatsink, check for stalled wheels, or switch to a MOSFET driver.

Can I use one DRV8833 for a single bigger motor?

Yes. TI's datasheet allows the two H-bridges to be paralleled for up to 3 A RMS on one motor. Join AIN1 with BIN1, AIN2 with BIN2, AOUT1 with BOUT1, and AOUT2 with BOUT2, as the datasheet shows.

T

Thinking Robot Team

Thinking Robot is a team of engineers and educators in Pune who design electronics and robotics kits and run hands-on workshops for students and schools. Spotted a mistake or have a question? Get in touch.

Filed under#Robotics#Arduino#ESP32#Electronics

Keep learning

WhatsApp