HC-SR501 PIR - stop false positives?
Moderators: grovkillen, Stuntteam, TD-er
Re: HC-SR501 PIR - stop false positives?
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
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
Re: HC-SR501 PIR - stop false positives?
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
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
Re: HC-SR501 PIR - stop false positives?
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.
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.
Re: HC-SR501 PIR - stop false positives?
ok, thanks
will try
will try
Re: HC-SR501 PIR - stop false positives?
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.
-
- New user
- Posts: 3
- Joined: 04 Nov 2018, 18:41
Re: HC-SR501 PIR - stop false positives?
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.
You can buy cheap ferrite core on Ebay.
Regards
André
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é
-
- Normal user
- Posts: 307
- Joined: 06 Nov 2016, 13:45
Re: HC-SR501 PIR - stop false positives?
André,
do you have a triple-screen presentation for this?
Regards
Domosapiens
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.
Re: HC-SR501 PIR - stop false positives?
This helped me with the SR505 on my ESP-01s from getting false positives! Tx!
Who is online
Users browsing this forum: Google [Bot] and 126 guests