Skip to Content

IR Distance Sensor with Cables - Sharp Infrared Sensor Module GP2Y0A02YK0F

The Sharp Infrared Sensor Module GP2Y0A02YK0F is designed for accurate distance measurement and proximity detection. It integrates a position sensitive detector, an infrared emitting diode, and a signal processing circuit to measure distances from 20 to 150 cm. The sensor outputs a voltage signal corresponding to the detected distance, which can be read by microcontrollers or other electronics.

Package Includes

  • 1 x  IR Distance Sensor GP2Y0A02YK0F
  • 1  x Set of cables

103.95 AED 103.95 AED (Tax included)

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

This sensor uses a triangulation method that is largely unaffected by object reflectivity, environmental temperature, or operating duration. It is widely used in robotics, automation, and other applications requiring reliable distance measurement or object detection. The module comes with cables for easy integration into electronic projects.

Sharp IR Sensor

Features

  • Analog output type
  • Compliant with RoHS directive 2002/95/EC
  • Reliable and cost-effective solution for distance and proximity sensing

Specifications

  • Supply voltage 4.5 to 5.5 V
  • Current consumption 33 mA
  • Distance measuring range 20 to 150 cm
  • Package size 29.5 13 21.6 mm

Applications

  • Touch-less switch for sanitary equipment and public spaces
  • Energy-saving sensor for ATMs, copiers, vending machines, laptops, and monitors
  • Amusement equipment for arcade games and robots
  • Robotics for obstacle avoidance, distance measurement, and proximity sensing
  • Automation for object detection, positioning, and quality control
  • Security for detecting presence in restricted areas
  • Smart home technology for controlling lighting, heating, and appliances

Pin Connections

Pin Description
VCC Module power supply 5 V
GND Ground
OUT Analog voltage output corresponding to distance

Sharp IR Sensor Pinout

Applications

  • Smoothing noisy sensor readings.
  • Improving stability of analog measurements.
  • Filtering data from temperature, gas, and light sensors.
  • Embedded and IoT sensor monitoring projects.

Sample Project

Circuit Setup

  • Arduino UNO R3
  • GP2Y0A02YK0F Infrared Distance Sensor
  • Male to Female Jumper Wires

Sample Circuit

Library

Use the Average.h library to calculate averaged sensor readings.

To install the Average.h library in the Arduino IDE:

  1. Open Arduino IDE.
  2. Go to Sketch → Include Library → Manage Libraries.
  3. In the Library Manager search box, type Average.
  4. Find the library named Average and click Install.
  5. After installation, include the library in your sketch using #include <Average.h>.

 

Sample Code

#include "Average.h"
Average ave(10);
void setup() {
 Serial.begin(9600);
}
void loop() {
 ave.push(60.374*1.3 * pow(map(analogRead(A0), 0, 1023, 0, 5000) / 1000.0, -1.16));
 Serial.println(ave.mean());
 delay(100);
}

How It Works

  • Average ave(10); stores the last 10 sensor readings.
  • ave.push(value); adds a new sensor value to the dataset.
  • ave.mean(); calculates and returns the average of the stored readings.

References