Infrared Distance Measuring Proximity Sensor 10 - 80cm - SHARP GP2Y0A21YK0F

  • Was  RM40.00 
  • RM32.00

  • Product Code: GP2Y0A21YK0F
  • Availability: In Stock

The Sharp distance sensor's are a popular choice for many projects that require accurate distance measurements. This IR sensor is more economical than sonar range-finders, yet it provides much better performance than other IR alternatives. Interfacing to most microcontrollers is straightforward: the single analog output can be connected to an analog-to-digital converter for taking distance measurements, or the output can be connected to a comparator for threshold detection. The detection range of this version is approximately 10 cm to 80 cm (4" to 32").

 

Features:

  • Infrared rangefinder: 10cm - 80cm (4" - 30")
  • Analog Interface
  • External control circuit is unnecessary
  • Japanese Solderless Terminal (JST) Connector

Specifications:

  • Distance measuring range: 10 to 80 cm (4" to 32")
  • Maximum measurement angle: >40°
  • Operating voltage: 4.5 V to 5.5 V DC
  • Average power consumption : 35mA
  • Peak power consumption : about 200mA
  • Frequency of updates/cycle : 25 Hz / 40ms
  • Response time: 38 ± 10 ms
  • Output type: Analog voltage (3.1V at 10cm to 0.4V at 80cm)
  • Output voltage differential over distance range: 1.9 V (typical)
  • Analog output noise : < 200 mV
  • Weight: 3.5 g
 
 
Document:
http://www.sharpsma.com/webfm_send/1489
 

Connect Sharp Infrared Distance Measurement to Arduino

Arduino sketch:
//connect gp2d120x to A0

#define pin A0

void setup(){
        Serial.begin (9600);
        pinMode(pin, INPUT);
}

void loop(){
        uint16_t value = analogRead (pin);
        double distance = get_IR (value);  //Convert the analog voltage to the distance
        Serial.println (value);  //Print the data to the arduino serial monitor
        Serial.print (distance);
        Serial.println (" cm");
        Serial.println ();
        delay (500);   //Delay 0.5s
}

//return distance (cm)
double get_IR(uint16_t value){
        if (value < 16)  value = 16;
        return 4800.0 / (value - 1120.0);
}

View the result in serial monitor.

Write a review

Note: HTML is not translated!
    Bad           Good

 

Related Products

Tags: IR Infrared, Distance Measuring