English Vietnamese
Hotline : 0901.122.122
Chi tiết sản phẩm
Tên: SHARP 2Y0A21 10-80cm Infrared distance sensor (GP2Y0A21YK0F) (Cập nhật: 24/03/2015)
Khối lượng
10 (gam)
Thể tích
20 (cm3)
Giá
Số lượng Đơn giá
1 230.000 VND
5 220.000 VND
Còn lại
10+
Lượt xem
4.481
Tài liệu
Thông tin sản phẩm:
Ẩn nội dung 
 Description :
 
This popular IR based sensor from SHARP electronics is capable of producing analog signals in accordance with distance from the target object. The output value varies from 3.1V at 10cm to 0.3V at 80cm .Can be directly interfaced with SPDuino using the analog ports.
 
Features:
Distance measuring range: 10 to 80 cm
Analog output type
 
Specifications:
Supply voltage: 4.5 to 5.5 V
Consumption current: Typ. 30 mA

10-to-80cm-1.JPG
10-to-80cm-2.JPG
10-to-80cm-(1).JPG

Test Code

 

void setup()

{

  Serial.begin(9600);

}

 

void loop() 

{

  float X;

  float V = analogRead(A0) * 5.0/1023.0;

  

  if( V  < 0.75 ) {

      X = ( 27.0/(V - 0.08) ) - 1.8;

  } else {

      X = ( 34.0/(V + 0.08) );

  }

    Serial.println(X);

 

  delay(500);

}