Electronics for Building Things · Lesson 17 · Motion & the Physical World
When you don't just want spin — you want a precise position.
A plain DC motor (Lesson 16) just spins. But to open a vent to 30°, point a sensor, or turn a valve a precise amount, you need position control. That's what servos and steppers give you — two different ways to move exactly where you mean to.
A hobby servo is a clever bundle: a small geared DC motor, plus control electronics and position feedback, all in one box. You don't manage the motor — you just send it a target angle and it drives itself there and holds (SparkFun: Hobby Servo Tutorial).
It has just three wires: power, ground, and signal. The signal is a PWM-style pulse (Lesson 14): a pulse repeats ~50 times a second, and its width — between about 1 and 2 milliseconds — encodes the angle. 1.5 ms is center.
myservo.write(90) sends the right pulse for
90°. Wire three pins, call write() with an angle, done.
Two flavors: a standard servo moves to an angle (often 0–180°); a continuous-rotation servo ignores angle and instead spins at a speed/direction you set — handy as a simple geared wheel motor.
A stepper motor rotates in many tiny, precise steps (e.g. 200 per full turn). Tell it to take N steps and it lands exactly there, and holds firmly — all without any position sensor. That makes steppers great for repeatable, precise motion: blinds, camera sliders, 3D-printer axes, a dialed-in valve.
Like DC motors, steppers need a driver (e.g. A4988, or a ULN2003 board for the common little 28BYJ-48) and their own power. You send step and direction signals (a library handles the sequencing).
| Want… | Use |
|---|---|
| A specific angle, simply, in a small range | Servo |
| Continuous spin you can start/stop/reverse | DC motor + driver, or continuous servo |
| Precise, repeatable positioning over many turns | Stepper + driver |
See also: Glossary · Component field guide · Rules of thumb