in the illustration). The red and white
wires of the servo extension attach to
the Normally Open (N.O.) lugs of the
switch; the black wire serves as ground
and needs to be jumpered to the
Common lug of each switch.
As the lugs on these switches tend
to be rather large and mounting space
on the front of the ArdBot II is limited,
you may find it necessary to bend or
break off the remaining Normally
Closed (NC) lug if the switch has them.
(If your switches have only two lugs
each, be sure the lugs are for
Common and NO) Switches that only
have an NC connection will not work
with the demonstration sketches
provided in this series.
Physically mount the leaf switches
to the front of the ArdBot II using 4-40
x 3/4" machine screws and nuts. If the
leaf on the switch is under 3" long,
add extensions by cutting to length
two pieces of 0.170" inside diameter
(ID) clear rubber aquarium tubing. You
can get this tubing at hobby fish
supply stores and, of course, home
improvement outlets. After cutting,
just slip over the leaf.
Tip: Cut the tubing a bit long
to start, then trim the length
The switches connect to the Arduino
as shown in Figure 6. Use a three-pin
breakaway male header, and insert
between the opposite end of the servo
extension and pins 2, 3, and 4 of the
It's always nice to get a little bit of
feedback from your robot. Sound is a
quick and simple way of doing that. The
Arduino lacks sound-making hardware like
a speaker, but it's easy enough to add it.
Rather than a big ’ol speaker and amplifier
that goes to 11, all we need is a mini
piezo sound element.
The Arduino can directly drive the
element without requiring any additional
SERVO 09.2013 53
FIGURE 5. Here's how to wire the
Part 1 and is shown here for your
convenience, as the batteries and
switches use lengths from the same
three-wire servo extension.
FIGURE 6. Connect the switch
wiring as shown. Be sure the
black wire (ground) is connected
to pin 4 of the Arduino.