Hi,
Can I suggest you redesign you PCB with the fact that you have mains voltages on it.
That is:
Keep any mains powered tracks AWAY from any other tracks.
In fact a separate PCB for the relays just run 3 wires between it and the controller PCB. 5V and the two wires from each relay to their respective drive transistors.
Place bypass capacitors AS CLOSE as possible to the 328 IC.
Place the Crystal and its two capacitors AS CLOSE as possible to the controller.
Make all your gnd tracks a lot wider and/or at least make them converge on a central point.
What are you using to power your project?
Thanks.. Tom.. ![]()
If I was doing this, I would be using a Pro Mini, or even a NANO plugged into the PCB using headers.
That way you save all the work of re-inventing the wheel with the controller circuit.
