I decided to buy the SRF08 ultrasonic range finder sensor because of the I2C bus. I build too many sensors into my robot car and got problems with all the wires installed inside the car. The HC-SR04 sensors I used before measured many failures because of all the magnetic fields generated by the 60 wires I used to connect everything. With a bus like the I2C bus used to communicate with the sensors the problems with the electromagnetic interference where solved.

The sensors are the price of 39,- € worth. You do not get only an ultrasonic sensor. In the middle between the receiver and transmitter an analogue gain sensor is also build into the sensor. I would totally recommend this sensor for your robot project. It could measure distances from 3cm up to 6m. This is totally enough for my robot project.

SRF08 Ultrasonic Distance Sensor

SRF08 Ultrasonic Distance Sensor

The ultrasonic sensor is connected as the following figure shows to the I2C bus. Be careful and use an I2C level shifter if you connect the sensor to a Raspberry Pi. The sensor works with 5V and the Raspberry Pi only works with 3,3V.

SRF08 Ultrasonic Distance Sensor I2C data bus

SRF08 Ultrasonic Distance Sensor I2C data bus

The next picture shows my first test setup with a Raspberry Pi, an I2C level shifter in the middle and the SRF08 on the right side of the picture.

SRF08 Ultrasonic Distance Sensor I2C test setup

SRF08 Ultrasonic Distance Sensor I2C test setup

SRF08 – changing the I2C address

It was not so easy to change the I2C address from the SRF08 ultrasonic sensor. I wrote a small Python program with which it is possible to change the address of the sensor. To change the address is important if you connect more than one sensor to you I2C bus at your Raspberry Pi. The default address is 0xE0. The program I developed helps you with a very simple menu to change the address.

Please be careful by using this program. I tried to program it very safe but use it at your own risk.

The picture shows the program and the little menu.

SRF08 Ultrasonic Distance Sensor I2C - address change

SRF08 Ultrasonic Distance Sensor I2C – address change

The Python program to change the address is available for download here: SRF08 ultrasonic sensor – program to change the I2C address


  • Voltage – 5v only required
  • Current – 15mA Typical. 3mA Standby.
  • Frequency – 40KHz
  • Range – 3cm -6m (1.2-2.4in).
  • Max Analogue Gain – Variable 94 to 1025 in 32 steps.
  • Connection – Standard I2C Bus.
  • Light Sensor – Front Facing light sensor.
  • Timing – Fully timed echo, freeing host controller of task.
  • Echo – Multiple echo – keeps looking after first echo.
  • Units – Range reported in uS, mm or inches.
  • Small Size – 43mm x 20mm x 17mm (1.7×0.8×0.7 in) height.

More technical details are available here: http://www.robot-electronics.co.uk

(Visited 3,173 times, 1 visits today)