Pages: 1 [2] 3   Go Down
Author Topic: I think I've got a ground loop messing up my audio. Help!  (Read 4433 times)
0 Members and 1 Guest are viewing this topic.
Manchester, New Hampshire
Offline Offline
Edison Member
*
Karma: 4
Posts: 1363
Propmaker
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I only found one viable option for a 3.3mH inductor on Digikey.  That's this one here:
http://www.digikey.com/product-detail/en/AIUR-06-332K/AIUR-06-332K-ND/2343624

Most 3.3mH inductors were really expensive, like $4-$5.  That one is $0.44.  They've only got 930 of them though, that's not a large enough supply to ensure it would be available when I need it.

The 330uH inductors on the other hand are much more common.  I found this one for example:
http://www.digikey.com/product-detail/en/SDR1006-331KL/SDR1006-331KLCT-ND/2127215

A bit more expensive than the above, but still affordable.  Thousands in stock.  And the resistance is 3x lower than the other one.

So I guess using the larger capacitor with the smaller inductor would be the way to go.

[edit]

Actually, this one:
http://www.digikey.com/product-detail/en/AIAP-02-331-K/AIAP-02-331-K-ND/3059883

...can handle almost twice as much current, has half the resistance of the 330uH above, is half as expensive, and is a through-hole part making it easier to use for a patch job.  So I guess that's what I'll use if I have no other option than to add these things to all my LED modules.
« Last Edit: February 25, 2013, 04:12:48 am by scswift » Logged

Manchester, New Hampshire
Offline Offline
Edison Member
*
Karma: 4
Posts: 1363
Propmaker
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just noticed you said I could use a low value resistor instead of an inductor.  What exactly do you mean by low value?  1 ohm?  330 ohm?  I assume this has an effect on the frequencies that would be filtered?  I guess the idea is to create a low-pass filter?

It looks like the LED drivers can run at a minimum of 3V.  But I'm driving some white LEDs, so the minimum actually needs to be more like 4V.  And my power supply is typically 5V, but could be as low as 4.5V if running on 3 AA's.  So I guess to be on the safe side I would need to the voltage drop to be less than 0.5V.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This is the first time you mentioned using AA cells to power the lights. Please update your original diagram to include the light modules and the power to them. Also post a schematic of the light modules.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Manchester, New Hampshire
Offline Offline
Edison Member
*
Karma: 4
Posts: 1363
Propmaker
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is the first time you mentioned using AA cells to power the lights.

Oh, no that's not something I'm doing right now.  This board is designed to be used in lots of different props.  It has a built in 3W amp for small props.  In those props the board would be powered by AA's.  There's no noise issue when I run the board that way.  But I do need to make sure if I make any changes to the LED modules that they will still work when the board is powered from batteries.

Quote
Please update your original diagram to include the light modules and the power to them. Also post a schematic of the light modules.

Here's the schematic for those:
http://mightymicrocontroller.com/Mighty-TLC5947-schematic.png

These modules are connected to the LED port on the Mighty via ribbon cables of varying lengths.  They get both data and power over the ribbon cable, and multiple modules can be chained together.  In this particular prop, there are two modules.  The first is attached via a 6" ribbon cable, the second via an 8.5' ribbon cable.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

OK so if the LEDs are running from the same +5V source as the TLC5947s then you should increase the 10uF caps to more like 1000uF.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Manchester, New Hampshire
Offline Offline
Edison Member
*
Karma: 4
Posts: 1363
Propmaker
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I had someone else suggest on another site that I put several small caps on the amp's input instead of the LED modules.  So I had my friend try a 220uF cap that he had on hand, which worked quite well, though not perfectly, and oddly it worked even when only the negative lead attached.

I was wondering what you would suggest as far as capacitor sizes and numbers if you wanted to filter the noise at the amp?   Filtering at the amp's power supply is vastly preferable in my setup to modifying all the LED modules.
Logged

Manchester, New Hampshire
Offline Offline
Edison Member
*
Karma: 4
Posts: 1363
Propmaker
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So it turns out a ground loop was the problem after all. 

As soon as my friend plugged this thing in, all the buzzing went away:
http://www.amazon.com/gp/product/B002ZRQ3PW/ref=oh_details_o00_s01_i00?ie=UTF8&psc=1&tag=gbfans-20&camp=1789&creative=390957

All that is is a 1:1 transformer. 

I still have no idea why simply disconnecting the ground on the RCA cable didn't work if that works.

Btw, he'd also hooked up an iPod to the amp yesterday with the Mighty going but no RCA cable to it, and there was no noise.  That seems to confirm that the issue wasn't (purely) a voltage drop at the battery caused by the LED drivers.  It may be they are still injecting noise into the line of course but the amp is capable of filtering it without the ground loop there.  I don't know.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

No, the problem wasn't a ground loop (although you did have one), it was noise on the ground line to the microcontroller (and hence on the output to the amplifier) caused by the LED switching current. Inserting the transformer between the output and the amplifier means that it is of little consequence if the amplifier and microcontroller grounds are at different potentials.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Manchester, New Hampshire
Offline Offline
Edison Member
*
Karma: 4
Posts: 1363
Propmaker
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No, the problem wasn't a ground loop (although you did have one), it was noise on the ground line to the microcontroller (and hence on the output to the amplifier) caused by the LED switching current. Inserting the transformer between the output and the amplifier means that it is of little consequence if the amplifier and microcontroller grounds are at different potentials.

I understand that the design of my LED modules could be better.  I don't disagree with you that the noise is originating from them.  And I'm sure your suggestion would help mitigate the issue.  But the boards have already been made. I would have had to modify 300 PCBs to solve the problem your way, and the design of the boards, with surface mount parts on one side, and the pads for my through hole pins for power and data on the other, would not have made it an easy task to stick an inductor on there.  Also my customers are getting impatient.  They'd rather buy a ground loop isolator than wait another week for me to fix the boards.

I do appreciate the suggestions.  And I will have to order a new batch of boards in a couple months if these things continue to sell.  So I may redesign the boards at that point to include your suggested changes.  (Note to self: Add a 10K pulldown to prevent them from lighting up for a moment when I apply power, as well.) 

But I'm not sure I agree with you that the problem is the LED modules.

While it's true they generate the noise I'm hearing, the real problem is that I'm hearing that noise.  The noise itself would not be an issue if I couldn't hear it.  The noise doesn't affect the function of the board in any other way that I can tell.

And the fact of the matter is, that even if I got the LED modules to be whisper quiet, I'd still have noise problems.  My board is designed to drive servos as well.  Those generate 10x as much noise as the LED modules do.

So what makes more sense?  To redesign my audio circuit to have ground loop breaking circuitry, so that it doesn't matter if the amplifier and microcontroller grounds are at different potentials, or to stick capacitors all over the board to try and remove every possible source of noise from whatever might be attached to the board?  One solution might require a single tiny op-amp.  The other might require several large capacitors which may not fit within the 2x2" footprint I have to work with.  I was barely able to fit everything on the board as it was.


Quote
Inserting the transformer between the output and the amplifier means that it is of little consequence if the amplifier and microcontroller grounds are at different potentials.

Unfortunately, I still don't have a good picture in my head of what is going on here.  I get the idea of amplifier and microcontroller being at different potentials.  You can be standing on the ground at sea level, or on a mountain, and your feet won't be at the same height.  0V at the amp may not be the same as 0V at the microcontroller.  But I don't get how that leads to noise on the amp.  And I don't get how breaking the ground loop solves the problem.  I would think that the amp would measure the voltage of the positive line on the RCA cable relative to the negative line on the RCA cable and use that to determine the output at the speakers.  Since those would be both originating at the Mighty it shouldn't matter if 5V and 0V there are at a higher potential than the 5V and 0V on the amp.  But it seems that the amp instead assumes the two grounds are the same, and just connects its ground to the RCA ground.  That seems like a bad assumption to make to me.  I made that assumption in my design because I didn't know any better.  I just looked at 20 different schematics showing how to add a line out in an audio circuit, and implemented something similar after simulating the circuit to make sure it functioned as I expected.

Anyway, I'm just glad the issue is resolved now.  Now I just gotta resolve that damn bootloader issue again.  The fix that I thought worked only worked with one particular SD card.  Since I have no idea how the hell I would add a diode to my circuit with the card slot being surface mount and the pins being on the front where the card is inserted, and I really don't want to modify 200 boards, I've decided to try a different bootloader.  Hopefully it won't have the same issues.   (It should be noted that even puling up that pin I shouldn't did not correct the issue with the new cards, leading me to believe there may be a bug in the previous bootloader.)
Logged

Anchorage, AK
Offline Offline
Edison Member
*
Karma: 42
Posts: 1176
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
But it seems that the amp instead assumes the two grounds are the same, and just connects its ground to the RCA ground.  That seems like a bad assumption to make to me.
No, that's how it's done.  A common mantra around here is "tie ALL grounds together" because everything needs to know what +5v is in relation to (for example.)  Same goes for audio.  If you lift the ground of the RCA, you no longer have a circuit.  It's just a spurious input with no reference.

Now, in your case, the RCA shield and the PSU ground come from the same place -- your power supply.  So, it would in theory still work.  Also, in theory, you do have a ground loop between the amp and Mighty.  One path is from the RCA shield output on the Mighty to the amp input.  The other is from the Mighty to the PSU to the amp power input.  This is unavoidable, because if we assume the amp PSU ground is the same as the RCA shield ground, and don't tie them together at the amp, then what happens when you plug your amp in to a PSU, and feed audio from a battery-powered iPod instead of the Mighty?  There's no path from the iPod ground to the amp.

If all your grounds are firm and low-impedance, there will be little potential voltage difference between the audio and PSU grounds, so the loop "shouldn't" cause a problem.  What you're dealing with isn't necessarily a ground issue.  These things can be tricky.  I'm fighting a similar issue on a plate amp I built for a powered speaker with a microcontroller for inactivity power-off.  Very faint high-pitched "bzzzzzzzzzzzz".  Annoying.
Logged

Manchester, New Hampshire
Offline Offline
Edison Member
*
Karma: 4
Posts: 1363
Propmaker
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No, that's how it's done.  A common mantra around here is "tie ALL grounds together" because everything needs to know what +5v is in relation to (for example.)  Same goes for audio. 

If I had a multimeter and I touched one probe the the RCA - and the other to the RCA +, it would be able to read the voltage even though the multimeter's ground is not connected to the circuit.  I see no reason an amp should need to share ground over an audio input to determine the voltage difference. And TI does have a document showing various "ground loop break circuits" for both input and output.  And of course the transformer worked. 

So that may be how it's done, but I question why it's done that way.  Perhaps it has something to do with reducing interference?  Or maybe it's just a cost reduction measure, keeping things simple?  I don't know.  I do know professional audio equipment circumvents this issue and the interference issue by using a differential setup though.
Logged

Anchorage, AK
Offline Offline
Edison Member
*
Karma: 42
Posts: 1176
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Single-ended (ground + signal) inputs always require the ground to be connected.  You can't have a circuit with one wire -- that defies the definition of a "circuit."  There has to be a return path.  It may not be immediately obvious -- like, with your setup, the amp's ground lead is derived from the same source as the audio ground.  It can also be floating, like you achieved with the isolation transformer.  That's the same result you'll get with another AC-powered device that has a separate PSU from your amp, or a battery-powered device.  But with either isolated device, if you don't connect the RCA shield, you'll lose the return path and get nothing (but maybe noise) on the input.

Differential inputs work a little differently, in that the potential measurement is between the hot and cold.  They reference each other.  The "ground" is only there as a shield, and thus, can be lifted on one side to receive RF noise and shunt it to ground.  (Acting like an antenna, as someone pointed out earlier.)

In your multimeter example, you're grounding the negative probe.  Try measuring the voltage at the RCA output with just the red probe, leaving the black probe lying about on your workbench.  That's what you get in your circuit if you don't ground the RCA terminal.  So, that's why it's always done that way.  :-)
Logged

Manchester, New Hampshire
Offline Offline
Edison Member
*
Karma: 4
Posts: 1363
Propmaker
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In your multimeter example, you're grounding the negative probe.  Try measuring the voltage at the RCA output with just the red probe, leaving the black probe lying about on your workbench.  That's what you get in your circuit if you don't ground the RCA terminal.  So, that's why it's always done that way.  :-)


That's not what I get in my circuit if I don't ground the RCA terminal.

If my amp and my microcontroller are both connected to the negative terminal of my battery, and in my circuit, they are, then in theory, ground should be the same on both devices, and I should not need another ground wire in the RCA cable to perform a measurement on it.

If the amp and microcontroller are NOT connected to the same battery, then of course there is no shared ground, and a single wire for the audio connection is insufficient, and mimics your example.

Now going back to my first example, note that I said "in theory".  Obviously the reality is that the microcontroller's ground is at a different potential level than the amp.  But why should that mean we can't make a measurement of the input without having a ground loop?

A multimeter measures potential difference.  So in theory, if I touch my black probe to one wire with 1V, and my red probe to another with 5V, I should read 4V.  Note that neither of those is ground.  Yet I can still measure the difference between them.  And that difference is what matters.  The magnitude of that difference tells me enough to know where to position my speaker cone.  That's how differential inputs work.

My problem seems to have been caused by my grounds being a different potentials on my two devices, so current flowed from one to the other and carried noise along with it.  But if the amp only measured the potential difference between the + and - input, it wouldn't matter if the - input was at a different potential than it's ground.  All that would matter is that it is at the right potential level RELATIVE to the + input... just as with a differential input where + and - swap places.
Logged

Manchester, New Hampshire
Offline Offline
Edison Member
*
Karma: 4
Posts: 1363
Propmaker
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried something new with the circuit today because I have an amp to test with again.  I placed ceramic capacitors on both + and - RCA lines.  But this did nothing to help with the noise.

The thing is, I don't understand why it didn't help.  I've been told this is a way to break a ground loop.  And it certainly should block any DC current from flowing, just as the transformer in a ground loop isolator does.  So why didn't it help with the noise like the transformer did?

A transformer is really just a couple inductors, right?  So might the inductance be doing something to filter the noise?  I'm not sure how this could be, since the noise is smack dab in the middle of the audio range and filtering out those frequencies would filter out audio frequencies as well I'd imagine and affect the sound of the output.  But I have not noticed any change in the audio with the isolator in place.

I intend to add some more filtering to my LED modules when I do a second run of them, but I would really like to be able to emulate what this transformer is doing without using a huge transformer on my board when I redesign it, in case my changes to the LED modules are inadequate.
Logged

Anchorage, AK
Offline Offline
Edison Member
*
Karma: 42
Posts: 1176
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I missed your last reply, so let me back the conversation up a couple days first.

I think you might be assuming "Ground" is somehow special.  It isn't, it's just a reference point.  You can probe any two points in a circuit with a multimeter and get a measurement.  Ground isn't any different in this regard, it's just that normally ground is the reference on which everything else is based.  So, when you say something is "+5v", that's 5v above ground.  Ground is only 0v because you're comparing it to itself, so the difference should very well be 0v.

Differential is a special case because it doesn't reference ground, it references another signal line.  Electrically, it's still a measurement between two points, it's just that neither of those points are (necessarily) ground.  Single-ended inputs imply that the reference is ground, and requires the system and input grounds to be tied together.

Again, in your case, the amp system and input grounds are tied together in two places:  The PSU and the RCA input jacks.  So you have a loop.  It doesn't mean there's any appreciable current flowing through that loop, it just means there is one.  That's not a problem in and of itself, and not something to be "fixed".  The problem is when there's a difference in potential between those two ground points.  The best way to fix that is to ensure the two ground points have low impedance paths back to the PSU ground.  (Easier said than done sometimes.)

If you take away the RCA shield, you're causing the amp to reference the PSU ground as the audio ground (since they're connected internally anyway).  The audio signal will then be referenced against a ground that is not at the exact same potential as the device creating the output (the Mighty), so there will be noise which is the difference between ground as the Mighty sees it and the (PSU) ground as the amp sees it.  Using a signal ground (RCA shield) will attempt to force them (the grounds) to the same potential, at the risk of causing current to flow down the path of least resistance, which may alternate as the load changes.

Ceramic caps across the input will shunt noise, but it will do so as a high-pass filter with a high cutoff frequency.  Typically, you would use, say, a 30pF cap.  This dumps RF noise straight to ground, but noise throughout (and even well above) the audio band will not be affected.  It can still be helpful if the audible noise is a lower harmonic, but that's a long shot.

The transformers help probably (not 100% sure -- comments welcomed) because the path through it becomes high impedance.  Noise is going to take the easiest path to the point of lower potential (Ground again), which will probably be elsewhere.
Logged

Pages: 1 [2] 3   Go Up
Jump to: