Ground loop issue with amplifier and Raspberry Pi

Thread Starter

_spaces

Joined Jun 21, 2024
9
I'm trying to run a Raspberry Pi with a USB audio adaptor into an external amplifier board via 3.5mm, then running out to speakers from the amp.

Right now I'm getting a lot of electronic noise coming through the speakers when the Pi boots up. When the 3.5mm cable is disconnected, the amplifier is otherwise silent, and everything sounds fine if I power the Pi from a seperate PSU to the amp, so I know it's a grounding loop problem that's the issue. I'm assuming I need to rewire where the grounding is for the Pi and the amp, but I can't figure out which arrangement will solve the issue.

I've attached a photo of my set up here, and a crude diagram - the power and ground for both the Pi and the amp are currently hooked into the wago connector. Anyone got any advice on how to eliminate the noise? So far I've tried wiring all the grounds (Amp gnd, Pi gnd, pi and amp audio gnds) together to the ground of the switch which didn't help, and all of them to the ground direct from the PSU, which also did nothing. I've also tried removing the audio grounds entirely, and wiring the Pi ground to the audio in ground on the amp - none of which have succeeded.

I've seen this issue come up in a lot threads here, but haven't yet found a solution to my own problem by trawling through them. Any insights would be welcome!
 

Attachments

KeithWalker

Joined Jul 10, 2017
3,603
What are you using for the power supply and what kind of noise are you getting? All those long connecting wires will pick up any stray radiated EMI.
 

Thread Starter

_spaces

Joined Jun 21, 2024
9
What are you using for the power supply and what kind of noise are you getting? All those long connecting wires will pick up any stray radiated EMI.
It's a good quality bench power supply, brand new. The noise is electrical, clearly connected to the operation of the Pi - it peaks and troughs in time with the Pi boot up sequence. I'll try a set up with shorter cables!
 

KeithWalker

Joined Jul 10, 2017
3,603
That is quite normal during the boot-up sequence. Usually the amplifier is muted for a pre-determined period on power-up to avoid outputting the noise.
 

Thread Starter

_spaces

Joined Jun 21, 2024
9

Thread Starter

_spaces

Joined Jun 21, 2024
9
That is quite normal during the boot-up sequence. Usually the amplifier is muted for a pre-determined period on power-up to avoid outputting the noise.
Yes unfortunately it persist after boot up too, becoming just a constant high frequency tone that modulates as and when processes are running on the Pi, but are always very audible.
 

KeithWalker

Joined Jul 10, 2017
3,603
Yes unfortunately it persist after boot up too, becoming just a constant high frequency tone that modulates as and when processes are running on the Pi, but are always very audible.
[/QUOTE
What voltage are you using for the Pi and amplifier? How are you running them from the same power supply? The Pi needs 5VDC and the amplifier needs a minimum of 8 Volts. The Pi is very picky about what can be used to power it. I suggest that you use a recommended power source for the PI and a separate supply for the amplifier (8-26V 3A).
 

Thread Starter

_spaces

Joined Jun 21, 2024
9
I'm running 5.1v from the PSU. I need to power both from the same supply. I have experimented with a few setups - I've used a buck convertor to stepa 12v input for the amp down to 5v for the Pi, and this hasn't fixed the ground loop issue either. But I've also run the amp and the Pi on individual 5v PSUs and both ran fine without the noise, so I don't think it's an issue with voltage there.
 

BobTPH

Joined Jun 5, 2013
11,480
Something is wrong here. It is not a ground loop problem if it happens with a single supply.

I suspect one on the components is defective. Have you tried each independently and verified that they are working properly?
 

Thread Starter

_spaces

Joined Jun 21, 2024
9
Something is wrong here. It is not a ground loop problem if it happens with a single supply.

I suspect one on the components is defective. Have you tried each independently and verified that they are working properly?
I've tried a lot of different components trying to make it work - switching out cables, removing the switch, changing WAGO connectors, etc. But the fact that the exact same set up will work perfectly if I only substitute a different power supply to either the Pi or the amp (keeping the original PSU on the other device, so it's not that) does make it seem like it's not component failure to me.
 

nsaspook

Joined Aug 27, 2009
16,263
Something is wrong here. It is not a ground loop problem if it happens with a single supply.

I suspect one on the components is defective. Have you tried each independently and verified that they are working properly?
No. Happens all the time with perfectly good systems. The RPi is one hell of a digital noise generator that trashes a analog/digital ground connection. It's a very common problem with audio systems based on them.
https://lookmumnocomputer.discourse.group/t/raspberry-pi-power-noise/5302
 

BobTPH

Joined Jun 5, 2013
11,480
I don’t understand. So, if I scope the grounds at the Rpi and the amp I will see the noise signal? And if I scope the ground of the Rpi and the signal out I will not?
 

Beau Schwabe

Joined Nov 7, 2019
186
What happens if you temporarily remove the R and L input to the Amp? .. do you still get the noise? .. if NOT, then try some decoupling capacitors in series with the Left and Right inputs to the Amp ... say 1uF to 10uF "+" towards the Pi
 

nsaspook

Joined Aug 27, 2009
16,263
I don’t understand. So, if I scope the grounds at the Rpi and the amp I will see the noise signal? And if I scope the ground of the Rpi and the signal out I will not?
You're thinking circuit theory, think electrical field energy. Those RPi digital pulses use the ground wires a 'waveguide' for the energy surrounding the wires. The noise energy is absorbed in the input loads of the audio amp because the amp is part of a common energy 'circuit'. Total enclosed shielding of the RPi and shielding the amp will likely reduce the noise by providing an alternative path. The noise energy path is broken (impedance discontinuity, dielectric boundary condition, reflection) by galvanic isolators or simply eliminated by separate power supplies
 
Last edited:

nsaspook

Joined Aug 27, 2009
16,263
Which is why we use shielded cables to connect audio sources to amps.

My issue is with calling this a ground loop problem.
Sorry but It's perfectly valid to call it a ground loop problem if it can be solved by breaking the galvanic ground connection with a isolator (like old school audio line transformers using magnetic energy coupling) or seperate power supplies while unshielded. Really old school TELCO central offices had separate battery banks for switching and remote line power (for the old carbon mics) to reduce 'noise' loops on the ground/commons. When the call was still in the switching/dial mode you could hear the switching battery relay noises until it switched over to line batteries on call connection completion.
 

BobTPH

Joined Jun 5, 2013
11,480
We do not know that isolator solves it. You are assuming that. I think it is possible that modulated RF is either going through the signal line or picked up by the bare wires.l and demodulated in the amp to produce audio.
 

Thread Starter

_spaces

Joined Jun 21, 2024
9
We do not know that isolator solves it. You are assuming that. I think it is possible that modulated RF is either going through the signal line or picked up by the bare wires.l and demodulated in the amp to produce audio.
Wouldn't this mean that if you added a second PSU then the issue would still be present, potentially moreso because there'd be an extra source of potential noise added from the second PSU? In my set up the second PSU completely removes the noise, when everything else is left the same.
 
Top