// Arduino Interfacing with PIR Sensor
const int pirSensor=10;
const int ledPin=13;
int sensorValue = 0;
void setup()
{
pinMode(ledPin, OUTPUT);
pinMode(pirSensor,INPUT);
}
void loop()
{
sensorValue= digitalRead(pirSensor);
if(sensorValue==HIGH) //Check the sensor output
{
digitalWrite(ledPin, HIGH); // set the LED on
}
else
{
digitalWrite(ledPin, LOW); // set the LED off
}
delay(1000); // wait for a second
}