@caltoa
The wire that causes buzzing, can you make the circuit lower impedance at that point ? Or add a capacitor to filter out frequencies above 20kHz.
Not really. It's right in the middle of my tone control circuit.
In your drawing you still use the digital pot with gain feedback over an opamp.
That opamp circuit still is influenced by the impedance/inductance/capacitance from the input. In other words : If you connect a phone output with long wires to the circuit, the opamp behaviour is influenced by the long wires.
That is what I was trying to say. It is not possible to calculate the behaviour of the opamp, since the signal source is not certain.
Wouldn't the same problem exist if I use the "normal" way?
Why don't you use the digital pot in a normal way ? With the signal on one side, the other side to ground, and the middle as output. With a fixed gain for the opamp.
Mostly because I wasn't aware of the normal way. I wanted to be sure the output was biased at half-supply, and the inverting configuration was the best I could come up with on my own.
By "normal way", I assume you mean something like Example 3 in this Maxim article? Audio Gain Control Using Digital Potentiometers | Analog Devices
The V_GND is the output of the opamp. You could add a RC filter.
I'm reading about 1mA output source current for the TL972. That is a low current, the resistor would be high. But the V_GND doesn't have to supply current. So perhaps 4k7 or 2k2 and 100nF (maybe an extra 22uF) to reduce noise.
Is that necessary when I'm already using a low noise op amp?
@bosleymusic
Clean layout is essential in audio applications, and separating digital from analog ground planes is a typical solution in production board design. Your mess of wires is probably not helping anything. Also, what is the actual op amp you are using? Is it optimized for single supply operation? Did you decouple the AC signal prior to biasing it to ensure your signal is really biased at 2.5 volts?
I am designing a board in CADSoft Eagle for this (current revision attached) and it does have separate Analog and Power/Digital grounds. The actual op amp on my board is what's listed in the schematic, TL972 (datasheet also attached).
I have an AC input capacitor, and have verified with the biasing voltages for the amps with my multimeter.
@pito
Not sure 470uF at 12V is enough. Also you have none larger capacitor at 5V. You have to use a separate regulator for the 5V audio section - mixing digital and analog at the same 5V rail is not a good idea.
For audio app I would add a simple RC filter at 5V regulators inputs (first one for the atmega, the second one for the op-amp) for example 50ohm/470uF.
Is a second regulator really going to make that much of a difference? The only thing being powered by the regulator are the ATmega328P, 2 digitpots, an LCD screen and 2 op amps. None of those are really high loads.I have a 100nF ceramic decoupling cap near each chip.
TL972 Rail-to-Rail Very Low Noise Operational Amplifier.pdf (1.19 MB)
Digital Amplifier.zip (1010 KB)