Page 165 - Making things move_ DIY mechanisms for inventors, hobbyists, and artists
P. 165
144 Making Things Move
Motor Control
Many times in mechanism projects, you want to do more than just turn a motor on
and off. You might need it to spin a certain number of times, point a camera at a
certain angle repeatedly, or raise and lower a window shade. You can also make your
motor react to certain sensors and switches, like using a photocell to help lower your
window shade automatically when it gets too bright. In the following sections, we’ll
talk about how to go from just getting a motor to work to more advanced ways to
control them. There are whole books written on motor control, so this section is not
exhaustive, but it will get you (and your motor) moving. I’ll point out additional
sources as we go along.
In the spirit of rapid prototyping, we’ll try to minimize soldering and maximize our
use of breadboards and ready-made modules to talk with our motors. It can be
time-consuming and takes special equipment, but it is a handy skill to have, so we’ll
go through a quick example.
Solderless breadboards are much easier to use for quick prototyping. A breadboard is
a way of connecting wires and other components together to make circuits quickly.
Once you go through the breadboard example, we’ll kick it up a notch and use the
Arduino prototyping platform—a kind of mini-computer—to give our motors more
complicated instructions. Finally, we’ll integrate an off-the-shelf module and an
Arduino to control a stepper motor. If this all sounds like Greek to you, don’t worry.
We’ll go through each project step by step.
Basic DC Motor Control
All you need to do to get a DC toy or DC gearhead motor to spin is hook it up to a
power source within its desired voltage range.
NOTE The examples here use red, black, and yellow wires for power,
ground, and signal. These appear as gray, black, and white in the images.