Your subject text and message text don't quite agree here. Are you
wanting a proximity sensor, or a distance sensor?
This type of sensor is not capable of measuring distance. It is only for
proximity: if the object is within a distance that reflects back enough
light to be registered. As different types of materials reflect
different amounts of infrared light, it is not possible to simply gauge
distance by the strength of the reflected light.
You need an IR sensor that works using light parallax or some other
technique. The most common parallax distance sensors are those made by
Sharp. They're available from a number of robotics specialty outlets.
I would avoid a basic sensor using unmodulated light. They're okay for
playing around, but for anything consistent you'll want modulated light,
using an IR receiver tuned to that modulation. Kits and circuit examples
abound on the Internet for these. Check out Google for the phrase
Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here.
All logos and trade names are the property of their respective owners.