Page 1 of 1
GPIO false trigger due to electrical interference
Posted: Sat Feb 08, 2014 10:21 am
by amadhu
I am trying my hands on home automation using RPi. I have a simple set-up to start with: a PIR sensor and a relay driver. In my C program (written using wiringPi APIs), I have a callback registered for a raising edge interrupt ( this is to monitor my PIR sensor). I have configured another GPIO pin to drive my relay. Everything works as expected, but I get plenty of false triggers when I turn-on any light in my house; Particularly the ones that are close to my Pi. My optically isolated relay driver is built on a general purpose PCB and the PIR sensor also terminates on the same PCB. I have a GPIO ribbon connecting Pi and this PCB. I have also turned on pull-down resistors on the GPIO pin that takes the PIR sensor output. I am not able to isolate the cause for these false triggers; Is it because, I have left rest of the GPIO pins floating on the PCB? Should I try shielding my PCB by placing it in a grounded metal case?
Re: GPIO false trigger due to electrical interference
Posted: Sat Feb 08, 2014 10:51 am
by ShiftPlusOne
Just an idea, since I don't know how you have everything wired up... Instead of using the internal pull-up, add your own one, with a lower resistance. Make sure you don't draw too much current though.
Re: GPIO false trigger due to electrical interference
Posted: Sat Feb 08, 2014 11:12 am
by redhawk
Are you using some kind of modulation for your IR beam or just a plain and simple IR detector circuit??
Richard S.
Re: GPIO false trigger due to electrical interference
Posted: Sat Feb 08, 2014 5:28 pm
by amadhu
Re: GPIO false trigger due to electrical interference
Posted: Mon Mar 31, 2014 4:48 pm
by gcraig102
I'm seeing the same thing with my project. When I switch a motor on it gives false triggering. I couldn't find anything definite with a scope or filter it with capacitors. There is another thread on here where it has been fixed by using a time delay and checking the level of the input to confirm if it is real or not. It seems the edge trigger with the Python modules is extremely sensitive. I have moved my program over to C. It is better behaved.