Read the statement by Michael Teeuw here.
Odd GPIO issue with 5V supply working with MMM-PIR-Sensor
-
Hope someone can point me in the right direction here…
As I’ve been having issues with a module I decided to do a new clean install of Raspian Jessie light & then go through the full set up procedure again. I used a new SD card for the install so I could retain the old one in event of any issues (and I’m glad I did).
Got all my module sorted & it came to me getting MMM-PIR-Sensor working again. I cloned the git repository & ran the npm install from the folder. Now I noted that trying to run a “gpio readall” gave me a bash command not found error, so I instead followed the link in the pir sensor git hub page to wiring-pi (the node.js binding version of wiringpi). I installed this but then when running my gpio readall i got another error relating to not having the correct chip (I think wiring-pi is outdated & I’m running a pi 3 so it didnt install the correct up to date version of wiringpi), so I instead went direct to the wiringpi by drogon git page & installed it that way. Now gpio readall etc works fine. Note- I’ve given this story in case it’s relevant to my issue.
Now my MMM-PIR sensor does function as it should if I sent the timeout value to some thing short like 10 secs so no issues with the module or wiring pi itself etc. Screen goes off, come back on when pir sensor activated.
The issue I’m having is that every 2 mins or so, the PIR sensor itself is triggered (I know because it has a red LED which lights up). The sensor is becoming activated even if I’m not in front of it (I have also put it inside something to ensure its not getting any rogue heat to trigger it). It’s pretty regular - approx every 2 mins it goes off. This means that the mirror is constantly switching the screen back on.
To troubleshoot I have used an identical PIR sensor which gives the exact same issue. I also tried a different 5V GPIO pin. Now the reason I know this is not a hardware fault is, if I put my old SD card in (with my old Jessie & MM install) it works absolutely fine, no rogue triggers.
So my question is- what could be causing this? I know the PIR sensor will ‘trigger’ and the LED light up when it is first powered up so I can only imagine that somehow the 5V is not stable & is causing the sensor to power cycle every 2 mins or so. What I don’t get is that hardware-wise everything is the same. I’m using a good stable power supply with plenty of available current. So what software setting for my PI could be different in my new build? I may have done something in my previous build that I’m missing in this case (I had done lots of things from various web links to get other aspects of the mirror working), but I’m not sure exactly what I’ve missed this time around.
I welcome your suggestions! Thanks.