Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.

L298N dual H-bridge motor driver

L298N dual H-bridge: IN1–IN4, ENA, ENB, 12V, GND, 5V and OUT1–OUT4 pins, the 5 V regulator jumper, 2 V voltage drop and PWM speed control.

GPIO

Community draft — report a mistake

CategoryActuator
InterfaceGPIO
VoltageMotor supply 5–35 V on the 12V terminal; logic 5 V
Typical price₹150

3.3 V or 5 V? The L298N’s inputs see anything above about 2.3 V as HIGH, so 3.3 V boards drive IN1–IN4 and ENA/ENB directly. Always connect the board’s GND to the driver’s GND.

The red L298N module drives two DC motors (or one bipolar stepper) in both directions. Two inputs per motor set the direction; a PWM signal on the enable pin sets the speed. It’s the classic driver for two-wheel robot cars.

The 5 V jumper. With the 5V-EN jumper fitted, the on-board regulator makes 5 V from the motor supply and the 5V pin is an output — keep the motor supply at 12 V or below in that mode. Above 12 V, remove the jumper and feed the 5V pin from a separate 5 V supply.

The L298N is an old bipolar design that wastes about 2 V as heat. It works for kit motors, but for battery-powered projects a MOSFET driver gives more speed and runtime.

Pinout

PinWhat it does
IN1Motor A direction input 1
IN2Motor A direction input 2
IN3Motor B direction input 1
IN4Motor B direction input 2
ENAMotor A enable — remove the jumper and feed PWM for speed control
ENBMotor B enable — remove the jumper and feed PWM for speed control
12VMotor supply input, 5–35 V (screw terminal)
GNDGround — shared by the motor supply and your board
5VLogic 5 V: an output when the 5V-EN jumper is fitted, an input when it’s removed
OUT1Motor A terminal
OUT2Motor A terminal
OUT3Motor B terminal
OUT4Motor B terminal

Use it with

Common errors

Motors hum but don’t turn

The L298N drops about 2 V, so a 6 V supply leaves 4 V for the motors. Use a higher supply (7–12 V for typical yellow gear motors), or a modern MOSFET driver like the TB6612FNG.

Motors run only at full speed

The ENA/ENB jumpers are still fitted. Remove them and connect ENA/ENB to PWM pins.

Board resets when motors start

Motor noise and current spikes. Use separate batteries for motors and logic with a common GND, and add 100 nF capacitors across each motor’s terminals.

Driver very hot

The L298N is inefficient. Keep current under about 1 A per channel without extra cooling.

↑↓ to move · Enter to open