SRF02 ultrasound sensor.

The ultrasound module is a SRF02 from Technobots.
The SRF02 is controlled by a PIC16F690(but any PIC with ADC and USART support will do). The PIC16F690 reads the SRF02 in I2C bit-bang mode(the same as the compass module CMPS03).

The PIC16F690 also reads an ADC pin, which is connected to a pot on the rear panel. This pot sets the RANGE_LIMIT of the SRF02, from 0cm to 255cm. Any reading below RANGE_LIMIT will set the robot into a turn. A switch is used to break the wiper from the pot to the ADC, so it will read 0v(100k res. to 0v on ADC pin), and the program will not convert the ADC value into a new RANGE_LIMIT.

When running, the PIC16F690 code reads the ADC value and if below 25cm sets pin RC2 high, this pin is connected to the MAIN PIC(also to a red LED on the control panel), which will read this pin and if high sets the robot into reverse. I have set the RANGE_LIMIT to around 40cm(which is saved in EEPROM), so doesn't need setting everytime the robot is started. If the PIC16F690 reads a value less than this, pin RC1 is set high, this pin is connected to the MAIN PIC(also a yellow LED on the control panel), which will read this and if high set the robot into a turn. The values read from the SRF02 are also converted into digits, and if allowed by the MAIN PIC, are sent to the Radio TX module to be transmitted to the handheld LCD display. A 4 wire telephone cable is used to connect the circuit board to the SRF02 module.



 SRF02 ultrasound sensor and support bracket.

SRF02 ultrasound sensor with telephone cable connection and support bracket.



 SRF02 ultrasound sensor circuit board.

SRF02 ultrasound sensor circuit board.



 SRF02 ultrasound sensor controls.

SRF02 ultrasound sensor controls on the main control panel.



Code for PIC16F690