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).
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.