In the circuit attached below, the led on RA5 will blink when pin RB4 is high. After reset with SW 2 closed and SW 1 open, the led does not blink (as expected). When I close SW 1, it will start to blink (as expected). However, when I open SW 1 it will continue blinking UNTIL I open SW 2. How can I prevent current from the relay from affecting pin RB 4 after SW 1 has cycled and SW 2 is closed?
Why do you use an AC relay, a Triac, an opto-coupler to switch the relay when a DC switching circuit would have worked more easily (since the AC circuit and the DC PSU for the PIC share a common ground)?