# Beginner's second PCB circuit design: AC to DC

I am designing an AC to DC converter and I just want to make sure that I am so far doing the right thing — placement of components and wiring etc. — as I am a beginner.

Does this look good so far?

This is my updated schematic and PCB.

Do the rectifiers look correct? I tried to space out 8mm for the transformer. Do the connections look good?

How does this look like? For J4 I have a 230v appliance but no power and for J5 I have the AC 230V and a relay which acts as a switch. Relay is rated for 260v. Would this work?

• Your primary-secondary isolation clearance is very poor. Also, depending on your output voltage, the 1N4004 might not have sufficient reverse blocking voltage. – Hearth Feb 13 at 16:03
• I agree with @Hearth. You could move the fuse to the left of the transformer for better isolation. I would rotate the group of four diodes 90 degrees clockwise and place them to the right of the transformer. You could swap the pin 3 and 4 connections on the transformer, if it makes it easier to route the PCB. – Peter Karlsen Feb 13 at 16:13
• If you swap the position of d1 & d2, and d3 & d4 your traces could be shorter and less wiggly – Colin Feb 13 at 16:29
• Are you planning on capacitors across the diodes, to reduce EMI? – analogsystemsrf Feb 13 at 17:04
• @M2T156 you need to keep an isolation to all metal parts, including the screw heads. Consider moving the fuse and connector further down, so that you can keep a safe clearance from the mounting holes, and screw heads. – Elmesito Feb 14 at 9:47

Per IPC spec you need creepage and clearance, even if your not using this in a product (and getting it tested at an ETL).

That means if you have AC mains running into your board, you need at least 1.6mm around the conductors that carry that voltage (meaning the hot and neutral lines) and any other conductor. This is for pollution degree 1 which for you means no dirt (stuff that could lower the conductivity of the PCB).

It's generally a good idea to place a large gap between AC and DC sides of the board for good measure. If this is a product it needs to be double insulated or made inaccessible to someone who would service it.

• Worth adding that this applies equally to live and neutral connections, as far as I know. Industry regulations aside, it's a really good idea regardless. – Hearth Feb 13 at 16:15
• It is worth mentioning that there is a second chart, for double insulation, which is what should be used between the primary and the secondary of the transformer. 1.6mm between mains and low voltage is not enough, if it is accessible to the user. – Elmesito Feb 13 at 16:35
• I forgot about that, I make all my products inaccessible – Voltage Spike Feb 13 at 16:44
• Shouldn't it be the high voltage and low voltage sides of the board, not the AC and DC sides? There is low voltage AC between the transformer and the rectifier. – user253751 Feb 13 at 23:36
• Usually after the rectifier you have a DC side, I like to keep those traces completely separate with Cm's of distance if possible, can't be too safe – Voltage Spike Feb 14 at 5:32

The first thing that is really evident, is that you have not left large enough gaps between the Mains AC and the secondary of the transformer.

Here are three documents that can give you more insight. IPC2221A: Generic Standard on Printed Board Design.

UL61010-1: Electrical Equipment for Laboratory Use. (if you have access to it. Other "sources" might be available)

UL60950-1: Safety of Information Technology Equipment

These documents are a lot to read and understand, so as a general rule, you should keep 2mm gap between traces/pads on the mains side, and 8mm gap between the mains and the low voltage, where you might touch with your hands the conductors. You can go below these clearances, but you need to know what you are doing, and this is where the three documents listed above, come into place.

As yours is a hobby project, and space is not a big issue, stick to the values I have given you above, or greater, and you will know to be safe, as long as you stay below the 300VAC.

There is no reason for N$4 to wrap around N$5. If you swap the two transformer pins, the layout becomes much cleaner.

As above, the net connecting the D1 and D2 cathodes is way too close to the end of the fuse. Also, it is unnecessarily trapped. Getting a trace from there to some other part of the circuit means wandering around the transformer pins. Consider rearranging the diodes such that the two outputs of the bridge are more accessible from the right.

• Does this look good now? – M2T156 Feb 14 at 8:58

Parts placement should be done very different. Distance between primary circuit parts to secondary circuit parts should be as big as possible, also between all primary to all secondary tracks.

So J1 and F1 at the left side of the board close to the primary transformer pins 1 and 2.

D1 to D4 on the right side of the board close the secondary transformer pins 3 and 4. Pins 3 and 4 may be swapped when neccessary to avoid crossing tracks.

• Does this look good now? – M2T156 Feb 14 at 8:58

I suggest rotating the transformer 90° CCW and moving the bridge to the upper right of the PCB. As others have said, your clearance primary-secondary is inadequate for the mains. 8mm of creepage would be good for primary-secondary.

Swap equivalent pins (such as the transformer secondary pins) to make the layout more straightforward. This is of more importance on high voltage and/or high current conductors than on traces that carry only signals.

You should also be thinking about mounting holes early, they're often a pain to try to fit in later.

• Hi Spehro. I will give that a go and I will update the screenshot so you can see – M2T156 Feb 14 at 7:46