This time, we’re going
to focus on one possibility:
ultrasonic ranging systems.
Specifically, we’ll take a look
at the MaxBotix MaxSonar
ultrasonic range finders
which are reliable, relatively
inexpensive, and very easy to
interface to our TankBot.
MaxBotix “EZ”
Ultrasonic Range
Finders
In the previous TankBot column, we
simplified our IR obstacle detection
system to make it smaller so that the IR
circuitry could coexist on the breadboard
with the next project (or two) that we
would construct. This month, we’re going
to make good use of the extra space we
created. Our IR obstacle detection project
implemented a highly useful sensory
system for the TankBot, but it does have
one limitation: the system is only able to
detect obstacles within a relatively short
distance. While this is certainly a valuable
skill in any autonomous robot, it would
also be helpful if the TankBot’s “vision”
could extend farther into its environment.
Although a complete robotics vision
system may be beyond the TankBot’s
capabilities, there are other reasonably
simple sensory systems that can greatly
extend any bot’s range of vision.
The MaxBotix “EZ” line of
ultrasonic range finders currently
consists of five sensors (EZ0,
EZ1, … EZ4), each of which has
a progressively narrower beam
width for object detection. (See
www.maxbotix.com/uploads/
MaxBotixNewProducts.pdf
for details.) The entire line is
available at SparkFun
(
www.sparkfun.com) — just
search for MaxBotix. We will be
using the EZ1 unit, but they are all
functionally equivalent, so just choose
whichever beam pattern you prefer
and you’ll be fine.
The EZ1 happens to be the least
expensive unit but that’s not why I
chose it (no matter what my wife may
tell you!). It’s also the first unit that
MaxBotix released way back when I
originally purchased it and I think it
provides a good balance between
beam width and detection range. For
example, the EZ1 is capable of detecting a one inch dowel within a two
foot range at a distance of eight feet
(again, see the earlier link for details)
— pretty impressive, if you ask me!
All of the current MaxBotix range
finders operate over a voltage range
of 2.5V to 5.5V (with a 2 mA typical
current draw — also pretty impressive)
and provide three simultaneous
outputs (analog voltage, pulse
width, and serial) of ranging
data. For our purposes, the
serial output is the least suitable
format in that it would require
some coordination of timing
between the 14M and the EZ1
in order to accurately process
the serial data. Also, when the
“servo” command is executing
in the background, the internal
demands on the 14M cause
other command execution times
to be slightly extended.
For this reason, the
background servo pulses are
temporarily disabled whenever
timing-sensitive commands
are executed. I have been
experimenting with adding a
small, serialized LCD to the
TankBot and so far it has been
a disaster — whenever I send
data to the LCD, the TankBot
jerks and jitters erratically. The
same thing would happen if
we tried to receive serial data from
the EZ1, so we need to use one of
the other formats.
The pulse width data would be
much simpler for the 14M to handle.
The EZ1 repetitively outputs a pulse
width representation of the distance
to the nearest object. The total width
of the pulse is simply 147 µs per
inch of distance to the object, so it
wouldn’t be difficult to use the 14M’s
SERVO 07.2009
67