Skip to content
A

Motor

Controlling L298N Driver Motor with Arduino Uno

What is the L298N Driver?

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

  1. Confirm the exact part number and breakout-board revision.
  2. Verify supply voltage, current demand, logic levels, and signal direction against the datasheet.
  3. Check controller pin assignments and bus address or interface mode against the example code.
  4. Power up with external loads disconnected, then test signals before full integration.
  5. 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.

Setting Up L298N Driver with Arduino Uno

Library

None — built-in digitalWrite/analogWrite by —

No library needed; uses core Arduino functions only.

Wiring

Component pinArduino Uno pinNote
IN1D8Motor A direction bit 1.
ENAD9PWM speed control for motor A.
IN2D7Motor A direction bit 2.
IN3D12Motor B direction bit 1.
ENBD10PWM speed control for motor B.
IN4D13Motor B direction bit 2.
GNDGNDCommon ground between Arduino, L298N logic, and motor supply — do not skip this.
+12V / GND (motor supply)—Separate battery/supply for the motors — do NOT power motors from the Arduino 5V pin.

Swipe sideways to see every column →

C++
  • The L298N's onboard 5V regulator can only supply the logic side, and only if the motor supply is under ~12V and the regulator jumper is in place — for anything above that, or with larger motors, power the Arduino separately and just share GND.
  • Never power DC motors directly from an Arduino digital pin or its 5V rail — the L298N (or any H-bridge driver) exists specifically because motors draw far more current and generate back-EMF spikes that a microcontroller pin cannot survive.
  • IN1/IN2 control direction for motor A, IN3/IN4 for motor B; ENA/ENB must be PWM pins for speed control, or tied HIGH for full-speed-only operation.

Related Components

Related Guides & Projects