Arduino – PIR Sensor (HC-SR501)

PIR Sensors (Passive Infrared) are the standard sensors used for motion detection. They offer a wide field of view and are easy to configure, but offer only HIGH/LOW output and are not overly accurate.

Functional Parts in the Project:

#define pirSensor 8

int reading;

void setup() {

  pinMode(pirSensor, INPUT);



void loop() {

  reading = digitalRead(pirSensor);

  if (reading == HIGH) {
  } else {


Be the first to comment

Leave a Reply