Common ground with high current and sensitive components

Thread Starter

elliotcm

Joined Feb 7, 2017
7
I'm putting together a simple circuit to drive some analogue RGBW LED strips and control the brightness/colour of the channels from a Raspberry Pi.

The intent is to use 4 mosfets accepting the LED power on their source pins directly from a 12 or 24V power source, using PWM signals from the Pi to control the gate, and sending the controlled current from the drains into the LED strips. My understanding is that this will avoid running relatively high voltages and current through the circuitry of the Pi.

I've seen that it's recommended to combine the ground for the LED power and the ground for the Pi in order to provide a common reference point for the voltages. I understand that need and how voltages are relative potentials based on various reading (including the video on this site) but despite lots of reading on the topic I still don't fully understand the effect of combining the power and the control circuits in this way.

The LED strips can easily run to 15A over 10m. What's to stop that high return current from damaging the Pi if the grounds are linked? Is there a particular physical way they should be connected to make this safe?

For clarity, I'm not saying it's wrong to do this, instead I'm assuming there's something I'm not understanding and would love to be educated.
 

MrChips

Joined Oct 2, 2009
30,810
This is actually a formidable problem in mixed signal applications (mixed meaning analog and digital circuits on the same board) or where there are low voltages to be measured along with high voltage and high current switching devices.

Two circuits have to have a common reference voltage (usually designated as COM or GND) if they are to exchange voltage information.
It is not uncommon to have a microcontroller circuit operate at 100mA @ 5V, for example, and high voltage, high current loads operating at 10A @ 24V, for example. Note that these are just examples.

There are two major concerns one has to address.
1) Current loops
2) Inductive pickup and stray EMI radiation.

For #1, one ensures that the current return path of one circuit does not coincide with the current return path of the other circuit. In the example given above, the layout of the circuit board is critical. All current for the microcontroller circuit will return to the power supply via its own path. All current for the 10A @ 24V load will return to its power supply via a different path. The two separate ground paths are joined at only one spot at the power supply.

Hence the 10A current does not flow through the same conductors used by the microcontroller. The MCU is not damaged in any way by this large current flow.

It is very common to lay out printed circuit boards for mixed signal applications with separate ground planes. The two grounds are connected at one spot at the power supply.

For #2, attention to circuit and component physical separation and proper EMI shielding will go a long way in mitigating potential interference problems.
 

Thread Starter

elliotcm

Joined Feb 7, 2017
7
For #1, one ensures that the current return path of one circuit does not coincide with the current return path of the other circuit. In the example given above, the layout of the circuit board is critical. All current for the microcontroller circuit will return to the power supply via its own path. All current for the 10A @ 24V load will return to its power supply via a different path. The two separate ground paths are joined at only one spot at the power supply.
In my understanding we'd have the Pi sat in one location drawing low current from its 5V power supply hooked into the mains, the LEDs with this driver circuit PCB attached in another location drawing high current from its 12 or 24V supply also hooked into the mains, and PWM going across a long length of cable from the Pi to the PCB and thence to the MOSFET gates.

From a practical perspective, how would you join the grounds safely to provide reference without the return paths "coinciding"? Assuming that the board is laid out in such a way to avoid accidental leakage.
 

MrChips

Joined Oct 2, 2009
30,810
In my understanding we'd have the Pi sat in one location drawing low current from its 5V power supply hooked into the mains, the LEDs with this driver circuit PCB attached in another location drawing high current from its 12 or 24V supply also hooked into the mains, and PWM going across a long length of cable from the Pi to the PCB and thence to the MOSFET gates.

From a practical perspective, how would you join the grounds safely to provide reference without the return paths "coinciding"? Assuming that the board is laid out in such a way to avoid accidental leakage.
How long is the cable?
If you want to safeguard your RPi I would not connect the two grounds. I would use opto-couplers to control the MOSFET from the RPi.

You may want to look at this:
https://www.sparkfun.com/products/9118
 

Thread Starter

elliotcm

Joined Feb 7, 2017
7
How long is the cable?
If you want to safeguard your RPi I would not connect the two grounds. I would use opto-couplers to control the MOSFET from the RPi.
Approx 5 to 10 metres, I'd say.

I did wonder about using an optoisolator, I'll look into it more, thanks. I assume I've misunderstood the intent of the red boxes here?: https://learn.adafruit.com/rgb-led-strips/usage

"For longer strips requiring more than 1 Amp, wire the power directly to the strip, then run power and ground wires back to the Arduino."
 

crutschow

Joined Mar 14, 2008
34,452
"For longer strips requiring more than 1 Amp, wire the power directly to the strip, then run power and ground wires back to the Arduino."
That's one way to do it, if both are being powered by the same supply, but not if you have two separate supplies.

As noted, the object is to make sure that none of the high LED/MOSFET currents go through the processor ground.
Thus for two supplies, connect the grounds separately from their respective power supplies to the LED/MOSFETs and to the processor, and connect them together only with one wire between the processor and LED/MOSFETs.

If the power supplies have a common ground you can't disconnect, then run separate grounds back from the processor and the LED/MOSFETs, but make no other ground connection between the two.

You don't necessarily need to use an optocoupler for the signal but it's preferable, just to be on the safe side.
The opto would also provide a buffer for the large MOSFET gate capacitance currents, so they don't have to travel all the way back to the processor.

What PWM frequency will you be using?
Generally you don't want to go much higher than the eye flicker frequency sensitivity of perhaps a 100Hz or so, for both EMI and power loss considerations.

Note that for 15A current, you will need large wires between the LED/MOSFETs and the power supply for power and ground.
Even 12 gauge wire will have about 1.5V total drop (power plus ground) over a 10 meter distance.

Make sure you use some large decoupling capacitors from power to ground at the LED/MOSFET circuit at the end of the cable.
 

Thread Starter

elliotcm

Joined Feb 7, 2017
7
Thus for two supplies, connect the grounds separately from their respective power supplies to the LED/MOSFETs and to the processor, and connect them together only with one wire between the processor and LED/MOSFETs.
Does this not cause a problem with differing ground references, or is it adequate that the grounds are both wired into the same electrical network (i.e. a house) and thus will eventually ground to the same place?

You don't necessarily need to use an optocoupler for the signal but it's preferable, just to be on the safe side.
The opto would also provide a buffer for the large MOSFET gate capacitance currents, so they don't have to travel all the way back to the processor.
Makes sense. Though I wasn't aware that MOSFETs pull a lot of current on the gate pin? I guess I hadn't thought about it too much.

What PWM frequency will you be using?
Generally you don't want to go much higher than the eye flicker frequency sensitivity of perhaps a 100Hz or so, for both EMI and power loss considerations.
Based on published recommendations it would be 100-120Hz, I suspect, though my samples are en route from Shenzen so I haven't been able to run a test yet. It'll be indirect lighting so hopefully I can reduce the effect of flicker that way.

What's the risk if it was to run at e.g. 1kHz?

Note that for 15A current, you will need large wires between the LED/MOSFETs and the power supply for power and ground.
Even 12 gauge wire will have about 1.5V total drop (power plus ground) over a 10 meter distance.
There should be quite a small distance between the lighting/ring main and the start of the LED strip, so hopefully that won't be too much trouble. A qualified electrician will be responsible for getting the current that far safely.

Make sure you use some large decoupling capacitors from power to ground at the LED/MOSFET circuit at the end of the cable.
I understand the role of capacitors for decoupling, but could you clarify the reasoning for this specific case? What could go wrong if I didn't?

Thanks.
 

crutschow

Joined Mar 14, 2008
34,452
Does this not cause a problem with differing ground references, or is it adequate that the grounds are both wired into the same electrical network (i.e. a house) and thus will eventually ground to the same place?
The two grounds are tied together with a wire that doesn't carry significant current, so that ties the two grounds to the same potential.
Whether they match the house ground potential or not has no significant effect on the circuit operation.
Makes sense. Though I wasn't aware that MOSFETs pull a lot of current on the gate pin? I guess I hadn't thought about it too much.
The don't draw any DC current, but that have a large gate capacitance that must be charged and discharged every time they are switched, and that can generate significant pulse currents.
What's the risk if it was to run at e.g. 1kHz?
Just somewhat higher dissipation in the MOSFETs and higher EMI.
I understand the role of capacitors for decoupling, but could you clarify the reasoning for this specific case? What could go wrong if I didn't?
Nothing likely.
But they are good practice to avoid voltage spikes on the power line which generate EMI that could affect processor operation.
 

Thread Starter

elliotcm

Joined Feb 7, 2017
7
The two grounds are tied together with a wire that doesn't carry significant current, so that ties the two grounds to the same potential.
Right, so when you said "connect them together only with one wire between the processor and LED/MOSFETs" you meant connect the ground of the processor and the ground of the LED/MOSFETS together? So there's
1. processor ground -> supply ground A
2. MOSFET/LED ground -> supply ground B
3. processor ground -> MOSFET/LED ground
4. 4x processor PWM GPIO -> MOSFET gates (one each for R G B and W)

with #3 carrying little to no voltage because it's sole job is to connect these grounds?
 

ErnieM

Joined Apr 24, 2011
8,377
Personally I would go with a high rep rate, higher that 100Hz as there are some people (myself included) who perceive the standard PWM rates as movement. I find this especially distracting with new car taillights at night. If I look from one side of the road to the other my brain fires MOVEMENT where none exists.

Sorry I cannot give you any hard numbers here. I did one project where my PWM was limited in the low rate to something like 500 Hz and I did not have an issue with this, even shaking the LED back and fourth. That was a self contained thing, so EMI was not an issue for me.
 

Thread Starter

elliotcm

Joined Feb 7, 2017
7
Technically, it's carrying no current (other than any small signal currents), so there's no significant IR voltage drop across the wire.
Yes sorry I meant current not voltage.

OK this seems fine to me. I may go for an optocoupler since they're cheap and provide extra protection, but it's good to know I have options.

Thanks.
 
Top