int PIR = 27;
void setup() {
pinMode(PIR,INPUT_PULLUP);
Serial.begin(115200);
}
void loop() {
int a=digitalRead(PIR);
if (a==1)
{
Serial.println("Motion detected");
}
else
{
Serial.println("Not detected");
}
delay(4000);
}