Go Down

Topic: Received random High output PIR hc-sr501 (Read 36 times) previous topic - next topic


Aug 26, 2015, 07:14 pm Last Edit: Aug 26, 2015, 07:18 pm by BlueEnergy
Hi Everybody,

A few days i received a pir, ordered on eBay. It is the:  hc-sr501. So i found the library and some resources for it. I decided to pair the Pir with my ESP-01 (WiFi Module) so i can see when someone is at home.

But the problem is, sometimes the Pir is automatically high and i received on my phone that someone is at home, but there is nobody.

So i checked some sites on google, and found that a pir can go on when there is an animal, but there are no animals in my house..

Maybe some people have some experience with this Pir.

The code what i use:

Code: [Select]
int pirPin = 8;
int val;

void setup() {

void loop() {
  val = digitalRead(pirPin); //read state of the PIR
  if (val == LOW) {
    Serial.println("No motion"); //if the value read is low, there was no motion
  else {
    Serial.println("Motion!"); //if the value read was high, there was motion

And here is the datasheet. I read it but i found nothing that can help me.



Go Up