Recently i have made four channel timer for my aquarium. It controls aquarium loads: fluorescent lamps, water filter, heater, hood ventilator, all 220V AC. Schematics is simple: PIC18F25k22 microcontroller in certain time turns on and of my aquarium loads. Microcontroller controls optocouplers 4n32. Optocouplers controls relays, coil is 12V. Relays through contacts controls loads. I faced one problem: when relays was turning loads on and off, microcontroller frequently stucked. Then i redesigned my PCB, added 0.1uF cap in parallel to every load and situation now is much better. And the problem left only with my filter. When i manually remove working filter from my timer's socket, microcontroller stucks. This happens only when it (brushless AC motor, only 5.2W) is removed, but never when connected again. With other loads there is now such problem. Maybe it is emi problems, how can i solve them? Read about Faraday cage, but i am not sure that this will work. Maybe additional filters would help? Maybe PIC16F family microcontroller is more immune to EMI?