The SRF05 sonar distance sensor is an upgrade to the popular SRF04. It draws less current while increasing range over the SRF04. A new 1-pin interface makes it simple to integrate this distance sensor into pin-constrained systems. However, the SRF05 is also completely backward compatible with the SRF04.
With a tight beam width, low power and fast reading rate, the SRF05 is ideally suited for object avoidance in robotic applications. Simple fixed point calculations can provide distance approximations for use in further calculations, robotic mapping, or path planning.
The SRF05 timing diagrams are shown below for each mode. The distance measurement is triggered with a 10µs pulse on the trigger input. The SRF05 will send out an 8 cycle burst of ultrasound at 40kHz and raise its echo line high (or trigger line in mode 2). It then waits for an echo, and lowers the echo line when it detects one. The echo line is therefore a pulse whose width is proportional to the distance to the object. By timing the echo pulse it is possible to calculate the range. If nothing is detected then the SRF05 will lower its echo line anyway after 30ms.
If the width of the pulse is measured in µs, then dividing by 58 give a distance approximation in cm; similarly dividing by 148 gives a distance approximation in inches. µs/58=cm or µs/148=inches.
The SRF05 can be triggered approximately once every 50ms, or 20 times each second. There should be atleast 50ms between each trigger, even if the SRF05 detects a close object and the echo pulse is shorter. This is to ensure the ultrasonic signal has faded away and will not cause a false echo on the next reading.
The SRF05 has a relatively directional beam which makes it great for object detection in robotic applications. The chart below shows the beam width for a typical SRF05.