ActuatorsMotor
DC Gear Motor with L298N Driver
Classic brushed DC motor + dual H-bridge driver combo.
Wiring & code for
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.