L298N Motor Driver
Dual full-bridge (H-bridge) driver built on the STMicroelectronics L298 IC that lets a microcontroller run two DC motors or one bipolar stepper at up to 2A per channel.
- Motor supply (VS)Up to 46 V on the L298; 5 V to 35 V on the module
- Logic supply (VSS)4.5 V to 7 V
- Output current per channel2 A DC, 2.5 A repetitive peak, 3 A non-repetitive (100 µs)
- Voltage drop across the bridge1.8 V to 3.2 V at 1 A, up to 4.9 V at 2 A

The L298N module is a dual H-bridge built on ST's L298 that drives two DC motors (or one bipolar stepper) at up to 2 A DC per channel from a motor supply of up to 46 V on the chip (ST L298 datasheet, pp. 2 to 3) and 5 V to 35 V on the module (Handson Technology L298N user guide, p. 1). Wire IN1 to IN4 to four GPIOs for direction and ENA/ENB to PWM pins for speed, and join the module's GND to the microcontroller's. Inputs read high from 2.3 V, so 3.3 V boards drive it directly (datasheet, p. 3).
The L298N is a dual full-bridge driver based on the STMicroelectronics L298 IC. It takes low-current logic signals from a microcontroller (inputs read high from 2.3 V, so 3.3 V and 5 V boards both work, ST L298 datasheet, p. 3) and switches the higher current and higher voltage a motor needs, well beyond what a GPIO pin can source. Each of its two H-bridges drives one DC motor in either direction, or the two bridges together drive a single bipolar stepper's two coils.
The L298 accepts a motor supply (VS) up to 46 V and delivers up to 2 A of DC current per channel, 2.5 A repetitive peak and 3 A non-repetitive for 100 µs (ST L298 datasheet, pp. 2 to 3). A separate logic supply (VSS) of 4.5 V to 7 V powers the internal control logic. The common red breakout module adds protection diodes and an onboard 5 V regulator, enabled by a jumper, so a single motor supply can also feed the logic; its maker rates the module for a 5 V to 35 V supply (Handson Technology L298N user guide, p. 1). Direction is set with the IN pins, and speed is controlled by feeding PWM to the enable pins (ENA and ENB).
Because the output stage uses bipolar transistors, the bridge drops 1.8 V to 3.2 V at 1 A and up to 4.9 V at 2 A (ST datasheet, p. 3), so the motor sees noticeably less than the supply voltage. Under sustained load the chip dissipates real heat and relies on the module's heatsink, which is why the L298N is a workhorse for hobby robotics but not the most efficient choice for battery-critical designs.
L298N Motor Driver pinout
| Pin | Function | Type |
|---|---|---|
| OUT1 | Digital | free |
| OUT2 | Digital | free |
| OUT3 | Digital | free |
| OUT4 | Digital | free |
| VMS | 12V / VSup to 46 V (motors) | power in |
| GND | GND | power in |
| 5V | 5V / VSS4.5 to 7 V (logic) | power in |
| ENA | Digital, PWM | input |
| IN1 | Digital | input |
| IN2 | Digital | input |
| IN3 | Digital | input |
| IN4 | Digital | input |
| ENB | Digital, PWM | input |
How to wire the L298N Motor Driver
Pin by pin, for the board you have.
| L298N Motor Driver | Arduino Uno | Note |
|---|---|---|
| IN1 | D2 | |
| IN2 | D3 | |
| ENA | D9 | |
| IN3 | D4 | |
| IN4 | D5 | |
| ENB | D10 | |
| 5V | 5V | only with the module's 5V-EN jumper removed. With the jumper fitted (motor supply 12 V or less) its regulator makes 5 V on this pin: leave this wire off, or two supplies fight |
| GND | GND | |
| VMS | a separate motor supply, its − to GND |
| L298N Motor Driver | ESP32 DevKit V1 | Note |
|---|---|---|
| IN1 | GPIO13 (D13) | |
| IN2 | GPIO14 (D14) | |
| ENA | GPIO4 (D4) | |
| IN3 | GPIO27 (D27) | |
| IN4 | GPIO26 (D26) | |
| ENB | GPIO16 (RX2) | |
| 5V | VIN | only with the module's 5V-EN jumper removed. With the jumper fitted (motor supply 12 V or less) its regulator makes 5 V on this pin: leave this wire off, or two supplies fight |
| GND | GND | |
| VMS | a separate motor supply, its − to GND |
- 5V is on VIN, which gives about 5 V only while the board is powered from USB.
| L298N Motor Driver | Raspberry Pi Pico | Note |
|---|---|---|
| IN1 | GP0 | |
| IN2 | GP1 | |
| ENA | GP2 | |
| IN3 | GP3 | |
| IN4 | GP4 | |
| ENB | GP5 | |
| 5V | VBUS | only with the module's 5V-EN jumper removed. With the jumper fitted (motor supply 12 V or less) its regulator makes 5 V on this pin: leave this wire off, or two supplies fight |
| GND | GND | |
| VMS | a separate motor supply, its − to GND |
- 5V is on VBUS, which gives about 5 V only while the board is powered from USB.
L298N Motor Driver code
Every example here compiles for its board.
// L298N Motor Driver on Arduino Uno: wiring and a free simulation at https://www.tinkered.ai/components/l298n-stepper-driver
const int IN1 = 2, IN2 = 3, ENA = 9; // channel A
const int IN3 = 4, IN4 = 5, ENB = 10; // channel B
void setup() {
const int pins[] = {IN1, IN2, ENA, IN3, IN4, ENB}; // an array: AVR has no <initializer_list>
for (int p : pins) pinMode(p, OUTPUT);
}
// speed: -255..255, sign is direction
void driveA(int speed) {
digitalWrite(IN1, speed >= 0);
digitalWrite(IN2, speed < 0);
analogWrite(ENA, abs(speed));
}
void loop() {
driveA(200); delay(2000); // forward
driveA(0); delay(1000); // stop
driveA(-200); delay(2000); // reverse
driveA(0); delay(1000);
}
Compiled for arduino:avr:uno on 2026-10-29// L298N Motor Driver on ESP32 DevKit V1: wiring and a free simulation at https://www.tinkered.ai/components/l298n-stepper-driver
const int IN1 = 13, IN2 = 14, ENA = 4; // channel A
const int IN3 = 27, IN4 = 26, ENB = 16; // channel B
void setup() {
const int pins[] = {IN1, IN2, ENA, IN3, IN4, ENB}; // an array: AVR has no <initializer_list>
for (int p : pins) pinMode(p, OUTPUT);
}
// speed: -255..255, sign is direction
void driveA(int speed) {
digitalWrite(IN1, speed >= 0);
digitalWrite(IN2, speed < 0);
analogWrite(ENA, abs(speed));
}
void loop() {
driveA(200); delay(2000); // forward
driveA(0); delay(1000); // stop
driveA(-200); delay(2000); // reverse
driveA(0); delay(1000);
}
Compiled for esp32:esp32:esp32 on 2026-10-29// L298N Motor Driver on Raspberry Pi Pico: wiring and a free simulation at https://www.tinkered.ai/components/l298n-stepper-driver
const int IN1 = 0, IN2 = 1, ENA = 2; // channel A
const int IN3 = 3, IN4 = 4, ENB = 5; // channel B
void setup() {
const int pins[] = {IN1, IN2, ENA, IN3, IN4, ENB}; // an array: AVR has no <initializer_list>
for (int p : pins) pinMode(p, OUTPUT);
}
// speed: -255..255, sign is direction
void driveA(int speed) {
digitalWrite(IN1, speed >= 0);
digitalWrite(IN2, speed < 0);
analogWrite(ENA, abs(speed));
}
void loop() {
driveA(200); delay(2000); // forward
driveA(0); delay(1000); // stop
driveA(-200); delay(2000); // reverse
driveA(0); delay(1000);
}
Compiled for rp2040:rp2040:rpipico on 2026-10-29Before you wire it
- VMS is the motor supply and GND is shared. Wire GND to the MCU ground or the logic has no reference and the inputs read noise.
- 5V is the logic supply.
- One motor per channel, across that channel's two OUT terminals. Do not split a motor across channels.
- On ESP32, ENA/ENB need LEDC-capable pins if you want PWM speed control.
- No driving a motor straight from a GPIO. That is what this module is for.
- No leaving IN1 and IN2 both HIGH expecting motion: that is a brake.
- No powering motors from the board's 5V pin on real hardware; use VMS with its own supply and a common ground.
- Keep the motor supply and logic supply separate: VS (the 12V / VS terminal) feeds the motors and can go up to 46 V on the bare IC (35 V on the module), while VSS / 5V powers the logic at 4.5 V to 7 V (ST datasheet, p. 3). ST asks for a 100 nF capacitor from VS and from VSS to ground, close to the chip (p. 3).
- Tie the driver GND to the microcontroller GND so both share a common ground reference. Without a shared ground the IN inputs have no reference and the outputs behave erratically.
- The bare L298 has no internal freewheeling diodes. Add fast-recovery flyback diodes (trr ≤ 200 ns) across the outputs for inductive loads (ST datasheet, p. 7). The red breakout module already carries them (Handson Technology L298N user guide, p. 1).
- Account for the voltage drop across the bridge, 1.8 V to 3.2 V at 1 A and up to 4.9 V at 2 A (ST datasheet, p. 3): a 12 V supply can deliver only 9 V to 10 V to the motor, so size the supply above the motor's rated voltage.
- Set direction with IN1/IN2 and IN3/IN4, and feed PWM to ENA/ENB for speed. Plan for up to 2 A DC per channel (ST datasheet, p. 2) and keep the heatsink fitted for sustained high current.
- On the popular module, the 5V-enable jumper lets the onboard regulator power the logic from the motor supply and offers 5 V on the 5V terminal. To feed the logic from your own 5 V instead, remove the jumper first; the regulator runs hotter the higher the motor supply.
Specifications
- Motor supply (VS)
- Up to 46 V on the L298; 5 V to 35 V on the moduleST L298 datasheet, p. 3; Handson Technology L298N user guide, p. 1
- Logic supply (VSS)
- 4.5 V to 7 VST L298 datasheet, p. 3
- Output current per channel
- 2 A DC, 2.5 A repetitive peak, 3 A non-repetitive (100 µs)ST L298 datasheet, p. 2
- Voltage drop across the bridge
- 1.8 V to 3.2 V at 1 A, up to 4.9 V at 2 AST L298 datasheet, p. 3
- Input and enable high level
- 2.3 V min (low up to 1.5 V)ST L298 datasheet, p. 3
- Logic quiescent current
- 24 mA typ, 36 mA max (VSS)ST L298 datasheet, p. 3
- Switching frequency
- 25 kHz typ, 40 kHz maxST L298 datasheet, p. 4
- Module size
- 43 × 43 mmHandson Technology L298N user guide, p. 3
- Interface
- GPIO
- Dimensions
- 44 × 43.5 × 29.5 mm
- Weight
- 30 g
- Logic supply (5V pin)
- 4.5 to 7 VST L298 datasheet, p. 3
- Motor supply (VMS)
- up to 46 VST L298 datasheet, p. 3
From the STMicroelectronics's datasheet, published by STMicroelectronics.
Common mistakes
Skipping the common ground
The driver GND must connect to the microcontroller GND. Powering the motors from one supply and the logic from USB without joining the grounds leaves the IN inputs with no reference, so motors twitch, stall, or ignore commands.
Assuming the motor gets the full supply voltage
The L298's bipolar output stage drops 1.8 V to 3.2 V at 1 A (ST datasheet, p. 3), so a 12 V rail delivers only 9 V to 10 V to the motor. If a motor seems weak, remember to size the supply above the motor's rated voltage to compensate.
Ignoring the enable pins
Nothing moves until the enable pin for that channel is high. Use ENA and ENB for PWM speed control and the IN pins for direction. Trying to PWM the direction inputs while enable is fixed high gives poor speed control.
Mishandling the onboard 5V jumper
On the module the 5V-enable jumper lets the onboard regulator power the logic from the motor supply. If you feed the logic from an external 5 V instead, remove the jumper first: never feed 5 V into the 5V pin while the jumper is still installed, or two supplies fight.
Forgetting flyback protection on the bare IC
The L298 chip provides no freewheeling diodes of its own. Inductive kickback from motor coils can damage the output transistors, so a bare-chip design needs fast-recovery diodes (trr ≤ 200 ns, ST datasheet, p. 7); the red module already has them.
L298N Motor Driver questions
How do I connect an L298N to an Arduino?
Connect the motor supply to the 12V terminal and its ground to GND, then join that GND to the Arduino's GND. Wire IN1 to IN4 to four digital pins and, for speed control, remove the ENA and ENB jumpers and wire those pins to PWM outputs. Each motor goes across OUT1/OUT2 or OUT3/OUT4.
Can I use the L298N with an ESP32 or 3.3 V board?
Yes. The L298's inputs and enables read high from 2.3 V (ST L298 datasheet, p. 3), so 3.3 V GPIOs drive them directly. Power the motors from their own supply and share the ground with the ESP32.
Why is my motor weak or slow on the L298N?
The L298 drops 1.8 V to 3.2 V at 1 A and up to 4.9 V at 2 A across its bridge (ST datasheet, p. 3). A motor rated 6 V on a 6 V supply therefore sees only 3 V to 4 V. Raise the supply by about 2 V to 3 V, or switch to a MOSFET driver such as the TB6612FNG for low-voltage motors.
How much current can the L298N handle?
2 A DC per channel, 2.5 A repetitive peak and 3 A for a single 100 µs pulse (ST L298 datasheet, p. 2). At those currents the chip dissipates several watts, so keep the heatsink fitted and leave room for air to flow.
What does the 5V jumper on the L298N do?
It enables the module's onboard 5 V regulator, which then powers the L298's logic from the motor supply and offers 5 V on the 5V terminal. Remove it when you supply the logic from your own 5 V, so the two supplies never fight.
Why does my L298N motor not move at all?
Check that ENA or ENB is high (the jumper fitted or the pin driven), since a low enable disables that bridge (ST datasheet, p. 3), and that IN1 and IN2 differ: both low coasts and both high brakes. Then check the shared ground and that the motor supply is connected to the 12V terminal.
Build something with the L298N Motor Driver
- Build this
Two-wheel Arduino robot car
Drive two geared DC motors from one L298N for a differential-drive robot, using the IN pins for direction and ENA/ENB PWM for per-wheel speed.
- Build this
Bipolar stepper control
Wire a NEMA-17 or similar bipolar stepper's two coils across the two bridges (OUT1/OUT2 and OUT3/OUT4) to step the motor for positioning and CNC-style projects.
- Build this
PWM speed-controlled fan or pump
Run a single DC motor through one bridge and vary its speed with PWM on the enable pin for adjustable cooling fans, water pumps, or conveyors.
- Build this
Reversible linear actuator or conveyor
Use one H-bridge to reverse a DC gearmotor on demand, giving open/close or forward/back control for doors, blinds, and small conveyors.
This page as plain Markdown, for ChatGPT, Claude or your own agent. /components/l298n-stepper-driver.md