I know this thread was opened quite a time ago. However I’ve come to the second stage of testing as I want to call it. I finally bought myself 3 new HC SR501 to make sure that the issue of unexpected motion detections is not caused by the sensor itself.
Now I started my testing with these sensors again and I think that I finally found the problem that is causing the unexpected detections. Therefore it has to be said that I am using a testing program that is triggering the Particle.publish function whenever motion is detected that was not detected the loop before. However, to make sure that the Electron is not disconnecting I included the Particle.keepAlive function that reconnects the Electron ever 30 seconds. This network traffic seems to be causing a problem, whether it is the power loss that is that big, or the indicated power due to the inductor so that the sensor “detects motion” every 33 seconds (3 seconds seem to be the difference).
This problem occurs not matter if I connect the VCC to the Electrons 3.3V or to the 5V input source from the USB power supply.
A thing I thought about, that could cause this issue is that the network traffic indicates power to the sensors wire, which then leads to a HIGH input. Do you think this can be solved by adding a proper resistor or by increasing the distance between the antenna and the sensor?
Another thing to try would be to use a stronger power supply (f.e.15W) to compensate for the high power use of the network module if this is the problem. Since this is not a very good solution for just connecting an “everyday” sensor I would very much appreciate your help and your opinion.
Thank you very much,