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.
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 |
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
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
}
}