avoid anything over about 3”.
Solder as shown in Figure 3.
Using a 12” three-wire servo
extension, cut off a 9” portion and
strip the wires on the cut end for
soldering. 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
PropBot is limited, you may find it
necessary to bend or break off the
remaining normally closed (N.C.) lug
if the switch has them. (If your
switches only have two lugs each, be
sure the lugs are for common and
Switches that only have an N.C.
connection will not work with the
demonstration programs provided in this series.)
Physically mount the leaf switches to the front of the
PropBot using 4-40 x 3/4” machine screws and nuts. If the
leaf on the switch is under about 3” long, add extensions
by cutting to length two pieces of 0.170” inside diameter
(I.D.) clear rubber aquarium tubing.
You can get this tubing at hobby fish supply stores, as
well as home improvement outlets. After cutting, just slip
over the leaf.
Here’s a tip: Cut the tubing a bit long to start, then
trim the length as desired.
The switches connect to the PAB as shown in Figure 4.
Use a two-pin breakaway double-long* male header, and
insert it between the end of the servo extension and pins
P5 and P6 of the PAB. The ground wire from the servos
connects to any one of the GND (ground) holes at the
bottom of the breadboard.
(*What’s a “double-long” male header pin? They are
like ordinary headers with male pins but on these, the pins
on both sides are long. This allows the pins to both plug
into the female socket of the servo extension connector
and into the solderless breadboard.)
Note the use of the resistors for the switches. Two 10K W resistors are wired between the input pins and the 3.3V
power header at the top of the solderless breadboard.
These serve to “pull up” the switches so that when open,
they provide a consistent HIGH logic value to the Propeller,
and when closed, the logic level drops down to LOW. The
100 W resistors serve to limit any currents going into the
Propeller’s input pins.
When inserting the resistors into the solderless
breadboard, cut the leads or use a short length of wire
insulation so there isn’t a chance the leads of the resistors
will touch one another. If they touch, the reading of the
switches may not be reliable.
Figure 5 shows the switches mounted on the “front”
of the PropBot. I put “front” in quotes because a robot like
the PropBot really has no front or back. You can operate it
in either orientation. In fact, in a future installment where
we make use of an ultrasonic sensor; the opposite end will
become the front.
SERVO 10.2014 33
Figure 5. The two mini
leaf switches give the
PropBot the ability to
detect objects directly in
front of it.
Precut PropBot body
chassis with all
servos, servo wheels, and
Large variety of miniature
( 4-40 and smaller)
nuts, screws, and
Propeller Activity board,
piezo speaker, servo
extension wire, etc.
Repository for learning
about the Propeller and
other Parallax products.
Refer to the URL for
download links for the
SimpleIDE software and
the Learn Library
examples and files.
Selected sources for
miniature leaf switches
and piezo elements:
Refer to Part 1 of this
series for a full list of
for the PropBot.