| Devantech Sonic Range Finders (SRF) |
Last Modified: 2011-05-05
The Devantech Sonic Range Finders
Devantech has introduced a family of ultrasonic range finding sensors over the past several years. These sensors put out a sonic ping which allows object detection from a few centimeters out to several meters, depending on the sensor. The sensors detect outward in a cone shape which varies sensor to sensor from a near pencil-width beam up to a wide cone.
The purpose of this article is to introduce the technology behind these sensors, discuss their operation, and compare the sensors side by side. Finally, links to examples interfacing the sensors with controllers are listed.
Theory of Operation
Sonic range finders work by emitting a series of supersonic pulses (typically in the range of 40 kHz), which propagate outward from the sensor in a cone shape at the speed of sound (around 0.9 ft/ms in room-temperature air). When encountering an object, the pulses reflect, returning an echo that is detected by the range finder. The time-to-echo is then recorded by the range finder and can be accessed once the ranging is complete.
The minimum range of the SRF is limited by the time it takes to emit a pulse and eliminate any residual ringing in the sensor, typically on the order of 100 usec (microseconds). The maximum range is limited by the power of the pulses, among other things: after a certain range, the echoes are simply too weak to be reliably detected.
All sensors are manufactured with RoHS compliant parts.
No calibration is required for any of the sensors, but some of the sensors require setting the operating mode before starting ranging. Depending on the sensor, the input and output are communicated through an I2C, serial, or digital connection.
I2C (inter-integrated circuit bus, also written IIC) is an industry standard that allows multiple slave devices to be chained to a master device. More information on Acroname's I2C standards can be found on the Acroname I2C Standard page.
The Devantech I2C-based rangers are I2C slave devices. I2C based transactions from a master I2C controller must be sent in a specified packet format documented by Devantech. Operating the sensors via the I2C connection requires three steps. To start a ranging, it is necessary to write to the command register (address 0x00) to set the operating mode as follows:
For instance, to issue a reading on a default SRF08 with the results in inches, an I2C packet should be sent in the following form:
[i2c_device_address | command_register | command] 0xE0 0x00 0x50
Once this is complete, the sensor will begin ranging, which will take less than 100 msec, with the exact time depending on the ranger. During this period the sensor will not respond to I2C activity. When the sensor completes the ranging, it writes the results to one or several registers which can then be read at any time.
Depending on the sensor, other modes are available, for instance a passive ranging mode (which does not emit a ping) for the SRF02 and an artificial neural network mode (which returns data in a form more suitable for neural network robotics) for the SRF08.
In I2C mode, up to 16 sensors may be connected through the bus and assigned unique addresses.
The Acroname serial standard in use with the sonic rangers is a 4-pin TTL-level serial connection. The sensor operates at 9600 baud, 1 start bit, 2 stop bits, and no parity. Many embedded controllers have serial ports that operate at TTL levels. The serial interface includes 5V power, GND, TX and RX lines.
In this mode, communication with the sensor consists of two bytes in the form: [address command]. The sensor address can be set as 0 - 15, meaning up to 16 sensors can be used on a single serial port. The available write commands, depending on the sensor, include the three ranging modes discussed in the I2C section above, several passive sensing modes, and a ping only mode.
In serial mode, a ranging command will trigger a ranging but will not automatically return data from the sensor. This can be done with a read command once the sensor has finished ranging. The sensor will return a two byte result that is the distance to the ranged object.
The SRF04 and SRF05 are different from the other sonic range finders in that they use direct digital lines for both transmit and receive. The SRF04 requires 4 lines, for 5V power (capable of 50mA), ground, echo output, and pulse input, while the SRF05 combines the echo and pulse lines for a total of 3 lines.
To initiate a pulse, the input line should be held low and then brought high for at least 10 usec. The pulse will then be generated on the falling edge of this input trigger. The sensor's output will immediately be set high, and held high for 100 µsec to avoid noise from the initial ping. When the echo is received, the echo line will be pulled low. The time to this fall can then be converted to a distance by the controller using the approximate speed of sound in air of 0.9 ft / ms.
For the SRF05, the operation is identical except that after holding the line high for 10 usec the input (trigger) line switches to an output (echo) line, which can then be read by the controller.
Comparing the Sensors
The following table shows a comparison of the six Devantech SRF sensors. The minimum and maximum range describe the sensor limits at 0 degrees (straight on from the sensor), while the angle describes the rough shape of the sensor cone at 1/2 the sensor's range. In actuality, the sensors do not detect in a perfect cone, as shown in the beam pattern graphs below.
The echoes column lists the number of echoes recorded by the sensor. This always refers to the number of echoes recorded by the most recent ranging; with each new ranging, old values are overwritten. The range time column refers to the time to perform a ranging. The sensors using digital communication respond as soon as an echo is received, which is why the ranging time for these units is variable. Several other sensors have an adjustable gain to change the range time, as noted.
Beam Patterns for the SRF04 / 05 (left) and SRF235 (right)
*: Approximate angle of the sensor cone at 1/2 sensor range (see diagram above).
**: The number of echoes recorded by the sensor. These are the recorded echoes from the most recent reading, and are overwritten with each new ranging.
A: These sensors are smaller than the typical (SRF 04 / 05 / 08) size.
B: Range time can be adjusted down by adjusting the gain.
C: This sensor also includes a photocell on the front for light detection.
D: Operates at a higher 235kHz frequency. See the SRF235 Technical Specifications page for how this affects sensor performance.
| voice: 720-564-0373, email: firstname.lastname@example.org, address: 4822 Sterling Dr., Boulder CO, 80301-2350, privacy |
© Copyright 1994-2012 Acroname, Inc., Boulder, Colorado. All rights reserved.