PIR Sensor is always HIGH

hi guys .The problem is that the sensor always detects motion and the led lights up. what could be the problem?
Program:
int blue = 13; // choose the pin for the LED
int inputPin = 2; // choose the input pin (for PIR sensor)
int pirState = LOW; // we start, assuming no motion detected
int val = 0; // variable for reading the pin status
int x = HIGH;
int pirReading;
//int pulseSpeed = 100 ;

void setup() {
pinMode(blue, OUTPUT); // declare LED as output
pinMode(inputPin, INPUT); // declare sensor as input
Serial.begin(9600);
}

void loop(){

val = digitalRead(inputPin);
// read input value

if (val == HIGH) {
if (x == HIGH) { // check if the input is HIGH
digitalWrite(blue, HIGH);

Serial.println("Motion 2");
}
else{
digitalWrite(blue, LOW);

Serial.println("Motion 1");
}
if (pirState == LOW) {
// we have just turned on
Serial.println("Motion detected!");
// We only want to print on the output change, not state
pirState = HIGH;
}

}

else {

if (pirState == HIGH){
if (x==HIGH){
x=LOW;
}
else {
x=HIGH;
}
// we have just turned of
Serial.println("Motion ended!");
// We only want to print on the output change, not state
pirState = LOW;

}
//delay(pulseSpeed);
}
}
i tried another program but it didn't work either:
const int PIRinput = 2; //PIR connected here
const int led = 13; //Led connected here
int motion = 0;
void setup() {
pinMode(led,HIGH); //led as output
pinMode(PIRinput,LOW); //PIR as input
}

void loop() {
//reading the PIR status and stores to variable motion
motion = digitalRead(PIRinput);
if (motion == HIGH) {
digitalWrite(led, HIGH);
}
else {
digitalWrite(led, LOW);
}
}

You should read this: PIR Motion Sensor | LEARN.PARALLAX.COM it is from parallax and shows the sensor, how to hook it up and code for it. You are missing a resistor I believe, they show one on the output, however I do not know why. Remember these things take there time and respond very slowly.

The two trim pots are usually set in the middle when you buy a PIR sensor.

You must first turn the 'time' pot fully anticlockwise.

If you don't, then the internal timer of the PIR keeps it's output HIGH for about 3 minutes.
And that is repeated the moment the PIR senses a new movement.

If you leave the pot fully anticlockwise, then this time is reduced to about 3 seconds.
Then you can use the Arduino to program the timing you want.

Leave the 'sensitivity' pot in the middle.
Leo..