Skip to Content

IR Distance Sensor GP2Y0A21YK0F With Cables

The IR GP2Y0A21YK0F distance sensor is a high-performance infrared sensor for measuring distances from 10 cm to 80 cm. It offers better accuracy than standard IR sensors and is more cost-effective than sonar-based alternatives. The sensor features a single analog output, easily interfaced with microcontroller ADCs or comparators. Its compact size allows for seamless integration into various systems. The package includes connection cables for simple wiring.

Package Includes:

  • 1 × IR Distance Sensor GP2Y0A21YK0F with Cables

68.25 AED 68.25 AED Tax Included
68.25 AED Tax Included

Not Available For Sale

This combination does not exist.

Terms and Conditions
30-day money-back guarantee
Shipping: 2-3 Business Days

 

 

How Does an IR Distance Sensor Work?

IR distance sensors use a beam of infrared light that reflects off objects to determine distance via triangulation. The GP2Y0A21YK0F includes an IR LED and a Position Sensing Device (PSD). Reflected light creates an optical spot on the PSD, and its position changes based on object distance. A built-in signal processor calculates distance and provides an analog voltage output.

IR Sensor Working IR Sensor Triangulation

Features:

  • Infrared technology for accurate distance measurement
  • Affordable alternative to sonar rangefinders
  • 10 cm to 80 cm detection range
  • Single analog output for easy microcontroller interface
  • Compatible with comparators for binary detection

Specifications:

  • Operating voltage: 4.5 V to 5.5 V
  • Average current consumption: 30 mA (typ.)
  • Measuring range: 10 cm to 80 cm
  • Output: Analog voltage
  • Output voltage variation: 1.9 V (typ.)
  • Response time: 38 ± 10 ms
  • Size: 29.5 × 13.0 × 13.5 mm
  • Weight: 3.5 g

Applications:

  • Robotics: Obstacle detection, navigation
  • Automation: Proximity and material handling
  • Security: Object detection and monitoring
  • Home automation: Touchless switches, faucets
  • Gaming: Motion and gesture control
  • Medical devices: Non-contact measurements
  • Agriculture: Growth monitoring, soil moisture
  • Drones: Altitude control, obstacle avoidance
  • Education: Teaching distance sensing concepts

Pin Connections:

  • Yellow: A0 (Analog Output)
  • Black: GND
  • Red: 5V

Pin Connections

 

Sample Project:

Connecting with Arduino

Wiring to Arduino

Arduino Code Example:

#include "Average.h"

Average ave(10);

void setup() {
  Serial.begin(9600);
}

void loop() {
  ave.push(27.728 * 1.3 * pow(map(analogRead(A0), 0, 1023, 0, 5000) / 1000.0, -1.2045));
  Serial.println(ave.mean());
  delay(100);
}

Open the Serial Plotter to visualize the sensor's output over time.

Notes:

  • Keep the lens clean from dust, oil, and water to ensure proper function.
  • Do not wash the sensor as it can affect the optical system.

References: