0
\$\begingroup\$

I am building an A/V switch that I would like to have a headphone output with adjustable volume, controlled by a microcontroller. As a test, I connected an audio source to a potentiometer (input to a, wiper to headphones, ground to b) and had clean sound at whatever volume I adjusted it to. Now I'd like to do the same thing with a digital potentiometer and I'm running into weird audio distortion.

If I set up using the STYLE 1 diagram, the audio comes out just fine at max volume but 'crackly' at anything below that. On a whim, I tried adding some series capacitors as seen in STYLE 2, and this makes the problem go away at certain low volumes but certain middling volumes have the same crackly sound.

While I tested this, ARI and ALI were connected to the audio output of a nintendo 64, and ARO and ARI were connected to either my tiny audio-technica earbuds or a taotronix soundbar.

Is there a name for the problem I'm running into, and how do I avoid it?enter image description here

\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

Unfortunately, digital pots are not quite as 'design friendly' as their analogue counterparts.

The audio input voltages are AC, i.e. they alternate between + and - voltages. The voltages on the 3 digital potentiometer pins must fall within the Vdd-Vss range (in your case +5V and 0V). So the 'crackling sound' is probably due to the circuit only passing the +ve half of your audio sig. The fact that it works ok at full volume might be related to the architecture of the MCP4631.Just be aware that you may have damaged the MCP4631 due to operating outside of limits.In style 2, the same problem exists.

In short, a working cct requires additional complexity. You might consider something like the circuit as follows. Digital Potentiometer Volume control circuit

In this circuit, the four resistors form two voltage dividers. Each voltage divider can be considered as a 2.5V source acting through a single resistor (this is called Thevenins theorum). The R3,R4 divider is the quivalent of 2.5V in series with a 500ohm R. The R1,R2 divider is the equivalent of 2.5V in series with an 11k R. This makes it easier to see most of the AC input will appear across R5.

The Voltage at the pot wiper will be the audio superimposed on 2.5V DC so C2 is required to remove the DC for output to your phones. It is likely the phones will provide load that is too high for the pot so U1 is strongly recommended.

\$\endgroup\$
2
  • \$\begingroup\$ I think you'll need a 10uF (or perhaps more, select on test) capacitor across R4, to make the R3/R4 junction an AC Ground. (then R3 and R5 could be higher values and waste less power) \$\endgroup\$ May 26, 2020 at 3:58
  • \$\begingroup\$ If current draw from the headphones is a concern to the trimpot, then surely it's a concern for selecting the op-amp as well? I would guess that different headphones provide different loads, so what current would I be trying to account for? \$\endgroup\$ May 26, 2020 at 4:24
1
\$\begingroup\$

I think your problem is that the audio signal needs to stay within the power supply voltage of the digital potentiometer(0-5V). Usually audio signals are centered around zero so when the signal goes negative, the potentiometer will clamp the voltage which messes with the audio. To fix this you would need to add a DC bias so that the signal stays within the 0-5V range.

Also these potentiometers aren't rated for high current so you might kill them in an audio application. The datasheet says a max current of 2.5mA through the wiper terminal

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.