How PIR Sensor Works and How To Use It with Arduino

Опубликовано: 16 Июль 2026
на канале: CL Inventor Tech
42
6

A PIR sensor is an electronic sensor used in motion detectors such as automatically triggered lighting devices and protection systems that measure devices emitting infrared light in their field of view. Each body with a temperature above zero releases heat energy, which is in the form of radiation.
----------------------------------------------
Code :-
/*CL Inventor Tech
*   / @clinventortech  
*/

void setup() {
pinMode(8,INPUT);
pinMode(13,OUTPUT);
}

void loop() {

int val = digitalRead(8);

if(val ==1){
digitalWrite(13,HIGH);

}
else{
digitalWrite(13,LOW);
}
}