Ac and DC grounds

I have read the sticky at the top of the section and searched on the internet and I'm more confused than when I started.

The question I have is about grounding both AC and DC power for my project, I'm putting all my electronics inside a large UL listed metal box. I will have mains power coming from an outlet into the box and it will go to a DIN rail terminal block that will feed power to 2 PSU's (one 12V and one 48V) and they will feed all other components, stepper drivers, fans, sensors and so forth.
The question I have is do the Mains(AC) grounds ground together with the DC grounds, I ask because the DIN terminal blocks come with grounds that will touch the rails thereby grounding them and the chassis but they also come where they don't touch the rail so the grounds would follow the ground supply wire back to where it came from. I will use the DIN rail to supply power and ground to all DC components so I'm not sure what to tie together as far as grounds go so as not to get any ground loops or cause power spikes to run the wrong direction.
I haven't started anything yet as I'm trying to think before I act and have to tear things apart to make them right.

The grounds don't have to be connected. It's generally optional. For example, the power supply/charger "ground" to your laptop or phone is normally not connected to the power line ground. If you power your Arduino from your laptop's USB port your Arduino ground is isolated or "floating" (unless it's grounded somewhere else).

However, the USB ground on a desktop/tower computer probably is connected to AC/earth ground.

The metal box with the AC power inside should be earth-grounded (usually through the AC power connection). That's a "safety ground". If one of the AC wires comes loose inside or something else that happens to put power-line voltage on the metal case, that power will be "grounded out. You'll blow a circuit breaker and nobody will get killed from touching the metal case.

The metal box with the AC power inside should be earth-grounded (usually through the AC power connection).

This is not a “should be” situation. It’s a must. All conductive parts, box, metal chassis power supplies, whatever it is, MUST be grounded through the AC supply. Anything less is a shock hazard. This connection is considered to be at earth potential and is referred to as the protective ground or protective earth connection, sometimes abbreviated as PE.

Connecting the dc power supply common or negative to the protective earth connection of the ac supply is not required. There are times when connecting those points together just couples 50/60Hz noise into the low voltage system. Others times, the connection between the points solves noise problems. This can be dependent upon the sensors and if they’re earth grounded or not.

You have at least three options with respect to those two systems which start out being isolated from one another.

  1. You can leave the dc supply ground isolated from the protective earth
  2. You can connect dc supply ground to the ac ground, creating an dc and ac path between the systems.
  3. You can connect dc supply ground to the ac ground with a capacitor. This create an ac only path between the systems.

Case 3 be the the better choice when you have ac mains noise riding on low voltage sensor signals. The capacitor prevents a dc ground loop from forming and causing a dc offset voltage that would be created by a direct connection between ac and dc systems.

Be aware that when you have a desktop computer connected to an Arduino through a USB port, the GND (dc common) connection of the Arduino is connected to ac protective earth by way of the three wire mains power cord and the usb (-) supply connection.

If your project works well when plugged into usb and then stops working when the usb connection is removed, it can be that connection between GND and ac protective earth.

This common ground does not happen when a laptop is used with an isolated, two wire mains cord since there is no connection to ac protective earth.

My overall recommendation would be to use a grounding type terminal block for the incoming mains ground (protective earth/PE) wire. Use green, green/yellow or yellow/green wires only for connections to PE. Keep you dc power supply commons together but not connected to PE. You can always connect the two systems together if needed for noise resolution. Otherwise, leave them isolated and obviously on non-grounding terminals.

DVDdoug:
The grounds don't have to be connected. It's generally optional. For example, the power supply/charger "ground" to your laptop or phone is normally not connected to the power line ground. If you power your Arduino from your laptop's USB port your Arduino ground is isolated or "floating" (unless it's grounded somewhere else).

However, the USB ground on a desktop/tower computer probably is connected to AC/earth ground.

The metal box with the AC power inside should be earth-grounded (usually through the AC power connection). That's a "safety ground". If one of the AC wires comes loose inside or something else that happens to put power-line voltage on the metal case, that power will be "grounded out. You'll blow a circuit breaker and nobody will get killed from touching the metal case.

I'm familiar with grounding all metal associated with earth mains which is why I bought a nice UL listed enclosure that has grounding lugs on the case and the door along with a heavy piece of sheet metal inside to attach all my components.
It is a standalone system so I won't be attaching a computer to it to run things, only for uploading Arduino programming.

WattsThat:

  1. You can leave the dc supply ground isolated from the protective earth
  2. You can connect dc supply ground to the ac ground, creating an dc and ac path between the systems.
  3. You can connect dc supply ground to the ac ground with a capacitor. This create an ac only path between the systems.

Case 3 be the the better choice when you have ac mains noise riding on low voltage sensor signals. The capacitor prevents a dc ground loop from forming and causing a dc offset voltage that would be created by a direct connection between ac and dc systems.


My overall recommendation would be to use a grounding type terminal block for the incoming mains ground (protective earth/PE) wire. Use green, green/yellow or yellow/green wires only for connections to PE. Keep you dc power supply commons together but not connected to PE. You can always connect the two systems together if needed for noise resolution. Otherwise, leave them isolated and obviously on non-grounding terminals.

I will look at putting a CAP in the mix as I was chasing gremlins on my last project and that was just a pain.
I had originally planned to separate the two but I'm still pretty new to electronics and the amount of detail involved in such small things is enormous, every component effects every other component in some way.

I agree connecting the safety ground to the metal box. However the final project should be able to operate properly without the safety ground as not all receptacles or extensions continue the safety ground (at least not in the US).

I would not connect the DC common (negative etc) to the metal box. I believe it will cause more problems.

However I don't know any details about your DIN power supplies. I would be concerned about the two isolated DC supplies floating too much above ground. Here you need to understand the remainder of the project.

Another thing to consider is if you are using transformerless power modules for your DC supplies, the DC ground WILL be above earth potential.

metermannd:
Another thing to consider is if you are using transformerless power modules for your DC supplies, the DC ground WILL be above earth potential.

Can you explain that please? It doesn't make sense to me, maybe I am missing something.

Certainly does not. There are really no such things as "transformerless power modules" since all use a transformer even if it is small and possibly even hard to identify.

DC to DC "buck" converters generally have a common negative for input and output but this does not relate to mains power supplies and they have an inductor rather than a transformer. One specific exception is the constant current driver used in LED luminaires where it is prefixed by a bridge rectifier.

If the entire device is fully (double) insulated, you may in some circumstances use a capacitor as a voltage dropper with minimal power loss (though you do tend to waste power in the following shunt regulator, usually a Zener) but this is again, a quite different situation.

For example, the power supply/charger "ground" to your laptop or phone is normally not connected to the power line ground. If you power your Arduino from your laptop's USB port your Arduino ground is isolated or "floating" (unless it's grounded somewhere else).

*However, the USB ground on a desktop/tower computer probably is connected to AC/earth ground. *

This can be confusing for newbies. The first step is identifying whether the ac power cord is 2-prong or 3-prong.
If it is 2-prong like my work laptop supply the circuitry in the laptop is floating (including the USB). However if it
is 3-prong, like my MSI personal laptop, then likely the USB ground will have continuity to the 3rd prong on the
ac plug (the Earth GND). Whenever in doubt , you can always do a continuity check with the power off from your
circuitry to the earth gnd of an unused outlet socket. MAKE DAMN SURE YOU DON'T ACCIDENTLY SHOVE THE
METER LEAD IN ONE OF THE SLOTS INSTEAD OF THE ROUND GND PLUG. If you don't feel comfortable doing this
then unplug the power strip before doing the continuity test. If you are using a wall outlet then you will have to
be careful to only insert the meter lead in the round EARTH GND hole instead of one of the AC N or L slots. This
is VERY important ! Should I say it is a matter of life and death ?
Determining whether you need isolation from the power grid earth gnd is a subject that requires experience and
research. Sometimes it is optional, sometimes it is mandatory. It generally depends on the application.

Hi Everyone.. Late to this party but this may add some perspective:

https://arduinoinfo.mywikis.net/wiki/Arduino-Project-Planning-Electrical

Transformerless power supplies DO exist... if it wasn't for forum rules, I would link a couple sites that explain how these work compared to regular power supplies. If you pick up a 'wall wart' supply and there is no real heft to it or a magnet won't really to stick to one, it's pretty much guaranteed to be a 'transformerless' supply (i.e., mobile phone chargers).

In a nutshell, these use a capacitive divider to reduce mains voltage to where it can directly power a device or feed a physically smaller SMPS than would otherwise be required if it had to drop that voltage in one step.

I HAVE measured 50-60 volts between the "ground" on one of these and earth ground.

if it wasn't for forum rules, I would link a couple sites that explain how these work compared to regular power supplies.

Nothing in the forum rules stop you providing links like this. This is because they are relevant to the question.

Links to unrelated sites like fortune telling or selling kitchens are against the rules because they are spam links.

On the topic of this thread: sometimes when making measurements for example connecting the signal to earth ground improve the accuracy of the readings. For example all signal grounds on an oscilloscope are connected earth ground. If you want a floating signal ground you have to buy a special probe. The old engineers trick of disconnecting the mains ground from the socket and leavening it hanging out of the plug so you know, was one of the driving forces behind the almost universal use of sealed mains leads.

metermannd:
If you pick up a 'wall wart' supply and there is no real heft to it or a magnet won't really to stick to one, it's pretty much guaranteed to be a 'transformerless' supply (i.e., mobile phone chargers).

Sorry, that is simply rubbish. :roll_eyes:

As I said above, a mobile phone charger must be isolated and the only way it can be isolated, is to use a transformer. Switchmode supplies operate at very high frequencies and use small transformers but nevertheless, they are transformers.

And yes, they are in consequence, very light and you won't get a magnet to stick to them. :sunglasses:

From Perry's sticky post "How to get the best out of this forum (short version)":

General:
Please try to avoid posting links to other sites where code or photos or schematics are hosted. Most of us will not follow such links

Anyway, here's one of the links that came up when doing a search for "transformerless power supplies":

The 'Shocking' Truth about Transformerless Power Supplies

Please try to avoid posting links to other sites where code or photos or schematics are hosted. Most of us will not follow such links

Yes that as well. This is because such sites almost always want to infect your computer with cookies that allow tracking on the net. That is why these thing should be sent as attachments to your post.

Links like you just posted are fine.

metermannd:
Anyway, here's one of the links that came up when doing a search for "transformerless power supplies":
The 'Shocking' Truth about Transformerless Power Supplies

Which absolutely confirms everything I stated. :roll_eyes:

Excellent article. :sunglasses:

terryking228:
Hi Everyone.. Late to this party but this may add some perspective:

Arduino-Project-Planning-Electrical - ArduinoInfo

Thanks @TerryKing228 that ia a great reference, lots of info.
I need to finish my schematic and upload it so people won't have to guess what other things might cause problems.

JohnRob:
I agree connecting the safety ground to the metal box. However the final project should be able to operate properly without the safety ground as not all receptacles or extensions continue the safety ground (at least not in the US).

I would not connect the DC common (negative etc) to the metal box. I believe it will cause more problems.

However I don't know any details about your DIN power supplies. I would be concerned about the two isolated DC supplies floating too much above ground. Here you need to understand the remainder of the project.

The 12V 5A power supply is a Mean-Well DIN rail power supply.
https://www.amazon.com/gp/product/B00DECZ7WC/ref=ppx_yo_dt_b_asin_title_o05_s00?ie=UTF8&psc=1
The 48V 10A supply is just a standard cheap one( just couldn't pay $150 for the DIN one).
https://www.amazon.com/gp/product/B08GFQZFC1/ref=ppx_yo_dt_b_asin_title_o05_s00?ie=UTF8&psc=1
The 48V will power 6 stepper motors.
The 12V will power fans and a few proximity sensors and I was going to power the Arduino with it but I read a thread on here that thought it wasn't a good idea to make the Arduino work that hard to drop the voltage down to 5V, the gist was powering other devices off the 5V power could draw to much current through the Arduino which left me with more questions than answers.
They thought a Buck converter to drop it from 12V to 5V should be the way to go but whether it is 5V or 12V the same 5A current is still going to the Arduino so I'm not sure what was gained.(A little off topic, sorry)

raschemmel:
This can be confusing for newbies. The first step is identifying whether the ac power cord is 2-prong or 3-prong.
If it is 2-prong like my work laptop supply the circuitry in the laptop is floating (including the USB). However if it
is 3-prong, like my MSI personal laptop, then likely the USB ground will have continuity to the 3rd prong on the
ac plug (the Earth GND).

I have puzzled a lot over this. I have several power supplies that have 3-prong plugs despite being enclosed within plastic enclosures and having 2-wire outputs. I have wondered what the point is, except maybe to ensure that the plug only fits a 3-pronged receptacle … but again, why? Perhaps there is some argument about preventing one of the outputs going hot in the case of extreme damage to the power supply, but that seems farfetched.

And what would be the purpose of connecting a laptop chassis to earth ground? It seems as if this would actually be bad from an ESD standpoint. Unlike a typical desktop PSU, there is no mains voltage present in the laptop.
S.