Motor
Controlling DC Motor L298N with Arduino Uno
What is the DC Motor L298N?
A geared DC motor paired with the ubiquitous L298N dual H-bridge driver — the standard starting point for wheeled robots.
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 |
DC Motor L298N Pinout
| Pin | Name | Description |
|---|---|---|
| 1 | OUT1 / OUT2 | Motor leads — connect directly to the L298N's motor A output terminal, polarity sets default spin direction |
| 2 | ENA | PWM input on the driver — controls motor speed |
| 3 | IN1 / IN2 | Direction inputs on the driver — set which way current flows through the motor |
| 4 | 12V / GND | Motor supply voltage and ground, into the driver's VMS/GND terminal |
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.
Setting Up DC Motor L298N with Arduino Uno
Wiring
| Component pin | Arduino Uno pin | Note |
|---|---|---|
| ENA | D9 (PWM) | Controls speed via analogWrite — remove the ENA jumper on the L298N board if it has one, or PWM won't take effect |
| IN1 | D7 | — |
| IN2 | D8 | — |
| 12V / GND | Separate motor power supply — GND shared with the Arduino | Do not power the motor from the Arduino's 5V pin — L298N motor supply is a separate higher-current rail |
Example code
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 Guides & Projects

Arduino Uno R3 Pinout: Every Pin Explained (Digital, Analog, PWM, Power)
Complete Arduino Uno R3 pinout reference: all 14 digital pins, 6 analog inputs, PWM, UART, SPI, I2C, AREF, and power rails explained with wiring tips and common mistakes.

Ultimate Arduino Mega 2560 Pinout Guide: Complete Power & I/O Reference
Master the Arduino Mega 2560 pinout. Detailed reference for all 54 digital pins, 16 analog inputs, PWM, UARTs, SPI, I2C, interrupts, and power. Includes a printable table and practical wiring tips.

Interfacing HC-SR04 Ultrasonic Sensor with Arduino
Measure distance accurately using ultrasonic sound waves and an Arduino Uno — no complex math, no expensive hardware.
HC‑SR04 Ultrasound Distance Measurement with Arduino – Parking Alert (LCD & Buzzer)
Learn HC‑SR04 ultrasound distance measurement with Arduino Uno. Build a parking alert system with 16x2 LCD and buzzer – shows distance and beeps faster as you approach.