HC-SR501 PIR issue's

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
the cosmic gate
Normal user
Posts: 102
Joined: 14 Nov 2015, 20:17

HC-SR501 PIR issue's

#1 Post by the cosmic gate » 07 Jun 2016, 10:12

Anybody who can help me :
Used a hc-sr501 (PIR) on a ESP (sonoff) :
Image

, But this sensors detects movement, while i know for sure there's no movement
Image

As you find out, its every x seconds .
Anybody who can help me

cherowley
Normal user
Posts: 125
Joined: 14 Jan 2016, 09:39

Re: HC-SR501 PIR issue's

#2 Post by cherowley » 07 Jun 2016, 13:35

Yep same issues I had/have.

I wrapped the pir wires in foil then grounded the foil and that worked pretty much so then I tried using coax to connect the pir and that also worked.

the cosmic gate
Normal user
Posts: 102
Joined: 14 Nov 2015, 20:17

Re: HC-SR501 PIR issue's

#3 Post by the cosmic gate » 07 Jun 2016, 14:12

cherowley wrote:Yep same issues I had/have.

I wrapped the pir wires in foil then grounded the foil and that worked pretty much so then I tried using coax to connect the pir and that also worked.
Could you send me some pictures ? You only wrapped the PCB i think :) ?
And did you use COAX as connector cable instead of the standard cable ( dev board)

the cosmic gate
Normal user
Posts: 102
Joined: 14 Nov 2015, 20:17

Re: HC-SR501 PIR issue's

#4 Post by the cosmic gate » 07 Jun 2016, 22:38

cherowley wrote:Yep same issues I had/have.

I wrapped the pir wires in foil then grounded the foil and that worked pretty much so then I tried using coax to connect the pir and that also worked.
I just changed the singal cable to a piece of coax, but still it detects motion while there absolutely no motion.
Image
Did you also ground this coax cable to the earth?

the cosmic gate
Normal user
Posts: 102
Joined: 14 Nov 2015, 20:17

Re: HC-SR501 PIR issue's

#5 Post by the cosmic gate » 08 Jun 2016, 22:26

Even more strange : when I completely disconnect this PIR thereally still some detected motion .......
Looks like interference or something

hvdwolf
Normal user
Posts: 51
Joined: 09 Jun 2016, 12:37

Re: HC-SR501 PIR issue's

#6 Post by hvdwolf » 09 Jun 2016, 12:40

Same for me.
I'm running ESPEasy 107.
In my case the PIR sensor is almost constantly on "ON".
I used to run it on a arduino pro mini but decided to put it on an espeasy (nodemcu 1.0)
If I simply put it back on the pro mini it functions flawless. When I reconnect it to the espeasy it goes haywire.
On the pro mini it requires no extra actions, so I did not try coax cable or whatever on the espeasy.
The espeasy also runs 2 ds18b20 for my freezer/cooler combi.

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: HC-SR501 PIR issue's

#7 Post by manjh » 09 Jun 2016, 16:24

Did you try to experiment with the pullup tickbox?

the cosmic gate
Normal user
Posts: 102
Joined: 14 Nov 2015, 20:17

Re: HC-SR501 PIR issue's

#8 Post by the cosmic gate » 09 Jun 2016, 21:43

manjh wrote:Did you try to experiment with the pullup tickbox?
Yep i did:
Image

the cosmic gate
Normal user
Posts: 102
Joined: 14 Nov 2015, 20:17

Re: HC-SR501 PIR issue's

#9 Post by the cosmic gate » 10 Jun 2016, 20:30

Anybody with a working solution ?

the cosmic gate
Normal user
Posts: 102
Joined: 14 Nov 2015, 20:17

Re: HC-SR501 PIR issue's

#10 Post by the cosmic gate » 14 Jun 2016, 22:03

the cosmic gate wrote:Anybody with a working solution ?
Nobody a working solution? Pull down resistor? One other solutions please?
(Getting sick of the lamp which switches on etc when not needed)

kr0815
Normal user
Posts: 136
Joined: 18 Nov 2015, 18:24

Re: HC-SR501 PIR issue's

#11 Post by kr0815 » 15 Jun 2016, 00:01

I had the same problems in a test set-up - as long as the PIR sits behind / next to the ESP, a lot of false alarms

This has nothing to do with Software / Pull-Ups,..., but it´s because of the cheap design of the PIR
You could either try to, as suggested, put some shielding metal (grounded) between ESP and PIR, or find another set-up where the ESP is a few centimeters away from the PIR

hvdwolf
Normal user
Posts: 51
Joined: 09 Jun 2016, 12:37

Re: HC-SR501 PIR issue's

#12 Post by hvdwolf » 17 Jun 2016, 20:21

(Was a week on holiday)
Please read this article. It describes how to use the PIR sensor on 3.3V without soldering. I already did that on my arduino pro mini but used the 5V on my nodemcu (well, actually: I tried to use 5V but that didn't work).
I now connected the PIR data wire to GPIO14 (~D5) and the power (via PIR sensor 3.3V connection) to 3.3V and GND to GND (of course). It works flawless. I also tried with GPIO0 (~D3) and that works just as well.
No shielding, no special cables. First with 3 short dupont wires, now with unshielded 1½ meter wires.

Config:
Image

kr0815
Normal user
Posts: 136
Joined: 18 Nov 2015, 18:24

Re: HC-SR501 PIR issue's

#13 Post by kr0815 » 18 Jun 2016, 09:39

now with unshielded 1½ meter wires.
That`s why it works, the cable doesn´t have to be shielded, but you need a certain distance between ESP and PIR
Most critical, in my experience, is if the PIR sits in front of the ESP

hvdwolf
Normal user
Posts: 51
Joined: 09 Jun 2016, 12:37

Re: HC-SR501 PIR issue's

#14 Post by hvdwolf » 18 Jun 2016, 09:46

kr0815 wrote:
now with unshielded 1½ meter wires.
That`s why it works, the cable doesn´t have to be shielded, but you need a certain distance between ESP and PIR
Most critical, in my experience, is if the PIR sits in front of the ESP
No, that's why I mentioned:
hvdwolf wrote:I now connected the PIR data wire to GPIO14 (~D5) and the power (via PIR sensor 3.3V connection) to 3.3V and GND to GND (of course). It works flawless. I also tried with GPIO0 (~D3) and that works just as well.
No shielding, no special cables. First with 3 short dupont wires, now with unshielded 1½ meter wires.
It doesn't make any difference for me: short (10 cm) or long wires.

Edit: Now I understand the confusion. I should have typed: "both with 3 short dupont wires as well as with unshielded 1½ meter wires."

the cosmic gate
Normal user
Posts: 102
Joined: 14 Nov 2015, 20:17

Re: HC-SR501 PIR issue's

#15 Post by the cosmic gate » 01 Jul 2016, 23:45

are there people with the same problem and even beter a solution for this problem

the cosmic gate
Normal user
Posts: 102
Joined: 14 Nov 2015, 20:17

Re: HC-SR501 PIR issue's

#16 Post by the cosmic gate » 10 Jul 2016, 10:39

Just did one other mod on the pir side, soldered on the pin Instead of the voltage divider.
But there's still the same issue every 3 seconds on/off.
Also replacedo the pir, but nothing :(
More/ other solutions?

kr0815
Normal user
Posts: 136
Joined: 18 Nov 2015, 18:24

Re: HC-SR501 PIR issue's

#17 Post by kr0815 » 10 Jul 2016, 12:29

As i said earlier, you need distance between PIR and ESP - Did you try that ?

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: HC-SR501 PIR issue's

#18 Post by manjh » 19 Jul 2016, 11:56

I had a similar problem with different hardware.
Used a standalone PIR sensor, that gives it's signal thru 433MHz. It was located about 1 meter from the RFLink unit: the PIR was triggered far too often, also when there was nobody at home to trigger it.
It might have been the LED on the RFLink that triggered it, or maybe some other kind of interference.
Fact was that when I moved the PIR sensor to another location, it worked just fine...

rtenklooster
Normal user
Posts: 320
Joined: 15 Apr 2015, 14:17

Re: HC-SR501 PIR issue's

#19 Post by rtenklooster » 21 Jul 2016, 00:31

Okay,
I ordered a few days ago this item:
http://www.aliexpress.com/item/5-8GHZ-M ... 85648.html
I attached it to a test esp module, i must say, it works great.
Have it running for two days now, no false positives, it's mounted inside a closet.

After a little ajustments it covers my whole living room, it's sensitive enough to notice people when watching tv on the couch.
At first, it also noticed when a walked outside, trough the glass ;) after a little adjusting it works fine.

I realy like the fact that it's sensitive, it can be mounted inside a closet, totaly invisible but still very responsive :)
No more pir's for me.. looking trough walls / windows, how nice is that :D
Richard - Groningen (NL) - Image

the cosmic gate
Normal user
Posts: 102
Joined: 14 Nov 2015, 20:17

Re: HC-SR501 PIR issue's

#20 Post by the cosmic gate » 22 Jul 2016, 12:25

rtenklooster wrote:Okay,
I ordered a few days ago this item:
http://www.aliexpress.com/item/5-8GHZ-M ... 85648.html
I attached it to a test esp module, i must say, it works great.
Have it running for two days now, no false positives, it's mounted inside a closet.

After a little ajustments it covers my whole living room, it's sensitive enough to notice people when watching tv on the couch.
At first, it also noticed when a walked outside, trough the glass ;) after a little adjusting it works fine.

I realy like the fact that it's sensitive, it can be mounted inside a closet, totaly invisible but still very responsive :)
No more pir's for me.. looking trough walls / windows, how nice is that :D
Can you share the adjustments you made ?
I want to have a "pir" alike solution for just the hall / Lobby, when somebody entered it ( to go outside - exit the house / or enter the hall on the first floor)

rtenklooster
Normal user
Posts: 320
Joined: 15 Apr 2015, 14:17

Re: HC-SR501 PIR issue's

#21 Post by rtenklooster » 22 Jul 2016, 13:01

I replaced the sensitivity resistor with a 47K
The time resistor with 4.7K.

Need to finetune a little bit because i just noticed, when my wife goes to the toilet at night, i got a (false) positive from the sensor one floor lower in the living room.
Richard - Groningen (NL) - Image

NietGiftig
Normal user
Posts: 103
Joined: 16 Sep 2015, 20:32

Re: HC-SR501 PIR issue's

#22 Post by NietGiftig » 22 Jul 2016, 17:52

rtenklooster wrote:I when my wife goes to the toilet at night, i got a (false) positive from the sensor one floor lower in the living room.
Just be glad it only tranfers movement, not smell

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: HC-SR501 PIR issue's

#23 Post by costo » 25 Jul 2016, 17:51

@ NietGiftig
I believe you are mistaken a radarsensor for this type of sensor:

http://www.aliexpress.com/item/DC-5V-MQ ... dc9826dc88

tozett
Normal user
Posts: 734
Joined: 22 Dec 2015, 15:46
Location: Germany

Re: HC-SR501 PIR issue's

#24 Post by tozett » 25 Jul 2016, 21:22

i ordered six of these from rtenkloosters post:
http://www.aliexpress.com/item/5-8GHZ-M ... 85648.html
and will try them out...

rtenklooster
Normal user
Posts: 320
Joined: 15 Apr 2015, 14:17

Re: HC-SR501 PIR issue's

#25 Post by rtenklooster » 27 Jul 2016, 22:15

tozett wrote:i ordered six of these from rtenkloosters post:
http://www.aliexpress.com/item/5-8GHZ-M ... 85648.html
and will try them out...
Nice :) The sensor in my living room is very stable and has no false positives. It's mounted behind the sofa, so its:
outside | wall | central heating radiator | RADAR | Sofa

The central heating radiator act's as a shield, so no false positives when someone walks outside.
Image

The sensor on the upper floor however, is giving some false positives.
I'm thinking about some minor tweaking te resolve the false positive's when there's movement detected downstairs.
My plan is to set the delay to the 1 second minimum, and use rules + timers to filter the output.
The idea: only send data to domoticz when x number of triggers appeared in x seconds.

Maybe my device is faulty, i ordered a few new ones. However if the new one is a little to sensitive i might give this idea a try.
In order for this to work, i need global variables, for as far as i know those are not present in the rules section.
I have seen this as a feature request somewhere, this might be a good idea.

So the rule i have in mind wil look something like this (just for the idea):

Code: Select all

On Rules#Timer=1 do  
  Globl#Motion 0
endon

On Radar#Switch=1 do
timerSet,1,30
Global#Motion++
  if [Global#Motion]>2
    // Send to domoticz
  endif
endon
In order to accomplish this we need the option to do some basic calc in rules, we have to manually send data to domoticz and we need to set / get (global) variables. Quite a wish list for Martinus i guess ;)
Richard - Groningen (NL) - Image

edautz
Normal user
Posts: 13
Joined: 10 Apr 2016, 07:16

Re: HC-SR501 PIR issue's

#26 Post by edautz » 30 Jul 2016, 08:30

I managed to stabilize my pir setup.

http://www.esp8266.nu/forum/viewtopic.php?f=5&t=671

Dylantje
Normal user
Posts: 255
Joined: 11 Oct 2015, 16:51

Re: HC-SR501 PIR issue's

#27 Post by Dylantje » 10 Aug 2016, 13:07

Is the radar 5.8Ghz the best option?

tozett
Normal user
Posts: 734
Joined: 22 Dec 2015, 15:46
Location: Germany

Re: HC-SR501 PIR issue's

#28 Post by tozett » 16 Dec 2016, 21:46

rtenklooster wrote:I replaced the sensitivity resistor with a 47K
The time resistor with 4.7K.
Need to finetune a little bit because i just noticed, when my wife goes to the toilet at night, i got a (false) positive from the sensor one floor lower in the living room.
Would be glad about FEEDBACK....

because i finally managed to try one of my 6 month old "new" RADAR sensors.
i used some info from CNX and Scargill

i assumed they would trigger all the time, if i sit directly in front of them.
instead it seems to me, they are not "that" sensitive at all.
i made a rule to switch a led, if the RADAR switch goes to 1, but it does this only sometimes. i feel.

do i have any mistake in my config, or is this "slow" as a real PIR...?
i would be glad, if anybody could share some experience with the RADAR module...
Attachments
radar.png
radar.png (174.04 KiB) Viewed 27222 times
radar2.png
radar2.png (29.36 KiB) Viewed 27222 times
radar3.png
radar3.png (10.09 KiB) Viewed 27222 times

tozett
Normal user
Posts: 734
Joined: 22 Dec 2015, 15:46
Location: Germany

Re: HC-SR501 PIR issue's

#29 Post by tozett » 16 Dec 2016, 21:51

i left all default resistors in place,
means probably 20k for sensitivty (10-100k, higher resistance is less sensitivity, like a comment wrote)
and also default for time (30s) (as i checked later, on my pcb there is _no_ resistor ~ 30sec ??)
Attachments
Microwave_Radar_Module.jpg
Microwave_Radar_Module.jpg (62.35 KiB) Viewed 27221 times
Last edited by tozett on 17 Dec 2016, 11:19, edited 2 times in total.

tozett
Normal user
Posts: 734
Joined: 22 Dec 2015, 15:46
Location: Germany

Re: HC-SR501 PIR issue's

#30 Post by tozett » 17 Dec 2016, 11:17

new info from aliexpress seller website:
Attachments
HTB1Y54.JFXXXXX3aXXXq6xXFXXXq.jpg
HTB1Y54.JFXXXXX3aXXXq6xXFXXXq.jpg (122.99 KiB) Viewed 27205 times

DeNB3rt
Normal user
Posts: 120
Joined: 15 Dec 2015, 14:07

Re: HC-SR501 PIR issue's

#31 Post by DeNB3rt » 11 Jan 2017, 16:38

any updates? :)
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.

tozett
Normal user
Posts: 734
Joined: 22 Dec 2015, 15:46
Location: Germany

Re: HC-SR501 PIR issue's

#32 Post by tozett » 15 Jan 2017, 13:47

i played with the radar-pir.
looks they are working ok, but they have 360 degree observation.
i put one in a tin-can and tried to limit it to 100 degree with that.
but i had to put this on hold. i am short of time ...

meanwhile i had a problem with rfid on my frontdoor and i am trying to get this solved first.
the rfid-reader has a longer range, buti cant get it to work as wiegand-input to espeasy.

must solve this first...

Post Reply

Who is online

Users browsing this forum: No registered users and 33 guests