Hi thank you for reading.

I have the circuit as below....All software is working fine.

However I am aware the IP Pin on my Processor (16F627A) is being spiked by mains EMI and causing issues. I know this and I can repeat it by jigging a light switch (Fridge and Oven Stat also do same). The circuit is battery powered by a 12v alarm battery then a LDO 5v Regulator. So no physical connection with mains.

The 5v supply has decouplers on in and out as per data sheet.... Also there is a 100nf cap in the socket of the 16f627A.

Any help in stopping my circuit getting spiked welcome.

See attached AndyCad sketch for circuit.

AndyName:  IMG_20200320_133855.jpg
Views: 725
Size:  169.9 KBName:  IMG_20200320_133855.jpg
Views: 725
Size:  169.9 KB