Cheap PIR motion sensor from Ebay wiring question

Hi,

The sensor will make a vieuw of the room in the first seconds it's powered up.
When there is a detection, it will set it's output pin to LOW.

So a pull up resistor is required.

A simple code like this would give you an alarm over serial

int pirPin = 2; //digital 2

void setup(){
 Serial.begin(9600);
 pinMode(pirPin, INPUT);
}

void loop(){
  int pirVal = digitalRead(pirPin);

  if(pirVal == LOW){ //was motion detected
    Serial.println("Motion Detected");
    delay(2000);
  }

The code is from a bildr.org tutorial on a simular sensor
http://bildr.org/2011/06/pir_arduino/