i want to design a device to sense the distance between two objects.
for example, when the transmitter is near to the receiver, there will be a beep sound. as the transmitter and receiver gets closer, the beep sound will be come more frequent until a certain range the sound will just be on.
can this be done using IR transmitter and receiver with a PIC? or is there any other better ways of getting the task done?
For distances of a few feet, an ultrasonic sound transmitter and sensor is often used since the slow speed of sound compared to light makes it much easier to measure the distance from the time the reflection takes to travel to the target and return to the receiver.
If you want to use light then the easiest would be to hack into one of the laser distance measurement devices sold in hardware stores.