Sunday, June 28, 2020

PIR Sensor Interfacing with Arduino Uno By Engr.Habib Ur Rehman



 
PIR Sensor Interfacing
with Arduino Uno
By Engr.Habib Ur Rehman

Components/Equipment Required:
            Following Components/Equipment are required to perform task.
3.    Buzzer/LED Light 
4.    Breadboard
Circuit Diagram:

Arduino Program:
int PIR = 8;
int LED = 13;
void setup() {
  pinMode(PIR, INPUT);
  pinMode(LED, OUTPUT); 
}
void loop() {
  int PIRValue = digitalRead(PIR);
  if (PIRValue == 1) {
    digitalWrite(LED, HIGH); // The Relay Input works Inversly
    delay(100);
     digitalWrite(LED, LOW); // The Relay Input works Inversly
  }
  if (PIRValue == 0) {
     digitalWrite(LED, LOW); // The Relay Input works Inversly
  }}