1
\$\begingroup\$

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 and to the ground direct from the PSU, with no change. 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.

enter image description here enter image description here

Edit: I'm also going to add a stereo 10k log potentiometer between the USB audio output and the amp, is there a use of the ground on that I should be thinking about?

\$\endgroup\$
6
  • 1
    \$\begingroup\$ Maybe try a common mode choke on the 3.5mm audio line first and see if that does something? \$\endgroup\$
    – Ste Kulov
    Commented Jun 21 at 18:35
  • \$\begingroup\$ Thanks, I'm trying not to add any components as this needs to be quite compact when finished, and since it runs perfectly when I use two seperate PSUs I figure there must be a grounding solution somewhere! \$\endgroup\$ Commented Jun 21 at 18:47
  • \$\begingroup\$ How is the noise if you connect the white wire (Pi GND) at the audio in GND of the amplifier? \$\endgroup\$
    – Jens
    Commented Jun 21 at 19:21
  • \$\begingroup\$ It’s not entirely clear from the picture how things are wired together. A schematic or even a block diagram would be helpful here. \$\endgroup\$ Commented Jun 22 at 3:04
  • \$\begingroup\$ @Jens unfortauntely no change in the noise when I run the Pi gnd into the audio in gnd on the amp. \$\endgroup\$ Commented Jun 22 at 12:42

1 Answer 1

0
\$\begingroup\$

For simplicity, I am assuming that the noise is all conducted and not electric or magnetic field coupled. This could not be 100% correct, but from your description of the symptoms, I think this is likely ok.

The way to think about this to figure it out is to visualize where the currents are flowing. To help with this, it is very helpful to draw out the circuit and not use the notion of ground but rather think of all wires to "Ground" as return wires. As you surely know, all current must return to their source. therefore the positive wire from the PSU or signal source is the signal, and the negative is the return. Once you have this view, it becomes easier to see what is going on with the circuit.

From this we can see that there is a noise source that is sending noise current through the amplifier. The noise source could be either the PI itself or the USB audio adapter.

If we assume the noise source is indeed the PI, we can see that the it draws current from the PSU and must return all of it back to the PSU via some return path. Ideally all the current will flow back to the PSU via the return wire which runs directly back to the PSU, but unfortunately this never happens. In reality you will always get some current flowing in all return paths back to the source. The amount of current in each branch mainly on impedance. At DC this is just resistance, but as frequency increases this translates into inductance.

The issue here is that a small noise current flowing through the amplifier will get amplified by the gain of the amplifer making the problem worse. In order improve this situation, you must bypass this return path as much as possible.

As you likely already know inductance is proportional to loop area, so the first thing to do is minimize loop areas in the paths where you want the current to flow (ie. between the PI and the PSU). To do this you should shorten the wires up as much as possible and keep the loop area small. In your setup the easiest way to do that might be to shorten and twist the power wires to the PI. This is not likely to solve the issue, but it may help alleviate some of the noise.

Next several other things could be attempted to increase the impedance of the return path of the Pi through the amplifier. Here are some ideas.

  • The PI itself may have poor decoupling, so adding some caps between power and ground near the IC generating the noise could be helpful

  • Try adding a bypass cap as shown in the diagram. Note that the value is not hugely important here but a low ESR cap larger than say 100nF would do fine. Ideally this would be a small surface mount ceramic cap.

  • You could try adding a low frequency ferrite on the USB or audio cable.

  • If could add galvanic isolation (transformer or optocouplers, but from you earlier post this would not be an attractive solution.

enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ Thanks so much Eric, this was all very helpful. I tried, and none of these suggestions fixed the issue, though it has given me the opportunity to cross some things off the list: for example, the noise is the same via both the USB headphones output as well as the native output on the Pi. There is no noise from the USB output if I go straight to headphones rather than to the amp, even if the amp is still powered and in the circuit...any thoughts? \$\endgroup\$ Commented Jul 5 at 15:44
  • \$\begingroup\$ If I understand what you said above, there is never any noise except with the amp connected and powered by a common supply. Is that correct? Did you try isolating the audio path using an audio transformer? This may not be a solution you want to entertain, but it will give you good information about what is going on. \$\endgroup\$ Commented Jul 8 at 2:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.