L298N Dual H-Bridge Motor Driver Module
Dual H-bridge motor driver — the standard for controlling two DC motors or one stepper.
Wiring & code for
L298N Driver practical reference
The most widely used motor driver in the hobbyist world — a dual H-bridge board that can independently drive two brushed DC motors (or one bipolar stepper) with direction and PWM speed control, and includes an onboard 5V regulator for powering logic from the motor supply.
Key specifications
- Driver IC: L298N dual H-bridge
- Motor supply voltage: 5 V - 35V DC, fed to the board's 12V/VMS terminal
- Logic voltage: 5 V — from the onboard regulator when the 5V-EN jumper is in place, or from an external 5V source if you've removed it (required if VMS > 12V, to avoid overheating the onboard regulator)
- Max current: 2A per channel continuous, ~3A peak with a heatsink fitted
- Channels: Drives 2 independent DC motors, or 1 bipolar stepper motor
Pinout and connection notes
Setting IN1/IN2 (or IN3/IN4) to the same logic level brakes that motor; opposite levels drive it forward or reverse. Remove the 5V-EN jumper and supply logic power separately whenever VMS exceeds 12V.
- ENA: PWM speed control for motor A — jumper removed lets you drive this from a PWM pin; jumper in place runs motor A at full speed whenever enabled
- IN1: Direction control, motor A
- IN2: Direction control, motor A
- IN3: Direction control, motor B
- IN4: Direction control, motor B
- ENB: PWM speed control for motor B
- OUT1 / OUT2: Motor A output terminals
- OUT3 / OUT4: Motor B output terminals
- 12V / VMS: Motor supply voltage, 5V-35V DC
- GND: Common ground — must be shared between the motor supply, the board, and the MCU
- 5V: Regulated 5V output (only if the 5V-EN jumper is fitted and VMS ≤ 12V) — can power the MCU logic side
Integration checklist
- Confirm the exact part number and breakout-board revision.
- Verify supply voltage, current demand, logic levels, and signal direction against the datasheet.
- Check controller pin assignments and bus address or interface mode against the example code.
- Power up with external loads disconnected, then test signals before full integration.
- If readings or communication fail, check power and ground first, then pin mapping, interface settings, and library initialization.
Troubleshooting and reproducibility
Record the board used, wiring, library/version, supply arrangement, and measured behavior. Use the selected board-specific wiring example as the source of truth. Never assume visually similar modules share identical voltage tolerance or pin order.
Board Integration
Related