Sharp Analog IR Distance Sensor GP2Y0A21YK0F (GP2D12) (10-80cm)

One of the most popular sensors on the market this is the replacement of the Sharp GP2D12. The Sharp GP2Y0A21YK0F infrared (IR) sensor takes a continual distance reading from 10cm to 80cm (4-30") and outputs an analog voltage.

AUD$ 24.95

In stock in Australia  

Shipping from $7.90

+186 more from our supplier in 7-10 days

Our Code: SEN-10003

Supplier Link: [Pololu MPN:136]


This is a very easy to use sensor. Supply power and the sensor outputs an analog voltage related to the distance. You do not need any extra control algorithms or circuitry. The is a direct ROHS compliant replacement for the previous GP2D12.

We recommend the 3-Pin JST connector to go with this sensor to make hooking it up to your project a snap. The connector on these Sharp sensors is smaller than the normal 2.54mm header spacing expected.

Combining an IRED (infrared diode), an infrared detector and some control circuitry the GP2Y0A21YK0F is able to compensate for changes in reflectivity, ambient light and temperature.

Instead of measuring the intensity of the returned light like simple cheaper IR distance sensors, the Sharp GP2Y0A21YK0F uses triangulation determine the distance which is far less susceptible to outside influences.

Here is a chart of the output voltage as a function of distance

Despite the large difference between the reflectivity of the gray and white paper the sensor is still able to output reliable readings. Note though that the reading at very close distances is the same as very far distances. Don't drive your robot full speed into the wall!


  • Distance measuring range : 10 to 80 cm
  • Analog output type
  • Package size : 29.5×13×13.5 mm
  • Consumption current : Typ. 30 mA
  • Supply voltage : 4.5 to 5.5 V


Related Products