FIGURE 10. How to
interface a resistive
sensor to the Arduino.
servos are powered, or else disconnect the servo lines from
pins D9 and D10.
Detecting Touch With
A third simple and cheap way of directly detecting
contact is using resistive film sensors. These are often
60 SERVO 08.2012
referred to by their trade name for Force Sensitive Resistor
(or FSR). These sensors are essentially variable resistors that
react to changes in applied pressure. They're easy to
interface to the Arduino as shown in Figure 10. Select the
fixed resistor based on the sensor you are using and the
desired sensitivity. I used a 10 KΩ resistor because I had it
handy. Feel free to experiment.
You can use the Listing 4 sketch for reading values
from the resistive film sensor. The range of return values is
larger (and more predictable) than when using piezo
elements, so you can reliably set a higher threshold. In my
prototype, I got values of 700+ when applying light to
medium pressure to the 1.5" square resistive sensor from
SparkFun (item SEN-09376). When used as a contact
sensor, the device shows contact with values as low as 50
to 100. Use double-sided tape to mount the resistive film
on a bumper that extends from the front of the robot.
Last Points to Touch On
Of course, there are even more sensors your robot can
use to detect when it's banged against something. Some
are more elaborate than others. An accelerometer can
detect the shock of impact, and can even determine when
the robot has stopped when it should still be traveling.
Keep your eyes open and ears to the ground, and you're
sure to discover all kinds of nifty techniques to help your
robot get a feel for its environment. SV
with every prototype order
EAGLE order button
on your first order
Call Tyler: 1 707 447 7744
PCB-POOL® is a registered trademark of