I'm playing around with the idea of adding a capacitive sense switch to an all-metal lamp, and have some questions around safety as I'd, obviously, prefer not to turn the whole thing live.
In the plastic, isolated base, I'll put a 220V->5V SMPS which powers a board with an ATTiny45, opto-isolater/triac, and zero crossing detection circuitry. What sort of trace isolation do I require for the 220VAC? And between the live and isolated side? Anything else that's likely to kill me?
Board top:
Board bottom:
(edit for improvement)
Is the below better?