PIR sensor and Send IR code probelm

Hi:

Could anyone help me, please?

I want to use the PIR sensor and IR led to control the projector,but i have some problem.

I hope it can send the IR code when the PIR sensor value is changed.

Actually,it always sends the IR code.

Could anyone help me to solve this issue,thanks!

My code as below:

#include <IRremote.h>
int PIRSensor = 2;
int sensorValue = 0;
IRsend irsend;
void setup() {
Serial.begin(9600);
}
void loop() {
sensorValue = analogRead(PIRSensor);
delay(3000);
Serial.println(sensorValue);
if(sensorValue == 0){
irsend.sendNEC(0xCE01F, 32);
}
else{
irsend.sendNEC(0xCC03F, 32);
}
}