I'm running the following: (PIR Node, MySensors Library v2.1.1) > (ESP8266 Gateway, MySensors Library v2.1.1) < (Home Assistant, 0.50.2).
The PIR node is currently on a breadboard powered by my test bench power supply to rule out as many factors as possible.
In my Home Assistant logbook, I can see the PIR is triggered every 10 minutes, all day long. At the end of my loop(){...}, I have the following code:
unsigned long SLEEP_TIME = 600000; // (10 minutes), Sleep time between reports (in milliseconds)
#define DIGITAL_INPUT_SENSOR 3 // The digital input you attached your motion sensor.
/* ... */
void loop()
{
// Read digital motion value
bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
Serial.println(tripped);
send(msg.set(tripped?"1":"0")); // Send tripped value to gw
wait(500);
/**
defined by Arduino:
CHANGE = 1
**/
sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
}
I have verified that I do not get the false triggers if i disconnect the PIR sensor from the Arduino's pin 3. So, I know it's the actual PIR reacting to the Arduino coming out of sleep.
Could this be noise on the power rail from the Arduino or the NRF24L01+? If so, what are my options? I currently have a 4.7uf cap bridged across the NRF24L01's power connections. I will try adding a wait(500); before I actually read pin 3's value.
FYI: I don't have a scope to test power noise :(