Reach Out and
Touch Something
Giving Your Robot
the Sense of Feel
It’s not enough that your robot rumbles and bumps across the floor. You want
your mechanical creation to know when something is in its way, so it’ll either
steer around the object, stop, or growl something scary to make the object
move. Detecting stuff in front of us is easy enough for us humans, but for a
robot it requires adding one or more sensors.
One sure way to detect objects is to make physical contact with them. Sure, it sounds primitive but contact is the most common form of object
detection. It’s the cheapest to implement — just a buck or
two to get started — and it forms the basis for the sensory
network on any robot, large or small.
In this article, you’ll learn about a trio of common and
inexpensive touch sensor types you can add to your bot. I’ll
provide basic hookup examples and coding for the Arduino,
but know the same concepts can be applied to any
microcontroller or other control circuit. This time around,
we’ll introduce the sensors and how to interface them to
your Arduino. Then next month, we’ll demonstrate their
actual use on an actual robot. Fun stuff, so let’s not delay!
FIGURE 1. Connecting a
momentary (spring-loaded)
pushbutton switch to work as a
bump detector. The output state
changes whether the switch is
open or closed.
48 SERVO 07.2012
Understanding Robotic Touch
Touch lets your robot determine its surroundings by
making physical contact. This contact is registered through
a detector or sensor of some type which is connected to
the robot’s main processor or control circuit. There are a
variety of touch sensors for low-cost educational and
amateur bots; the most common are switch, resistive
pressure, and piezo. We’ll cover all three in this article.
How the robot reacts to touch is defined by its
programming or wiring. The robot assesses the action (the
sensor makes contact), and turns that into an action. Most
often, a collision with an object causes the robot to stop
what it’s doing and back away. Depending on the
circumstances, contact can mean other things, like your
robot has found its home base, or that it’s located an
enemy bot and should engage in combat.
The lowly mechanical switch is the most common and
most simple form of touch sensor. Most any spring-loaded
(momentary) switch will do. When the robot bumps into
something, the switch closes, completing a circuit.
In the typical Arduino-based robot, the switch is wired
to one of the input/output pins on the microcontroller like
that in Figure 1. The switch connection normally provides a
low (zero volts) state. When contact is made, the switch
closes and the output of the switch goes high (five volts).
The program running in the Arduino senses this change,
and knows physical contact has been made.
When using a microcontroller, you can determine how
the robot reacts to the physical collision by altering its
programming. With a switch used for a touch sensor, the