The GP2Y0A21YK0F IR distance sensors are a compact sensor for robotics and electronics projects. They can detect from 10cm to 80cm which makes them great for obstacle avoidance in robots or distance measurement.
The Sharp IR sensors measure the angle of the reflected light rather than intensity which allows for them to give an accurate reading with minimal effects from background light sources.
It has an analogue output which makes it easy to use and read using an ADC input on a microcontroller or Arduino.
GP2Y0A21YK0F is a distance measuring sensor unit, composed of an integrated combination of PSD (position sensitive detector) , IRED (infrared emitting
diode) and signal processing circuit. The variety of the reflectivity of the object, the environmental temperature and the operating duration are not influenced easily to the distance detection because of adopting the triangulation method. This device outputs the voltage corresponding to the detection distance. So this sensor can also be used as a proximity sensor.
DIY Robot II