Electronics for Building Things · Lesson 16 · Motion & the Physical World
DC Motors & Motor Drivers
Make something spin — in either direction, at any speed — without frying your board.
Motors are where your projects start to move. The motor itself is simple; the important part
is everything you learned earlier coming together: a pin can't drive it, it's an inductive coil, and it
needs its own power. Get the pattern once and every motor project follows it.
The one win
You can spin a DC motor forwards and backwards and control its speed — through a driver, the safe way.
How a DC motor behaves
A DC motor spins when you apply voltage. Two simple rules:
Polarity sets direction. Swap + and − and it spins the other way.
More voltage → faster (and we'll get "more voltage" using PWM).
But a motor is a coil of wire — an inductive load. That means two warnings you already know:
it draws far more current than a pin can give (Lesson 4),
and it kicks back voltage spikes when switching (flyback, Lesson 11).
Never wire a motor straight to a pin
It will brown out or destroy the pin. A motor needs its own power supply and a
driver in between.
The motor driver and the H-bridge
A motor driver board does the heavy lifting. At its heart is an
H-bridge: four switches arranged so they can connect the motor to power in
either polarity — giving you both directions — plus built-in protection
(SparkFun: Driving Motors with Arduino).
The board sends low-power control signals; the driver switches the motor's own supply.
Grounds are shared (common ground, Lesson 4).
Control is just digital + PWM from earlier lessons:
Two direction pins (digital): one HIGH, one LOW → spin one way; reverse them → other way.
Rule of thumb
Use a motor driver board (e.g. TB6612FNG or L298N) sized for your motor's voltage and
current. Give the motor its own supply, share ground with the board,
and you're set — the driver handles flyback and the heavy current.