Rotary noise with digital gain


I’ve made an analog circuit that amplifies an electret microphone.
It works OK. See mic_amp.png

Then I replaced the VR Gain resistor with
Rotary encoder → Arduino → X9C104 digital potentiometer.
See mic_amp_dig_gain.png

This works but whenever I rotate the encoder I hear a lous pop in the analog
audio signal.

Is it possible to prevent this?

Thanks in advance!


I don't know, but make sure you are compliant with the timing diagrams on the datasheet. i.e. Make sure chip select and up/down are stable before incrementing.

And, you might want to slow things down a lot, put some LEDs on the control lines so you can see what's happening, and maybe you can figure-out which control line is causing the noise.

It's also a bit "unusual" to put the pot in the feedback loop. You can do it and it "looks good on paper", but in the real world sometimes there are problems... That might make it more sensitive to pot-noise, and if it happens to go open for a microsecond or so while switching, the op-amp will go into infinite-gain mode and you'll get some nasty noise. I don't think the digital pot should go open, but if it did bad things would happen.

P.S. Try connecting pin 3 to pin6 on the digital pot. When using a pot as a variable resistor it's "traditional" to connect the unused terminal to the wiper. (This will prevent it from ever "accidentally" going completely open, at least it will with a mechanical pot.) That might not help, but it won't hurt anything either.

Hi, sure you solve this problem right now, but if you place a resistor in series with RL or RW will define a minimum gain and solve the infinite gain problem.