Sound & motion · Lesson
12 min read
DC motors and drivers
Control speed and direction through an H-bridge driver.
What You Will Learn
- Explain why GPIOs can't drive motors directly
- Use IN1/IN2 for direction
- Use PWM on EN for speed
A small DC motor can draw 200–1000 mA — far beyond the 20 mA a pin can give — and it creates voltage spikes when it stops. A motor driver (H-bridge) like the L298N or TB6612 does the heavy lifting; the Arduino only sends signals.
| IN1 | IN2 | Motor |
|---|---|---|
| HIGH | LOW | forward |
| LOW | HIGH | reverse |
| LOW | LOW | stop (coast) |
| HIGH | HIGH | brake |
DC motor speed & directionarduino-uno
Note: Knob = speed, button = direction.
Power motors from their own battery pack, connected to the driver's motor supply, and connect that battery's − to the Arduino's GND.
Check Your Understanding
Test what you learned in this lesson