Skip to product information
1 of 6

Blue PCB Electronics

2B18 Distance Measuring Sensor Infrared Proximity Sensor - Sharp GP2Y0A02YK0F

2B18 Distance Measuring Sensor Infrared Proximity Sensor - Sharp GP2Y0A02YK0F

Regular price Dhs. 55.00
Regular price Dhs. 60.00 Sale price Dhs. 55.00
Sale Sold out
View full details

Description

GP2Y0A02YK0F 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.
Datasheet

Features:

  • Distance measuring range : 20 to 150 cm
  • Analog output type
  • Package size : 29.5×13×21.6 mm
  • Consumption current : Typ. 33 mA
  • Supply voltage : 4.5 to 5.5 V

Specification:

  • Supply voltage: 4.5 to 5.5 V
  • Consumption current: 33 mA
  • Distance measuring range: 20 to 150 cm
  • Package size: 29.5 × 13 × 21.6 mm

Applications:

  • Touch-less switch (Sanitary equipment, Control of illumination, etc. )
  • Sensor for energy saving (ATM, Copier, Vending machine, Laptop computer, LCD monitor)
  • Amusement equipment (Robot, Arcade game machine)

 

Pin Connections:

Pin Description
VCC Module power supply – 5V
GND Ground
OUT The output of the module which is analog voltage

Screen Shot 2023-02-28 at 9 29 29 AM

Package Includes:

  • 1 x IR Distance Sensor
  • 1 x Cables

Sample Project:

Circuit:

  • Required Material:
    • Arduino UNO R3 × 1
    • GP2Y0A02YK0F Infrared Distance Sensor × 1
    • Male to Female Jumper Wire × 1

Screen Shot 2023-02-28 at 9 26 33 AM

Code:

#define sensor A0 // Sharp IR GP2Y0A41SK0F (4-30cm, analog)

void setup() {
  Serial.begin(9600); // start the serial port
}

void loop() {
  
  // 5v
  float volts = analogRead(sensor)*0.0048828125;  // value from sensor * (5/1024)
  int distance = 13*pow(volts, -1); // worked out from datasheet graph
  delay(1000); // slow down serial port 
  
  if (distance <= 30){
    Serial.println(distance);   // print the distance
  }
}