The Sharp GP2Y0A21YK0F infrared distance measuring sensor uses a beam of infrared light to reflect off an object to measure its distance. Because it uses triangulation of the beam of light to calculate the distance, it is able to provide consistent and reliable readings which are less sensitive to temperature variation or the object's reflectivity than other sensing types. Output from the sensor is an analog voltage corresponding to the distance of the object, which can be read easily using an inexpensive analog-to-digital converter (ADC) chip.

The sensor has a 3-pin interface via a JST S3B-PH connector.

Infrared Sensor Features

Distance measurement range: 10 to 80 cm (3.9 to 31.5 inches)

Analog output voltage corresponds to distance, typically 0.4V to 2.3V

Operates on 5V supply, typical consumption 30 mA

Convenient 3-pin interface

Two mounting holes spaced 1.46 inches (37 mm) apart

Dimensions: 1.75 × 0.74 × 0.53 inches (4.45 × 1.89 × 1.35 cm)

Operation temperature: 14 to 140 °F (-10 to +60 °C)

For farther detection, see the GP2Y0A02YK0F, which has a range of 20 to 150 cm.