« Previous - Version 7/9 (diff) - Next » - Current version
Anthony Rowe, 10/26/2008 05:54 pm

= Devantech SRF02 Ultrasound Interface =
This page describes how to connect the Devantech SRF02 Ultrasound sensor to a FireFly sensor node. This could be used for ranging, or with multiple FireFly nodes, difference in time of flight ranging can be done using the "fake" mode of the SRF02.

For more information about controlling the SRF02, please see the following [http://www.robot-electronics.co.uk/htm/srf02techSer.htm technical specification].


Wire the SRF02 to the FireFly node as shown above. The battery is optional, but allows the ultrasound transmitter to produce a stronger signal.


This is a photograph of the ultrasound connector wired up according to the schematic.


By soldering a header on top of the receptical, it is possible to program and receive debugging data from a node even with the ultrasound module attached. Only do this for boards that will be used for debugging. Otherwise just solder directly onto the receptical.


Adding a jumper to the Ultrasounds UART TX line is required for programming the FireFly node while the ultrasound board is attached. Since the programming board uses the same UART lines, if the ulrasound TX is left connected during downloads, the ultrasound board may send signals that corrupt the FireFly firmware.


The above photo shows the FireFly board with the ultrasound and the programmer connected.

The following is the most basic software required to make the ultrasound device ping.

void Task1() {
// Setup uart for ultraound board

// Reset the ultrasound sensor

// Wait for the ultrasound module to reset

while(1) {
// Ultrasound default address is 0 by default
// Ultrasound fire modulated pulse


The SRF02 can be instructed to listen only for the transmission from another module using a command of 0x56,0x57 or 0x58 depending on
what range type you wish to be generated. The 40khz pulse can then be fired from another module with a command of 0x5C, this will just transmit and not listen for a response.

86 0x56 Fake Ranging Mode - Result in inches
87 0x57 Fake Ranging Mode - Result in centimeters
88 0x58 Fake Ranging Mode - Result in micro-seconds

92 0x5C Transmit an 8 cycle 40khz burst - no ranging takes place

ultrasound-1.jpg - Overview photo (266.8 kB) Anthony Rowe, 10/26/2008 05:31 pm

stacked-header.jpg - stacked header so that you can still use the debugger (120.4 kB) Anthony Rowe, 10/26/2008 05:32 pm

jumper.jpg - Optional jumper for programming node while ultrasound board attached (176.5 kB) Anthony Rowe, 10/26/2008 05:33 pm

programmer-connected.jpg - Picture of programmer connected to node with ultrasound board (521 kB) Anthony Rowe, 10/26/2008 05:39 pm

ultrasound-schmatic.png - Picture of programmer connected to node with ultrasound board (26.1 kB) Anthony Rowe, 10/26/2008 05:40 pm