Instructions

Connection
Module OUT VCC GND
Arduin 2 5V GND
Code
const int PIRSensor = 2;
const int ledPin = 13;
int sensorValue = 0;
void setup() {
pinMode(PIRSensor, INPUT);
pinMode(ledPin, OUTPUT);
}
void loop(){
sensorValue = digitalRead(PIRSensor);
if (sensorValue == HIGH) {
digitalWrite(ledPin, HIGH);
}
else {
digitalWrite(ledPin, LOW);
}
}
Procedure
1. Prepare a sketch with the given code and upload it to your
board.
2. Connect the module/component to the board as shown in
the connection diagram or table.
3. Connect an LED to pin 13.
4. When motion is detected the LED goes on.
2