I know this is an old thread, but I'm in the process of redesigning this board now, and I have a question about something DC42 said a few posts back:
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.
While I don't entirely understand how this setup is supposed to work, it sounds plausible, and it's the simplest and cheapest solution I've found, so I guess I'll have to try it out.
But one thing bothers me.
If this is caused by noise from the LEDs, why does it all work fine when the amplifier has its own power source?
Also, I did some tests today with one of the kits. Here are the results. In all tests, the amplifier is being powered from the same power source as the kit.
- Audio cable directly to amplifier - Loud screeching over audio which is much quieter than normal.
- Audio cable to amp via ground loop isolator - Normal audio, with hardly any LED noise.
- Audio cable with only + line connected - Same as #1.
- Audio cable with only + line connected w/ ground loop isolator - Same as #1
- Audio cable with only - line connected to + output terminal - No audio, as expected.
I tried #3 because the amplifier shares a ground with the board, and connecting only the + pin should break any ground loop. Yet the result was the same. That indicates to me that the issue isn't actually a ground loop.
And DC42 did say:
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.
Which seems to make sense. If the microcontroller's ground is at say, -2.5V relative to the amplifier's ground, and it's 5V rail is at 2.5V relative to the amplifier's ground, then that's still a 5V difference between its ground and 5V rail. So I can see how that would be carried across the transformer coil, since the secondary's ground is referenced to the amplifier.
I'm still having trouble grasping what his voltage divider solution does though.
Hm.. if the divider normally drops 5V to 1V... but the 5V relative to the amplifier is 2.5V... and the ground of the amplifier is at 0V relative to itself... then wouldn't the voltage divider change 5V to 0.5V, from the amplifier's point of view?
Still, if the board is at a potential 2.5V below the amplifier, that would make 1V into -1.5V.
And I just tested it with my multimeter... got a weird result too.
I disconnected the audio connector from the board, leaving it connected directly to the amp. No isolator. I then touched the negative prove to the negative side of the audio connector, and the positive probe to the ground side of my audio output.
The meter read 0.33V when reading volts, and when reading millivolts it fluctuated between 0.25V to 0.35V.
So the microcontroller's ground appears to be at a HIGHER potential than the amplifier. I'd expected the ground would be lower. I don't know why I expected that, but I figured that's what high current draw from the LEDs would do to it. I guess it's somehow pulling it up though? Or maybe the amplifier's higher current draw is pulling it down?
Either way, there's around a third of a volt difference in ground potential between the two devices, and the ground of the microcontroller does seem to be varying. Unless that's the amp. Perhaps I should have tried to measure the two relative to the power input jack as well.
Anyway, I'm not sure what to make of this. If the ground of the microcontroller is 0.3V higher than the amp, and its 5V rail is as well, and the voltage divider reduces 5V to 1V relative to the microcontroller ground, then that 1V would be 1.3V by the amplifier's reckoning.
I'm not sure if that means it should be louder though. The volume of an audio signal is determined by how much it varies, not the DC offset. And it should still vary just as much. So why does it end up being quieter?
None of this makes sense.