I think I've got a ground loop messing up my audio. Help!

You have a large pulsed current flowing from the battery to the LED boards, via the microcontroller board. Because of the resistance and inductance of the power supply lines, this means that the ground on the microcontroller board carries a small pulsed voltage relative to the battery negative terminal.

I don't understand. Is it because the ground plane and wires act kind of like a capacitor as power flows in and the battery is unable to discharge them back to 0V quickly enough that the ground potential of the board fluctuates as the LED modules draw power? Is that why you suggested I use larger wires? Because with less resistance the battery will be able to pull the ground plane back down to 0V (relative to the battery ground) more quickly?

The transformer fixes the problem because you feed the difference between line output and microprocessor ground to the primary (thereby cancelling out that small pulsed voltage) and this gets reflected at the secondary.

Makes sense.

So am I right in assuming that the reason putting a cap in series with the RCA's ground pin didn't work, was because the fluctuations on the ground were AC in nature, and could pass right through the cap?

  1. You really should provide adequate power supply bypassing on the LED boards. Without this, your boards may also generate RFI. I think you need at least 1000uF between +5V (the positive supply to the LEDs) and the ground pin of the TLC5947. 2200uF or 4700uF would be better. An inductor in series with the incoming +5V on the LED board (as discussed earlier) would be the next step.

I will, when I have a new batch of boards made.

  1. Include a small PCB-mounting audio isolation transformer on the microcontroller board.

Not gonna happen.

  1. The boards need to be really small. I'd never be able to fit a transformer on there and still fit the board where it needs to go. (Handheld costume props.)

  2. All audio transformers filter out some frequencies, but most I've looked at don't provide data on what frequencies they're good for, and I don't know how to calculate that.

  3. They tend to be fairly expensive and many aren't stocked in large quantities on Digikey.

  4. I don't want to stick this big ugly thing on my beautiful surface mount board:

That's one of the cheaper ones available in large quantiies, and one of the few that actually provides data on the frequencies it handles but it's still too big, and ugly, and it only handles down to 100hz which means I'd lose all the bass in my audio, so that's no good.

As a last resort I could make my own ground loop isolator cables with a custom PCB and heat shrink the thing. That wouldn't be too bad but still, a costly solution, labor intensive, and I'd lose frequencies I want to keep.

  1. In the diagram in your original post, you have a ground connection to R11, R12 and JP7. If you choose not to include a transformer, then make provision on your board to separate this ground from the main ground on the board, with a jumper connecting them together. When using a common supply, remove the jumper. This way, the voltage divider will be referenced to the amplifier input ground instead of the microcontroller ground, so at the same time as reducing the signal voltage, the divider will reduce the noise voltage passed to the amplifier. Removing the jumper will eliminate the ground loop too.

This sounds like an excellent solution and is something I may be able to try out with a little surgery on one of my boards.

I wish I didn't need to use a jumper to do it... Don't really have room for a switc. Perhaps I could just require the user to tie the board and amp grounds together at the power input if they choose to run them on separate power sources? 95% of them will choose to run them off the same battery, so if I could get away without adding a jumper to the board that would be nice.

  1. Use thick wires between the microcontroller board and the battery (to reduce resistance), and ensure the power and ground conductors are in the same cable, or twisted around each other (to minimize the area they enclose and thereby minimize the inductance).

I'll make that suggestion to my customers, but I have no control over what they do there. The first guy I gave a board to connected the amp up with like 28 AWG wire.

Thanks for all the suggestions. I think I have a little better understanding of what's going on now at least and I can try out tying those grounds together on the line out and see how that works. If that works that will be perfect.