Quote Originally Posted by mister_e View Post

malc-c

I think you misread something or... could be me too
Could of.. but I thought the problem was with the relay causing the PIC to reset when the lamp is switched

Quote Originally Posted by lsteele View Post
Hi,

I'm trying to switch a mains current (240V AC) with a relay connecting via a transistor to my PIC (a 16f876a). The PIC is powered from a battery supply - 4 rechargeable AA NIMH cells providing 5V. That's powering the PIC directly - there's no regulator (I presumed there's no need for one).

At the moment the mains supply is hooked up to a light. Everything usually works fine when switching the relay ON, but when the relay switches OFF the PIC resets almost every time.
This was why I commented on the use of SSR's which I've used directly dirven from the PIC and don't suffer any issues of then PIC re-setting. However if I've missed the plot (quite plausable ) then sorry for taking the thread OT !