Saturday, 9 January 2021

Intruder Detection System Using PIR and ISD1820

Circuit:-


 


Code:- 

int pir = 8;
int speaker = 9;
void setup()
{
  
pinMode(pir,INPUT);
pinMode(speaker,OUTPUT);
}

void loop()
{
  if(digitalRead(pir)==1)
  {
    digitalWrite(9,HIGH);
  }
  else
  {
     digitalWrite(9,LOW);
  }
}