I am taking the 3V from Pi and giving it to COM of a relay. The NO goes to GPIO 13 of the same Pi.
I have a 120V line that triggers the relay, which then connects the 3V to GPIO 13.
It was working fine for a couple of days. However, suddenly its rebooting everytime the relay triggers and connects the 3V to GPIO 13.
This happened when I was doing something else and my code to open GPIO 13 for input was not even executed. Can it be because of that? I am not explicitly setting the GPIO 13 to output, its in the default state after reboot (which I believe is Input)
I dont have immediate access to the Pi as its at a remote location. So I haven't been able to try it with some other pins yet.
Can this be a magnetic field issue when the relay gets triggered?