E18-D80NK Infrared Distance Ranging Sensor เซ็นเซอร์ตรวจจับวัตถุ
Rating: 5, Sold: 1
E18-D80NK Infrared Distance Ranging Sensor เซ็นเซอร์ตรวจจับวัตถุ
ข้อมูลสินค้า
Brand: NoBrand
Category: Home & Living > Safety & Security > Others
Seller Name: genlogic
Shop Name: genlogic
E18-D80NK Infrared Reflectance Sensor Switch for Arduino
E18-D80NK Infrared Reflectance Sensor Photoelectric Sensor เป็น เซ็นเซอร์สวิตช์ อินฟราเรด มีระยะการทำงานที่ 3 - 80 ซม. สามารถปรับระยะทางได้จากตัวต้านทานปรับค่าได้ ใช้ไฟ 5 โวลต์ ทำงานแบบแสงอินฟราเรดจึงไม่ถูกรบกวนได้ง่าย สะดวกในการนำไปประกอบวงจร สามารถนำไปประยุกต์ใช้กับงานหุ่นยนต์หลบสิ่งกีดขวาง และงาน automation อื่นๆ เมื่อมีวัตถุผ่านเซนเซอร์จะให้ค่าออกมาเป็น 1 และเมื่อไม่มีวัตถุมาบังส่งค่าออกเป็น 0
E18-D80NK Infrared Reflectance Sensor for Arduino
- Working voltage range: 5 VDC
- Working current: 10-15mA
- Drive current: 100mA
- Detection Distance: 3-80 cm
- Size: 17x45 mm.
- Wire connection: - (Red= VCC 5V), (Green= GND), (Yellow = Output) หรือ
- (ฺBrown = VCC 5V), (Blue= GND), (Black = Output)

- Should connect 10Kohm pull-up resistor with 5V at the output pin.

การต่อวงจร หมุนทวนเข็มไฟดับ
Arduino sensor
5V VCC (น้ำตาล)
GND GND (น้ำเงิน)
pin 2 A0 (ดำ)



โค้ดตัวอย่างการใช้งาน
int ledPin = 13; //LED anode connected to digital pin 13
int inputPin = 2; //infrared proximity switch connected to digital pin 2
int val = 0; //this variable will read the value from the sensor
void setup()
{
Serial.begin(9600);
pinMode(ledPin, OUTPUT); //declare LED as output
pinMode(inputPin, INPUT); //declare infrared sensor as input
}
void loop()
{
val = digitalRead(inputPin); // read input value
if (val == HIGH) //check if the input is HIGH
{
digitalWrite(ledPin, LOW); //LED is off
Serial.println(val);
}
else
{
digitalWrite(ledPin, HIGH); //LED is turned on
Serial.println(val);
}
delay(50);
}

E18-D80NK Infrared Distance Ranging Sensor เซ็นเซอร์ตรวจจับวัตถุ