
Controlling a DC Motor with an L298N Driver
An Arduino pin can't power a motor directly — it can't supply enough current, and it can't reverse the flow. An L298N H-bridge solves both: the Arduino sends low-power control signals, and the driver switches the motor's own battery to run it forwards, backwards and at any speed. This is the core building block of every wheeled robot.
ལམ་སྟོན
Wire the driver, motor and battery
Wire the driver, motor and battery
Push the L298N's control header into the breadboard. From the Arduino, jumper pin 8 to IN1, pin 9 to IN2, and pin 10 to ENA. Connect the DC motor's two wires to the OUT1/OUT2 screw terminals, and a 4×AA battery pack to the +12V and GND motor terminals. IMPORTANT: join all the grounds together — Arduino GND, driver GND and battery GND — or the motor won't run.
གོམ་པ་འདིའི་རྫས་རིགས:
Arduino Uno R3 SMD1 piece
Full-Bridge Motor Driver Dual - L298N1 piece
Hobby Motor - Gear1 piece
Battery Holder - 4xAA Square Terminated1 piece
Breadboard - Classic1 piece
Jumper Wires Premium M/M 20 AWG - 15.5 cm1 packConnect and open the IDE
Connect and open the IDE
Plug the Arduino into your computer with the USB cable, open the Arduino IDE, and select Arduino Uno and its serial port. Leave the motor battery switched off until the code is uploaded.
གོམ་པ་འདིའི་རྫས་རིགས:
SparkFun Cerberus USB Cable - 1.8 meter1 pieceལག་ཆས་དགོས་མཁོ:
Computer with Arduino IDEUpload the motor sketch
Upload the motor sketch
Paste this sketch and upload, then switch on the battery. The motor runs forward, stops, reverses, and stops — on a loop.
Test and control it
Test and control it
Watch the motor go forward, stop, reverse. IN1/IN2 set the direction (swap which is HIGH to flip it); the number in analogWrite(ENA, ...) sets the speed from 0 (off) to 255 (full). If the motor doesn't spin, check that all three grounds are joined and the battery is on.
Make it a robot
Make it a robot
The L298N drives TWO motors. Wire a second motor to OUT3/OUT4 and control it with IN3, IN4 and ENB on three more Arduino pins. Two motors on a chassis with wheels gives you a robot base you can drive — turn by running the wheels at different speeds or directions.
རྫས་རིགས
7- 1 piece$27.00
- $4.00
- 1 piece$3.00
- $5.00
- 1 piece$10.00
- $6.00
ལག་ཆས་དགོས་མཁོ
1- ས་ཆ་འཛིན
འབྲེལ་ཡོད་བིལུ་པིརིན་ཊི
བིལུ་པིརིན་ཊི་འདི་ཚུ་ཐབས་ལམ་དང་རྫས་རིགས། སྤྱི་ཆོས་བགོ་བཤའ་བྱེད
Related blueprints
Other builds that share materials, tools, or techniques with this one.
CC0 སྤྱི་དབང
བིལུ་པིརིན་ཊི་འདི་CC0 འོག་བཀྲམས་ཡོད། ཁྱེད་རང་གིས་ཆོག་མཆན་མ་བཞེས་པར་ཕབ་ལེན་དང་བཟོ་བཅོས། བགོ་བཤའ། དགོས་མཁོ་གང་ལའང་བཀོལ་སྤྱོད་བྱས་ཆོག
བཟོ་མཁན་ལ་རྒྱབ་སྐྱོར་བྱེད་པའི་ཆེད་ཁོང་ཚོའི་བིལུ་པིརིན་ཊི་བརྒྱུད་ཐོན་སྐྱེད་ཉོ། བཟོ་མཁན་གྱིས བཟོ་མཁན་གྱི་ཁེ་ཕོགས ཚོང་པས་གཏན་འཁེལ་བྱས་པ། ཡང་ན་བིལུ་པིརིན་ཊི་འདིའི་པར་གསར་བཟོས་ཏེ་ཁྱེད་རང་གི་བིལུ་པིརིན་ཊི་ནང་མཐུད་སྦྲེལ་བྱས་ཏེ་ཡོང་སྒོ་བགོ་བཤའ་བྱེད།





