HC-SR501 PIR - stop false positives?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
edautz
Normal user
Posts: 13
Joined: 10 Apr 2016, 07:16

Re: HC-SR501 PIR - stop false positives?

#41 Post by edautz » 24 Apr 2018, 21:08

Hallo riker1,

I don't have a picture for solution A, but if you use a nodemcu or another board with a esp8266 installed, soldering the two capacitors on the ESP8266 board to stabilize the power of the pir shouldn't be a problem.

I program my ESP8266/ESP32's from scratch, not using EASYESP or other code.

Solution B has proven to have no effect, so you can use WIFI in 802.11G mode.

Solution C & D if you van program the ESP yourself.

My snippets of code to accomplish this:

Using board manager 2.0.0/higher version and a ESP8266 board:

Enabling low level SDK commands (for boardmanager 2.0.0):

extern "C" {
#include "user_interface.h"

}

wifi_set_phy_mode(PHY_MODE_11G); // SDK command boardmanager 2.0.0 enables WIFI 802.11G mode.
// WiFi.setPhyMode(PHY_MODE_11G); // Command boardmanager > 2.0.0 (tested 2.2.0) same as above.
system_phy_set_max_tpw(value); // // SDK boardmanager 2.0.0 Value max 81 (dB = value/4) max Wifi send power.
// WiFi.setOutputPower(wifioutputvermogen);// Command boardmanager > 2.0.0 Value max 81 (dB = value/4) (tested 2.2.0) same as above.
WiFi.mode(WIFI_STA); // Force ESP in STA(tion) only mode.
WiFi.begin(ssid, password);

The are new board manager out, but I didn't use them, perhaps in the future.

After appling those measuresI noticed still false positives, but far less :

Direct expose to bright sunlight will trigger false alarm, solved to install 2 pir on different places, but working together, triggering alarm at daytime when triggerd together two times in short time. No problem at night, that they work indepently.

Sometimes the pir's produce a series of false positives, all with a pulse time <2800 ms. Those pulses filtered out in the ESP code.
After powerup the ESP with Pir, sometimes a false positive occur, In code suppressed the pir output for 30 seconds.


After all this measures I got 1 a 2 false alarms for my system in a year. Alarm is activated every night and when we are not at home.

Hope this helps,

Kind regards,

Edautz

riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

Re: HC-SR501 PIR - stop false positives?

#42 Post by riker1 » 25 Apr 2018, 07:24

Hi Edautz,

thanks.

A: Used a 47uF and 102pF power decompling consensator soldered over the pir power connections at the ESP8266 side.
which pins did you use? I am not an expert so?

Thanks Thomas

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

Re: HC-SR501 PIR - stop false positives?

#43 Post by edautz » 25 Apr 2018, 15:51

If you look to this picture:

https://www.elektor.nl/nodemcu-microcon ... gI0hvD_BwE

(assuming you use a nodemcu 1.0 ESP8266 board) You see Vin and GND pin. Vin is also 5V.

You can solder both capacitors to this pins. Be aware of the polarisation of the electrolytic capacitor.

Then connect the HC-SR501 power pins to this pins on the ESP board.

riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

Re: HC-SR501 PIR - stop false positives?

#44 Post by riker1 » 25 Apr 2018, 16:45

ok, thanks
will try

olleman
Normal user
Posts: 53
Joined: 27 Aug 2017, 08:10

Re: HC-SR501 PIR - stop false positives?

#45 Post by olleman » 16 Aug 2018, 16:20

I'm having big problems with my PIR sensors as well - to the extent that they aren't really usable. Is there a working solution that actually works? I'd like to continue using ESPEasy so programing the 8266 by myself isn't really a solution for me.

Andre BUHART
New user
Posts: 3
Joined: 04 Nov 2018, 18:41

Re: HC-SR501 PIR - stop false positives?

#46 Post by Andre BUHART » 04 Nov 2018, 19:00

One solution I have tested with success is to put a ferrite core close to the PIR sensor. When the ESPeasy is too close (few cm) from the PIR, the WIFI HF is detected and generates false positives. Power and signal cables act as HF antenna.
IMG_20181104_183249.jpg
IMG_20181104_183249.jpg (25.62 KiB) Viewed 65301 times
Pass the 2 power cables and the PIR signal cable through the ferrite. If you can, you can make additional turns to improve the efficiency.
You can buy cheap ferrite core on Ebay.

Regards

André

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: HC-SR501 PIR - stop false positives?

#47 Post by Domosapiens » 04 Nov 2018, 19:51

André,
do you have a triple-screen presentation for this?
Regards
Domosapiens
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

rvdhorst
New user
Posts: 1
Joined: 16 Jun 2019, 19:39

Re: HC-SR501 PIR - stop false positives?

#48 Post by rvdhorst » 16 Jun 2019, 19:42

edautz wrote: 12 Apr 2016, 22:12 I use the Arduino IDE 1.6.8 with board manager v 2.0.0 to program the ESP8266

Using the following commands to set the requested wifi settings:

wifi_set_phy_mode(PHY_MODE_11G);
system_phy_set_max_tpw(powervalue max 82); divide by 4 for dBm value
WiFi.mode(WIFI_STA);
This helped me with the SR505 on my ESP-01s from getting false positives! Tx!

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 126 guests