rudy wrote:You mentioned an RC delay? What is that? Could you please elaborate some more.
I never have input pins connected directly to wire outside the product. I would have a pull up resistor, say 1K, then 10K between the 1K resistor and the input. And from the input to ground I use a small capacitor. Sometimes 0.1uF, but it depends on how quickly I need to respond to the change on the input.
Layout of the wiring is also important. Usually in a case like your's I ask to see a picture of the setup. To see what might be possible causes.
Putting a 1uF capacitor between the input pin and ground solved the problem! Thanks!
Anyways, here is the video that shows my previous problem. It might help other people in the same situation. Seems you should ALWAYS put a capacitor on the input pins to make sure your circuit works in places with flakey mains.
https://www.youtube.com/watch?v=5dadR-qMipo