SRF08 Ultrasonic sensor and Cerebot

From RoboCup

Jump to: navigation, search

See also: SRF02 Ultrasonic sensor and Cerebot, CMPS03 Compass sensor and Cerebot


The SRF08 ultrasonic sensor is more advanced version when compared to SRF02. It has similar pin-interface and can also be accessed using the I2C bus. The difference is that it can return all echos of the sonar signal, not only one echo as SRF02. When a sonar sends the sound pulse, it waits for the reflections. However, usually several reflections are received, because the signal reflects from all objects and then reflects back. It can be useful to analyze all the reflections instead of relying on simple analysis that selects a single reflection performed in the SRF02 sensor. The selected reflection may correspond to false readings due to the reflections. :-)

Other great features of SRF08:

  • ambient light sensor that can be used to seek darkness or bright light
  • possibility to set the strength of the sound pulse (gain) in order to reduce the chance of reflections from distant objects and thus increase the scanning frequency (decrease range)
  • the sensor can detect distances to objects as close as 2cm (as compared to SRF02 that has limits somewhere around 16cm)

This project aims to provide a simple program in C that can control this sensor.




  • A simple program for testing the SRF08 sensor, reading the values, light intensity, and setting the gain and range can be downloaded here:, see the readme.txt file for details.
Personal tools