From a53fd957afd6881a5298858fa39785523571bec5 Mon Sep 17 00:00:00 2001 From: Fisch Date: Sun, 8 Nov 2020 11:59:34 +0100 Subject: [PATCH] fix pir false triggering --- platformio.ini | 2 +- src/main.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/platformio.ini b/platformio.ini index 9ffb3fe..8499eb2 100644 --- a/platformio.ini +++ b/platformio.ini @@ -222,7 +222,7 @@ build_flags = -D dataDHT22_humidity_minchange=1.0 -D SENSOR_PIR - -D PIRPIN=D0 + -D PIRPIN=D6 -D dataPIR_readdelay=100 -D dataPIR_senddelaymax=1000*60*10 diff --git a/src/main.cpp b/src/main.cpp index c7c56f6..b6861d0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -82,9 +82,12 @@ struct sensordata #ifdef SENSOR_PIR -// PIR Sensors HC-SR501 (modified to put out shortest pulse time short pins 5 and 6 of ic) - //pir sensor needs 5v through an inductor for filtering. output level is 3.3v - //hc-sr501 should also be a few cm away from the esp. interference can cause false triggering + // PIR Sensors HC-SR501 + // pir sensor needs 5v through an inductor for filtering. output level is 3.3v + // 100nF capacitor should be soldered between pins 12 and 13 of BISS0001 to stop interference from esp causing false triggers (in some setups). source: https://www.letscontrolit.com/forum/viewtopic.php?t=671 + // hc-sr501 should also be a few cm away from the esp. interference can cause false triggering + // poti closer to jumper is sensitivity (cw increases). other poti is pulse time (cw increases). + // time set to output around 30s pulse sensordata dataPIR; bool value_PIR=false; #endif