Mounting hole: EARTH or GND?


4-layer board: Signal-GND-GND-Signal
One the same board there is a power section - AC mains to DC 5V. AC comes in with Earth. AC will be also used in 10A relays.
The PCB will be mounted to a metallic front panel with screws.

So the basic question is: shall I connect the mounting holes to EARTH (as I did) or GND?

I’ve always used a separate power board and connected the mounting holes to EARTH but this is a single PCB hence the doubt.


“Earth” is an electrical thing, it has nothing to do with electronics.

The few uses of “Earth” are for an earthed cabinet, and for mains voltage filters in such cabinets.

From the little i know, earth is used for safety and/or protection.

Paul’s comment is not a valid one in my opinion.

And also there is not enough info regarding the mains - 5V DC power supply, is it isolated?

Still, mains voltages are lethal and there are standards dictating safety classes based on the product/appliance. Advices over a forum do not have much value and can be dangerous.

I can only advice to stay away from mains.

If (because of safety) the metallic front needs being Earthed than may be doing it by connecting Earth from AC mains through PCB to it by screws is not enough good way.
If it not needs be Earthed than may be you can use third option you didn’t considered - to isolate mounting holes from Earth and GND.
There are many factors to be considered. Not only safety. For example if you connect that panel with your GND and an electrified person will touch it than ESD (may be 8kV, or more) will be searching a way from your GND to Earth. Do you know which way it will find? Will it generate spark inside your 5V supply?

1 Like

Yes isolated via a switching transformer.

That’s probably the best solution, keep the mounting holes as just holes and isolate them

Ground/GND and “protective earth” or PE are two completely different things.
GND is an imaginary reference voltage level defined by your circuit design.
PE is a potential/voltage equalisation that keeps all conductive surfaces that can get into human contact at the same potential/voltage as its surroundings, making it safe to touch it in all circumstances.
In some cases they are the same. As an example: an oscilloscope in a PE-connected metal enclosure with non-isolated BNC receptacles.
It depends on your device. It may be beneficial to keep the inside circuitry floating, or it may be not.
Another example: a front with a membrane keyboard. In that case I’d connect the internals to PE to protect against a flash-through in a key. Can often happen after tear-and-wear.

But you’re the engineer.

Using a switching transformer is but ONE part of the mains isolation. How much gap do you have between the mains side and the low-voltage side on your PCB? (And what is the isolation specified by the transformer manufacturer for the transformer itself.)

Note that, if this is to be sold in any way, then it needs to meet the “legal regulations” in your country. If it just for you, then no one cares if you kill yourself!

EARTHING is about providing protection against any metalwork that you can touch. If, for example, you have an RCA audio connector, and you can touch it, then it must either be earthed or “suitably isolated” (see your local regulations for what is needed!)

Safety regulations are there purely to stop people getting injured: if your circuit doesn’t work due to incorrect earthing, but no one can be injured, then that is fine! So whether mounting holes are connected to Gnd, 0v, or fully isolated is YOUR choice, as long as you meet the safety regulations!

[Of course, if you are in China, and designing one of those “shitty pink power supplies”, then isolation is absolutely optional, and it doesn’t matter if someone else dies :slight_smile: ]

All of this is why none of my PCBs use any mains, it’s all 5v USB powered, with 5v-12v converters if needed!

1 Like

My very limited understanding of the rules of grounding a plug in device suggests that any metal controls used by the operator must be grounded via a 3 prong plug.

I agree with @Paul.Blitz 100%. For homemade projects a UL approved plug-in AC adapter is definitely the way to go.

You apparently do not understand the difference between “ground” (ambiguous) and “earth”, “earthing” or “protective earth” (non-ambiguous).

In that sense there is no difference between metal control that can be touched by user and external metal part of USB-C cable plug that can be touched by user. Do all power supply for a mobile phone have 3 prong plug?

Not knowledgeable enough to answer this question. However there is a configuration that is called “double insulated” (which I don’t know any details of except for guessing what the name represents) that follows different rules.

Honestly… If you are not aware of your countries electrical regulations or the hazard of “low voltage” please reconsider what is being done.

EARTH, GND, 0V… All are reference points but EARTH (especially PE) has a special role

What you do with your mounting points comes back to what you have done with your design and what you are protecting against.
For me … Some of my mounting pads are tied to a particular 0V either to hard reference to chassis (emi) for thermal (sink heat out) or a fault current path (safety ) and some … Large clearances from the mounting point as I need voltage standoff from chassis

This is not a KiCad Layout question it’s a Project question so I have changed the thread category.

If you have a metal enclosure you may well be using it as a Faraday cage so it will be connected to Earth as will the shield of any shielded cables so the shield extends the Faraday cage around the cables. I don’t think your PCB should be connected to Earth, it needs to be within the cage not part of it. IMO, happy to be told/proven wrong.

Thanks, sorry I’m pretty new to this forum.

Yes after thinking about this, I believe you’re right. I’m isolating the PCB from the enclosure with plastic spacers. I have ESD protection diodes on the board anyway next to connectors.


It is the answer for this question.
In general devices have to be safe in normal use, expected abnormal use, and when single fault in device happens. From that the name double insulation come. If there are two separate insulation, each meeting certain requirements than in single fault condition insulation is still valid.

My design is just a specialized timer project and as such it needs to drive AC loads via relays. So I need to have mains and 5V on the same board.

I confined the mains portion at the top of the board, with I think enough gap from the rest of the circuit. I routed AC Line and Neutral and for Earth I have decided I’ll use wires directly between the AC sockets.

  1. Euhm, no you did not. In some countries (USA / UK (I think)) they make a distinction between the “live” and the “neutral” wire of mains voltage, but in most of Europe mains plugs are not polarized, and either of the two wires can be live. Also, your THT connectors go through the board, so “live” mains voltage will always be on both sides of the PCB.

  2. Because there is no PE on this board, I assume it should be double isolated, and the clearances on your PCB are not nearly wide enough for this.

  3. Apparently you have an isolation slot below RV1, but not under J1 (Mains entry) where the pins are closer together. ???

  4. Mains connected Power supply without a fuse (fusible resistor) ??? Is it built into the power supply block? What does it’s datasheet recommend?

  5. SMPS without mains filter (these are usually external) It will work without, but it likely is not within any sort of regulation.

  6. It’s a guess about the relays, but my guess is these are not fit for switching live voltages. Even if it’s printed on the relay that the contacts can withstand / switch 230Vac, that does not mean they are fit to do so. I’ve bought some Chinese relay boards with “Songle” relays, opened one, and the internal clearances are abysmal.

  7. Without having actual measurements, I guess that none of your PCB terminals are safe for mains voltages, because the terminals are too close together.

I agree with that part.
At least until you have a few more years experience with electronics, and have read a whole lot about safety around mains connected appliances. Even if they don’t kill you instantly, they can still easily burn your house down.

I did not mean that neutral could not be live, I know that. What I wanted to mean was that live voltages are in the top 1/4 of the PCB.

That’s the main question I have, should I route PE on the board or not?
Where can I read about double insulation?
Clearances for Line and Neutral pads are 3mm.

You’re right, I will add it there too

There will be a fuse embedded in the AC socket

The SMPS includes rectifiers and filters and EMI class B filtering

Well those are Omron relays so I hope they don’t behave like the one you saw!

Those terminals are 5.08mm apart.

The reason you got no straightforward answer is because there is none to give. It depends on a lot of details, such as the isolation class. My knowledge about this is also seriously rusty (it’s mainly from before the EU became a thing). I had a short peek at Appliance classes - Wikipedia but it is quite terse on this subject.

Also, if your hole circuit is in a properly isolated enclosure, then the whole circuit can be live without further safety concerns.

So, that would be pads <2mm to get a 3mm clearance. From what I remember (30 year old info) four double isolation (class II) creepage distance was 3mm between mains conductors, and 6mm between mains conductors and the rest of the PCB.

Hoping won’t get you very far. Omron makes good relays, but that does not mean all relays they make are fit for your application. At least you should be able to get datasheets for your relays, and those will have remarks on their intended usage and safety related tests and norms.