The code below demonstrate a simple instance. When someone moves before the sensor, the led on the arduino board light and "1" is printed on the serial monitor. const int ledPin=13;//The led to indicate the motion void setup(){ Serial.begin(9600); pinMode(2, INPUT);//Use pin 2 to receive the signal outputted by the module pinMode(ledPin, OUTPUT); } void loop() { int sensorValue = digitalRead(2); if(sensorValue==1) digitalWrite(ledPin,HIGH); else digitalWrite(ledPin,LOW); Serial.println(sensorValue, DEC);//Print the state of the signal through the serial monitor. }