Try the following link, it will help you Interfacing HC-04 Ultrasonic Sensor with PIC Microcontroller