FIGURE 2. The leaf switch acts as a kind of
cat’s whiskers. It’s connected to a digital
I/O pin using a pull-down resistor.
What’s covered here applies to most any robot that
uses the Arduino microcontroller, and that runs on two
motors and rolls on wheels or tracks. You’re free to adapt
the techniques and programming code to whatever bots
you’re constructing. The ArdBot is an expandable platform,
but it’s also a concept that represents the typical desktop-size robot.
The subject of sensors is pretty involved. There’s no
way to cover all the interesting things in just one article.
So, next month you’ll learn about other kinds of
inexpensive sensors you can use with your ArdBot (or
Getting in Touch
With Your Robot
Sensors — whether in humans or in
robots — are designed to produce a
reaction. What that reaction is depends
on the nature of the sensation. Type and
quantity matter. We interpret the feeling
of a soft summer breeze as a good
sensation. Increase the amount of air
pressure to hurricane force and decrease
the temperature to something below
freezing, and suddenly the same senses produce a highly
Touch — also called tactile feedback — is a primitive
reactive sense. The robot determines its environment by
making physical contact; this contact is registered through a
variety of touch sensors. What happens when contact is
made is entirely determined by the programming you apply
within your robot.
Most often, a collision with an object is a cause for
alarm. So, the reaction of the robot is to stop what it’s
doing, and back away from the condition. In other cases,
You can enlarge the contact area
of the leaf by gluing or soldering
bigger pieces of plastic or metal to it.
For example, you can cut up some stiff
music wire (available at hardware
stores) or a cheap wire clothes hanger,
and bend it to some fancy shape.
Making Reusable Sensor Components
The more you experiment with robotics, the more you’ll want to build a drawer-full of reusable parts that easily plug into
your projects. Sensors especially.
With just a bit of wire, some heat
shrink tubing, and a length of snap-off
male header pins you can build modular
sensors that can be shared between
projects. The pins easily plug into a
solderless breadboard. Figure A shows a
photoresistor attached to an eight inch
length of wire which is terminated into a
three-prong male header (only two pins
are used; the third is cut off).
First, start by cutting some 22 or 24
gauge insulated stranded conductor wire
to the desired length. Don’t be stingy with
the wire, but don’t make it so long the
extra gets in the way. Give yourself an
additional inch or two so you can twist
the leads together to make a nice pigtail.
Strip about 1/4” insulation off both
ends, and use your soldering pencil to
pre-tin the wire. Do the same for the leads
on the photocell and the header pins.
Exercise care when soldering to the
photocell leads, as excessive heat can
damage the component. After tinning is
complete, carefully tack-solder the wires
to the leads or pins.
I like to use heat shrink tubing to
finish off the soldered ends. The tubing
FIGURE A. Use male header pins to
prepare connectors for easy
interchange with your various
projects. The connectors plug into
a solderless breadboard.
makes for a more professional look, plus it
helps prevent short circuits. When applied
properly, it acts as a strain relief to help
keep the wires from pulling apart from
their joints. Buy a small assorted package
of tubing, and use the smallest diameter
for the best fit.
Header pins have a 0.100” spacing
which is a fairly tight space for all but the
most seasoned solder pros. So, you’ll
probably want to snap off a set of three
or four pins, and remove the center pins
to make extra room for your solder joints.
68 SERVO 02.2011