draw 20 mA or less, which can be driven directly by a micro
pin (Google “flyback diode” if you do this).
Figure 4C shows a larger relay in a module with an
onboard driver transistor to send a large coil current when
triggered by a small current from the micro. The single
pole/double throw (SPDT) contacts on this 88 cent relay
can handle ~10A ( www.ebay.com/itm/262500451836).
This relay could switch a medium-sized DC
motor, or even a 120 VAC lamp!
Transistors are a better option. Power
transistors (e.g., TIP31, etc.) and more efficient
MOSFETs (e.g., IRF510, etc.) are three-pin solid-state components which allow motor speed
control through rapidly switching on/off in short
bursts (PWM). Just as you used PWM to dim
your LED (reduce its power intensity), you can
now slow your motor (reduce its power
Like relays, a single transistor can only drive
a motor in one direction (but at variable speeds)
per the schematic in Figure 5A, which uses a
single microcontroller pin. For full bidirectional
(forward/reverse) speed control, use an H-bridge as shown in Figure 5B, requiring two
microcontroller pins. Of course, there’s a lot of
soldering to hook up those four transistors, so
keep reading ...
H-bridge Modules are convenient,
plentiful, and the next cheapest thing after
photocells. Many modules have two or more
channels to control multiple motors. They come
in various sizes, based on the current capacity.
Three examples are shown in Figure 6.
The small L9110S module controls two
motors for up to 800 mA each. The larger
L298N module also has two channels, rated
up to 2A each with that heatsink. Your
easiest Arduino solution is the L293 motor
shield which has four channels rated up to
There are also many specialty motor
controllers for use with robotics made by
Adafruit, Parallax, and Pololu to name a
few. Some have dedicated microcontrollers for
added features, such as offering “set & forget”
PWM output, or using servo pulse widths (1-2
ms) instead of PWM commands. Of course,
Continuous Rotation (CR) servos are basically
gearmotors with built-in motor controllers.
One benefit of CR servos or controllers
using servo pulses is that they require half the
pin connections to the microcontroller. This frees
up pins to read sensors or drive more motors,
gizmos, and LEDs. Every robot needs plenty of
Q. I’d love to build an R2D2 robot for fun. Where might I start?
10 SERVO 09.2017