Skip to content
A

Motor

Controlling DC Motor L298N with Arduino Uno

What is the DC Motor L298N?

DC Motor L298N practical reference

A geared DC motor paired with the ubiquitous L298N dual H-bridge driver — the standard starting point for wheeled robots.

Key specifications

  • Motor: Brushed DC gear motor — the common yellow "TT motor" spec is ~200 RPM at 6V, ~1:48 gear ratio
  • Driver: L298N dual H-bridge, 2A per channel
  • Control: One direction pair (IN1/IN2) plus one PWM speed pin (ENA) per motor
  • Supply: Motor voltage 5V-35V DC on the driver's VMS terminal, separate from the MCU's own power

Pinout and connection notes

This entry covers the motor + L298N pairing as a unit — see the L298N Driver page for the full breakdown of every driver pin if you're wiring more than one motor.

  • OUT1 / OUT2: Motor leads — connect directly to the L298N's motor A output terminal, polarity sets default spin direction
  • ENA: PWM input on the driver — controls motor speed
  • IN1 / IN2: Direction inputs on the driver — set which way current flows through the motor
  • 12V / GND: Motor supply voltage and ground, into the driver's VMS/GND terminal

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 DC Motor L298N with Arduino Uno

Wiring

Component pinArduino Uno pinNote
ENAD9 (PWM)Controls speed via analogWrite — remove the ENA jumper on the L298N board if it has one, or PWM won't take effect
IN1D7
IN2D8
12V / GNDSeparate motor power supply — GND shared with the ArduinoDo not power the motor from the Arduino's 5V pin — L298N motor supply is a separate higher-current rail

Swipe sideways to see every column →

C++

Motor supply grounds and logic grounds must be tied together (Arduino GND to L298N GND), even though the 12V motor rail is otherwise separate — skipping this common ground is a frequent reason for erratic or no motor response.

Related Components

Related Guides & Projects