Infrared distance sensor (GP2Y0A21YK0F) [S036]
https://www.youtube.com/watch?v=GhNwmtpVTY4
*GitHub : https://github.com/rdiot/rdiot-s036.git
* Specs
operating voltage: 4.5 V to 5.5 V
average current consumption: 30 mA (typical)
distance measuring range: 10 cm to 80 cm (4" to 32")
output type: analog voltage
output voltage differential over distance range: 1.9 V (typical)
response time: 38 ± 10 ms
package size: 29.5×13.0×13.5 mm (1.16×0.5×0.53")
weight: 3.5 g (0.12 oz)
* Contents
- DataSheet : http://www.sparkfun.com/datasheets/Components/GP2Y0A21YK.pdf
- Connect
Yellow ----- A0
Black ----- GND
Red ----- 5V
- Key Code
int pin = A0;
int I = analogRead(pin);
int value = (6762 /(I-9)) -(4);
lcd.print("distance=" + (String)value + "CM ");
'2) Sensor > Distance' 카테고리의 다른 글
Ultrasonic Ranging Module (HC-SR04) [S011] (0) | 2016.09.08 |
---|