This is my first time to use PIR (HC-SR501 ) . It's in repeat trigger model. But when I test the output of the PIR , it gives always HIGH .
I rotate sensitivity adjustment and time delay adjustment randomly to see any changes occur. I even cover the sensor with cloth so that It get's no infrared . still it gives high. I changed my sensor and bought a new one. This shows the same problem too. arduino code :
int PIC_IN = 10;
int LED = 13;
void setup()
{
Serial.begin(9600);
pinMode(PIC_IN, INPUT);
digitalWrite(LED, LOW);
}
void loop()
{
int val = digitalRead(PIC_IN);
if (val == HIGH)
{
Serial.println("Moton detected");
digitalWrite(LED, HIGH);
}
else
{
Serial.println("...........");
digitalWrite(LED, LOW);
}
}
here is the link for PIR Datasheet.
What I am doing wrong ? I have no clue why it's not working.