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.
Community draft — report a mistake
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
| Pin | What it does |
|---|---|
IN1 | Motor A direction input 1 |
IN2 | Motor A direction input 2 |
IN3 | Motor B direction input 1 |
IN4 | Motor B direction input 2 |
ENA | Motor A enable — remove the jumper and feed PWM for speed control |
ENB | Motor B enable — remove the jumper and feed PWM for speed control |
12V | Motor supply input, 5–35 V (screw terminal) |
GND | Ground — shared by the motor supply and your board |
5V | Logic 5 V: an output when the 5V-EN jumper is fitted, an input when it’s removed |
OUT1 | Motor A terminal |
OUT2 | Motor A terminal |
OUT3 | Motor B terminal |
OUT4 | Motor B terminal |
Use it with
- L298N dual H-bridge motor driver with Arduino Nano Arduino C++
- L298N dual H-bridge motor driver with Arduino Uno R3 Arduino C++
- L298N dual H-bridge motor driver with ESP32 DevKit V1 Arduino C++
- L298N dual H-bridge motor driver with NodeMCU ESP8266 Arduino C++
- L298N dual H-bridge motor driver with Raspberry Pi Pico W MicroPython
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.