Solving Grounding Issues On Switch Audio

Grounding of electrical systems is an often forgotten yet important design consideration. Issues with proper grounding can be complicated, confusing, and downright frustrating to solve. So much so that engineers can spend their entire careers specializing in grounding and bonding. [Bsilvereagle] was running into just this sort of frustrating problem while attempting to send audio from a Nintendo Switch into a PC, and documented some of the ways he attempted to fix a common problem known as a ground loop.

Ground loops occur when there are multiple paths to ground, especially in wires carrying signals. The low impedance path creates oscillations and ringing which is especially problematic for audio. When sending the Switch audio into a computer a loop like this formed. [Bsilvereagle] set about solving the issue using an isolating transformer. It took a few revisions, but eventually they settled on a circuit which improved sound quality tremendously. With that out of the way, the task of mixing the Switch audio with sources from other devices could finally proceed unimpeded.

As an investigation into a nuisance problem, this project goes into quite a bit of depth about ground loops and carrying signals over various transforming devices. It’s a great read if you’ve ever been stumped by a mysterious noise in a project. If you’ve never heard of a ground loop before, take a look at this guide to we featured a few years ago.

32 thoughts on “Solving Grounding Issues On Switch Audio

    1. 180 degree phase offset is exactly the same as -180 degree phase offset. It is perfectly normal for graphs to wrap around at that point, though smart software adjusts the range to make the graph continuous.

    1. “Ground loops occur when there are multiple paths to ground, especially in wires carrying signals. ”

      Ground loops occur when there are multiple paths from the SAME POINT to ground, That creates a complete path (“loop”) that can conduct current, and that current induces noise into the audio path.

      “The low impedance path creates oscillations and ringing which is especially problematic for audio. ”

      Not quite right. As above, noise comes from the current (induced by eg AC fields or potential differences) that flows in a ground loop. I’ve never encountered oscillation or ringing in an audio-related ground loop. RF circuits are a different matter.

      Transformers are usually very effective at isolation and breaking ground loops, but audio transformers good enough for professional or hi-fi applications can cost $20 and up each. So they are the fix of last resort.

      1. I have no idea how this comment ended up in response to the comment about optoisolators. But since we’re here… optocouplers can’t be used in analog signal paths.

        1. Actually optoisolators can do very well indeed in analog signals. Not at all like the above comment implies, of course, but a pair (or four) in the feedback loop of an opamp works very well up to many kHz. Driven within reason they are intrinsically linear, and the feedback loop takes out the remaining woogles.

          And of course there’s TOSLINK, which is sort of a digital cheat but *is* optical isolation, and can stand off a few megavolts and still provide two channels with 20 kHz bandwidth.

          1. Digital ain’t analog so TOSlink doesn’t qualify.

            What optocoupler would you recommend that’s sufficiently linear and wide-band for hifi audio? I assume you aren’t referring to LDRs (light-dependent resistors).

          2. I have a couple of Radio Shack RCA ones. One did great and still works well today. As a renter I was often faced with poorly or improperly wired residences that further complicated issues. Add my own built idiotic noise makers and such and it taught me a lot about that annoying hum. Then if you add midi and some builders and companies tossing the optocoupling and that added another layer to contend with. I had always thought that part of the midi standard had been fairly brilliant. When folks treat it as a dumb serial port on audio equipment going to gpios etc there can be a relapse of history.

          3. Thanks Paul, but that’s a telephone-grade device… hardly hifi. At its best:

            ‘Use photovoltaic mode where up to 40KHz
            bandwidth is required and linearity comparable to a
            13-to-14 bit D/A converter with ±1 LSB linearity error
            (0.01%) is acceptable.”

        2. Along with the IXYS LOC series, there’s also the classic HCNR200, now a Broadcom product. It will do about 1 MHz and was used in isolated scope applications such as the Tektronix THS700 series. That’s about as analog as it gets.

  1. Ideal ground in electronic must be in 1 point. You even saw it in old tube type audio. Also in some cars.
    1st time I read it in my dad’s book from 1965. Then I learned more about the groud point when I got my fisrt oscilloscope.

  2. Re-reading the posted article, the best fix would be to re-wire the headphones so that the mic signal path and the headphone path are completely separate, with no shared ground. Then the only ground-loop isolation required (if necessary) would be between the Switch line out and the headphone amp’s line in.

  3. Ground loops gave me problems in my steel slide self-sustaining guitar between the Digitech processor and the amp caused by the switching reg in the Digitech, whine in the background. After trying many ways of hooking it up I decided that transformers would be the way. No whine now. This instrument is battery powered and self contained. A total of 3 transformers are in it. One at the input to the processor and 2 more on the output when I feed a board.

    Today I have to travel to the next state over and put some of those car stereo transformers into a organ and amps in a church. We normally go direct and have no noise issues but this time hum went rampant. I hope this is the fix.

    1. My approach to system noise issues is to start with the minimum connected, then add sources one at a time. For example, have nothing but amplifier connected to speakers… and that should be near dead quiet, no hum, buzz or hiss, regardless of control settings. Any issue at ths point is the amp, or how the amp is grounded. Then connect the mixer (if there is one), then connect sources one at a time to the mixer. It usually turns out that connecting one specific source causes issues, so then it’s down to determining why connecting that device causes problems. And maybe you will find a connection or cable problem… and worst case you have your transformers if there’s no other simple fix.

      Good luck.

  4. It’s getting close to time to start thinking about retiring consumer analog headphones. We should be looking at putting a second USB-C port where the jack is, car stereos should act like usb soubdcards, etc.

    If someone does want analog, they’re probably an audiophile and want to choose their own amp and DAC anyway.

    Very slim included inline dongles can bridge the
    gap with legacy stuff. I think the tech is ready to move on without too much trouble.

    1. It’s definitely nowhere near that time yet, I know phones have gotten rid of audio jack’s but look how many people complained about that. Too many devices are still in use that use normal analogue headphones, most PCs still do, a lot of laptops do, etc, and it makes it very easy to connect in other devices like speakers or to split the signal. I can’t see it being very easy to split a USBC audio signal, since USB is supposed to be between two devices and not split. You could use a USB hub but then the devices probably will show up as separate audio outputs on your device so you’ll need some extra software to output to all of them at the same time. I also think USBC is probably weaker than a 3.5mm plug, and since cables tend to be pulled and yanked etc, then it maybe better staying with 3.5mm. Theres also nothing wrong with 3.5mm analogue, and I can’t see any advantages to using USBC, especially since you usually want a separate audio output anyway. So why would you change it if it has more disadvantages than advantages?

  5. I sure would like to know a source for those Kript HiFi transformers inside the enclosure. They would work well in a device I designed awhile back. I had pins pulling out of the brand I use under vibration before adding mitigation.

  6. Another technique is a ground-cancelling output. The ground contact on the output connector is floated. The voltage on the ground contact is sensed and added to the signal fed to the hot contact.

    Usually this is less expensive than a transformer, has better phase and frequency response, and less distortion. Noise rejection without trimming may not be as good, and there are limits to the rejected voltage and radio frequency rejection.

Leave a Reply to Daniel DunnCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.