Could likely be interference if it isn't actually a software problem. Shielding and proper routing of wiring is key, but a sloppy and fast way to check it is to simply reverse your active high/active low settings so that in the non-tripped state it is constantly high, and tripped it goes low.
Not a great replacement for proper shielding, but it does keep false positives from happening if it is indeed a shielding issue, as if low is the default state interference can make it go high and give a false trip, interference obviously can't happen as easily the other way round and force a pin to go low. |