PIC16F876 ve AD605 ile Ultrasonik Mesafe Bulucu

The Ultrasonic Range Finder is triggered to return a range sample by communication via I2C interface. After receiving the PIC’s address (which is programmable), a hexadecimal 0×0d, or Carriage Return byte received will cause the module to take a range sample. After triggering a short time period should be delayed to allow the PIC to record the return signal strength for every 2 inches sound travels at room temperature.
When triggered, the PIC processor uses the PWM capability of the Capture/Compare module to generate 16 pulses of approximately 50% duty cycle to an FDV303NCT N-Channel Logic level MOSFET. The micro-controller is then set up to delay 1ms to allow the Ultrasonic Receiver to settle from the Transmitted pulse.
After the damping time of 1ms is finished, the processor starts an interrupt driven time delay that is equal to the time it takes sound to travel 2 inches (travel an inch, reflect off an object, travel back an inch) at room temperature 255 times and increment a register for inches. The Receiver Transducers output is connected to an AD605 Amplifier wired for maximum adjustable gain (0dB-96.8dB). The amplifiers output is taken through a voltage doubler circuit and rectified before entering the PIC16F876’s A2D converter. Each returned pulse is averaged with the previous returned pulse to help cancel out noise and the largest pulses corresponding inches register value is recorded as the largest objects distance.
