Mains and Low-Voltage PCB Design Review – Best Practices

arduinopcbreview

I am creating a radiator controller by pilot wire (in France) for domestic and personal use.

The general idea is that using the 230V AC (standard) and modifying it with full, half or no wave you set the radiator in different modes. Then control it with the GSM to change modes or get the temperature (no PID of temperature just informative data).

As I don't know how to rectify AC to DC I bought an AC to DC 5V converter
Then I have inspired myself with similar circuits online and came up with this one:

Schematic

I have a GSM module, a thermometer, an Arduino Nano and 2 optocouplers. Should I change the type of optocoupler for a "switch at zero cross" one instead of an "instant switch" one?

To point to the potential "error" it's on the SIM800L side, are the DTR resistor to ground and the RST resistor to ~+4.4V are useful or should I delete them and go direct wiring?

I'm more afraid of the PCB which you find below:

PCB

It's a 2 layer board, both sides are ground plane. The rectangle on top right side is a "keepout zone" so that no copper is poured on the AC side.

I'm going to mount the Arduino and sim800l on female header so no worry about the resistors below the GSM module.

I have grounded the mounting holes but for the moment I'm not planning on using them (I will probably glue the PCB in a box)

I would appreciate some feedback, so what do you think?

I'm going to share my design files as "open hardware" so feel free to critique my schematic if it's not clear enough.

[EDIT]
Arduino +5V input is 0.5mm, others are 0.25mm and big traces are 1.5mm I think

[EDIT2]
I'm using through-hole as it's easier to solder by hand.
This is a one piece not industrial production at all

[EDIT3]

Input : +230VAC, ground

Output : +230VAC, different kind of signals (half-wave etc)

I'm guessing the radiator side shouldn't draw any current (maybe an optocoupler to transmit the phase to DC to a microcontroler)

Known :

  • AC to DC is good
  • Temperature is good

Not known :

  • Optocoupler side should be good (half-wave etc)
  • SIM800L circuit
  • AC clearance
  • MOC3023M, good choice ? Should I go with a "zero detection" optocoupler ?

[EDIT4]

The diode is a 1N4007. The grid is 0.12mm/5mils. AC side should have 4mm clearance if i didn't miss something. I didn't change the cap footprint for now I'm searching for a good cap in my stock and will change the footprint if needed 😉 And I guess I can ask if you guys have a "drop-in" replacement for the optocouplers ?

The revised PCB is below :

PCB revised

Best Answer

Should I go with a "zero detection" optocoupler ?

It's not mandatory, but that would be better in case there is a bit of capacitive load on the output.

Optocoupler side should be good (half-wave etc)

Yes

SIM800L circuit

A diode won't always drop 0.6V, it depends on current. To make sure SIM800 never gets more than 4.4V, you can put a resistor between +4.4V and GND to make sure diode current is never too low. If you want to make this wasted current useful, you can add a power-on LED there.

Since this GSM module draws power supply current in peaks that can reach 2A, a larger capacitor than 100µF could be useful. It's not for the capacitance value, but for the ESR. Here's an example low ESR cap.

AC clearance

It's possible to do much better. Don't put traces under the MOCs, because you want the full width of the MOCs to count as isolation barrier between mains voltage and your arduino and USB port. Move the diodes so they're in front of the pins (blue arrow).

enter image description here

You can move and swap the mains connectors so the pinout is easier to route, and move the traces for more clearance.

U4 should be on the edge of the board if you want it to be in contact with something to measure its temperature. If your circuit is in an enclosure, heat from the power supply will cause it to measure higher temperature, so the pcb should be mounted in an enclosure with ventilation holes, and with the power supply on top and U4 on the bottom (because heat rises). Or you can make a hole so the temperature sensor sticks out and measures ambient temperature, not inside the box.

If the power supply it on top, the GSM module should probably be there too so the antenna points up instead of down.

You can move around some components to avoid traces that cross each other, for example you can move the optos and connector up in the top right corner, and put the power supply where the optos were. Also don't be afraid to route traces between pins of your 0.1" headers if that allows you to put less traces on top layer. You'll get a better ground plane this way, with less traces making cuts in it.