Thanks for all the suggestions - I'm blown away by how quickly people have responded.
Ok, I've added the snubber and it's immediately eliminated 90% of the resets. I can now turn the relay on and off with the light connected and it works. Strangely I can still produce a reset if I switch the mains on and off at the socket, even when the light is NOT connected. And I've still had one or two random resets.
I'll try connecting up the other VSS pin and adding the 47uF cap to the PIC power supply to see if that gets rid of the remaining resets.
>> * Set all unused i/o to input and connect ALL of them to GND
Is this something I should do whenever dealing with PIC, or only when dealing with mains voltages/currents? What's the rationale here? I'll try the other steps first since this is going to require me to produce a new PCB!
>> Also, probably a nice idea to place some 0.1 uF in parrallel with each realy coil + 100-470uF & 0.1uF on their VDD line.
ok, I'll do this too.
One other question: While reading up on this I've heard lots of talk of ground planes. Is this simply a large area of copper on the board which is tied to ground, or does is have to be an entire layer on the board (impossible in my case since the board is single sided). And how do they help (and indeed could they help in my case)?
Thanks again.
Bookmarks