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
- 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.
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 |
Swipe sideways to see every column →
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
BLDC ESC
High-speed brushless motor and electronic speed controller combo.
L298N Driver
Dual H-bridge motor driver — the standard for controlling two DC motors or one stepper.
NEMA17
The standard 42 mm stepper behind most 3D printers and small CNC machines.
Stepper 28BYJ48
Low-cost geared stepper for precise, low-speed positioning.
Related Guides & Projects
Arduino Uno R4 Minima Pinout: Every GPIO, ADC, DAC, and Op-Amp Pin Explained
A complete Arduino Uno R4 Minima pinout reference — digital I/O, ADC, DAC, op-amp, CAN, dual UART, and exactly what it leaves out compared to the WiFi variant.
Mastering PWM on Arduino: Dimming LEDs and Controlling Motors
Understand what PWM actually is on Arduino, dim an LED smoothly, and safely control a DC motor's speed with a driver chip -- plus the mistakes (like wiring a motor straight to a pin) that damage boards.
4-Digit 7-Segment Counter with TM1637 & Arduino
Drive a TM1637-based 4-digit 7-segment display with Arduino Uno to show a real-time up/down counter, elapsed timer, and scrolling text. Covers library setup, brightness control, and custom segment mapping.
Arduino Uno R4 Minima vs WiFi: Which One Should You Choose?
Same processor, same memory, different price. Here's what the WiFi variant's extra hardware actually gets you, and when the Minima is the smarter buy.