Figure 3, which means you must use an ADC (
analog-to-digital converter) to obtain the reading. There are several
things we can learn from this graph.
First, objects nearer than 5 cm can appear to be farther
away because the voltage generated is the same as a more
distant object. Also notice that the main part of the graph
has an inverse relationship with the distance (the voltage
decreases as the distance increases). Finally, observe the
non-linearity of the voltage/distance relationship. This
means calculations are necessary to extract the actual
distance.
The Parallax PING))) sensor shown in Figure 4 utilizes
sound waves to measure distances up to three meters. In
order to obtain distance readings from ultrasonic sensors,
you generally must write a program that triggers the unit to
send out a burst of ultrasonic sound. The program then
counts the time it takes for the wave to hit a remote object
and reflect back to the receiver, and then uses that time to
compute the distance to the object. This calculation is
linear, so it is much easier than that required for the IR
sensor of Figure 2.
The signal indicating the wave has been received is a
digital (true/false) indication, but again, these sensors are
often referred to as analog because the data they ultimately
provide is a variable quantity.
These two examples demonstrate why it can be more
difficult to obtain ranging information than to simply detect
the presence of an object with a digital sensor. When
distance data is not needed, the low cost and ease-of-use
of digital sensors can make them attractive — especially for
less sophisticated robots or beginning hobbyists. Even
ranging sensors, however, have their own limitations.
IR sensors can only sense objects that reflect light back
to them, so dark objects that absorb light or objects with
surfaces that greatly disperse light can be difficult to detect.
IR rangers are particularly susceptible to this problem
because the amplitude of the IR wave is small to begin with
and it decreases with the distance being measured.
Ultrasonic sensors generally require software routines
to measure the time for sound waves to bounce off objects
and return to them. The linearity of the time-distance
relationship makes it easy to obtain fairly accurate readings,
but ultrasonic sensors can have trouble reliably detecting
soft objects (such as stuffed animals, curtains, etc.) that
absorb sound waves.
Both IR and ultrasonic sensors can have trouble
detecting surfaces that are not somewhat perpendicular to
their beams because angled surfaces can reflect the waves
off to the side instead of back toward the sensor. In
addition, the IR and ultrasonic sensors generally used for
robotics can only reliably measure distances of 3-10 feet.
Often, an object that is difficult to detect with
ultrasonics is easily seen with an IR-based sensor (and vice
versa). For that reason, there are advantages for giving your
robot both types so it can spot objects detected by either
sensor. Parallax provides a dual-mounting bracket for IR and
ultrasonic sensors (Figure 5) to help facilitate such an
arrangement.
SERVO 11.2015 61
Figure 4.
Figure 3.
Figure 5.