Ground issues when connecting different components - Page 1
Forum section: electronics / beginners

author: WatchfulEye
author_rank: Regular Contributor
timestamp: April 18, 2023, 07:55:29 pm
content: I've been doing some experiments with some low cost dev boards (mainly arduino clones). I've run into occasional problems with some of the boards, when connecting them to a different piece of equipment.I plan to connect them as follows:1. Dev board powered from PC USB. Sig gen powered from power brick. No interconnections2. Connect sig-gen ground to devboard ground.3. Connect signal from sig gen to devboard.The problem I have is that at step 2, the devboard has a tendency to crash as soon as the two grounds are connected. The state of the MCU is completely unpredictable. Sometimes the MCU becomes totally unresponsive, including to debug probes, sometimes it resets, and occasionally it'll jump to the hardfault handler.The problem can be avoided if I make a high resistance ground bond first - e.g. put a finger on the sig gen ground and another one of the devboard ground before making the connection.I'm wondering what is going on here. I suspect what is happening is that leakage through one or other of the mains PSUs, is resulting in a large ground potential difference. If a low impedance connection is made, this can cause a fast current spike. The resulting current and any capacitative coupling between ground and signals on the devboard, is then disturbing the MCU.Is my thought as to the cause of this correct? Is so, what can be done to correct this? Is it a matter of using better power supplies? Or can things be done in the circuit design?

author: james_s
author_rank: Super Contributor
timestamp: April 18, 2023, 08:03:34 pm
content: The behavior you describe suggests ESD. It could also be caused by RFI suppression capacitors leaking current into the output of the power supply, causing ground to float at a significant potential relative to earth. You could tie the DC ground to earth ground to prevent this, that will aready be the case on anything plugged into a desktop PC.

author: WatchfulEye
author_rank: Regular Contributor
timestamp: April 18, 2023, 08:35:46 pm
content: I did wonder about ESD, but I don't think that was the issue here.I don't know why I didn't do it earlier, but I just checked with a DMM, and measured about 100 V between sig-gen ground and devboard ground. There's about 800 mV between devboard ground and mains earth. I'm guessing it is the current flow as that potential equalises that disturbs the MCU.I've also tested several different power bricks, and they all seem to have an output floating at about 100 V above ground, and just connecting ground on a power brick to devboard ground is enough to reboot it. In all cases, any current to mains earth is tiny (<500 nA).The question then is, is this a devboard problem? This doesn't seem to be such a problem with other stuff like PC peripherals, audio gear, etc. So, what might make a circuit more or less vulnerable to this type of disturbance? That isolated PSU outputs may float surely means that this type of interconnection must occur extremely frequently?

author: wasedadoc
author_rank: Super Contributor
timestamp: April 18, 2023, 09:20:39 pm
content: Are you powering up before connecting the grounds? If yes, don't.

author: Kim Christensen
author_rank: Super Contributor
timestamp: April 18, 2023, 11:16:39 pm
content: Quote from: WatchfulEye on April 18, 2023, 08:35:46 pmIt doesn't happen with PC peripherals & audio gear because those usually have their chassis, and thus the signal/DC-power ground connected to the safety ground. Therefore they will be at the same potential and won't have that problem.Having the signal/DC-power ground connected to the safety ground has it's own problems though. Usually with ground loop hum and noise caused by small currents flowing via the safety ground. This won't be a problem for your dev boards and only really bothers sensitive audio gear or when trying to use a scope to find low level noise. So the solution would be to use PSUs that have a 3 prong power plug with the safety ground instead of those floating 2 prongers.

author: dobsonr741
author_rank: Frequent Contributor
timestamp: April 19, 2023, 01:47:36 am
content: Also, check your USB cable. The contact resistance can be high, on GND or Vcc or both. Specially on micro USB. The high GND resistance allows your board GND to move relative to the PCs GND potential, while Vcc stays the same. So in the connection transient you can have an unpredictable too low or too high Vcc for the MCU..For this reason I’m using Type B usb whenever possible.Another solution to add ~10-100nF || 1Mohm from the generator GND to protective Earth.

author: james_s
author_rank: Super Contributor
timestamp: April 19, 2023, 02:13:02 am
content: That does sound like leakage from the suppression capacitor(s) in the power brick. It's fairly normal although it doesn't usually cause the problems you're experiencing.

author: WatchfulEye
author_rank: Regular Contributor
timestamp: April 19, 2023, 03:23:51 pm
content: Thanks all. I did check the ground resistance on the USB supply - and it all checked out OK. About 0.5 Ohms, same as the VBus line.However, this did get me thinking about the issue of ground impedance. I inspected the devboard PCB, and it's a two layer board, with the ground as copper fill areas. However, when I traced out the path from the ground breakout pin on the board, the route taken by the current to the MCU is very long, as it jumps from small copper island to copper island through a series of vias.The reset line is also very long as it connects to various switches, breakout pins, and debug port, making it probably the longest trace on the board.So, I had the idea that maybe the current flow as the ground voltages equalised was coupling a glitch into the reset line, and this was what was upsetting the MCU. I modified the board by installing a 100 nF capacitor on the reset line, approximately 1 mm from the MCU pin, and also adding small ground wires to the MCU decoupling caps so that they connected directly to the MCU pins, instead taking the long route through a half-dozen copper islands and vias. This appears to have completely eliminated the crashing/rebooting issue.I'm guessing now that if the devboard had been built with ground planes, that it might be rather more immune to this type of glitch. Would this be a strategy if I wanted to build an MCU circuit, but wanted to keep it double insulated/not connected to mains earth?If I want to use mains earth, then would it be right to just add a chassis ground connected to mains earth, and then high resistance couple it to signal ground (10-100nF || 1Mohm as suggested by @dobsonr741) ?