How to use IR Sensor
What is an Ir sensor?
An infrared sensor is an electronic device that measures and detects infrared radiation in its surrounding environment. ... When an object comes close to the sensor, the infrared light from the LED reflects off of the object and is detected by the receiver.
How to Work an Ir sensor?Active infrared sensors both emit and detect infrared radiation. Active IR sensors have two parts: a light-emitting diode (LED) and a receiver. When an object comes close to the sensor, the infrared light from the LED reflects off of the object and is detected by the receiver.
REQUIRED MATERIALS,
Arduino UNO---- https://m.banggood.com/beelink/muvGs8
IR Sensor---- https://m.banggood.com/beelink/vzbbQZ
Jumper wires---- https://m.banggood.com/beelink/muvGsx
Breadboard---- https://m.banggood.com/beelink/ruzGst
void setup() { // put your setup code here, to run once: pinMode(2,INPUT); pinMode(12,OUTPUT);//LED } void loop() { // put your main code here, to run repeatedly: if(digitalRead(2)==LOW){ digitalWrite(12,HIGH); } else{ digitalWrite(12,LOW); } }
Ir sensor Video tutorial
0 Comments