Digital potentiometer for volume control

Tengil

Member
2019-11-05 9:24 am
Hi all, I've just joined this forum!

I am building a guitar/bass pedal and would like to incorporate a digital potentiometer for the volume control controlled by an Arduino. Therefore I bought the MCP41100. I hooked up the signal to the wipers as one would hook up a mechanical potentiometer (like this) and it does work.
The volume can be controlled by the digital pot BUT there is a small hiss or noise introduced to the sound. Using a capacitor removes the noise but also the high frequencies which is unwanted.

I have considered having the digital potentiometer control an op-amp but it will only control its gain which would be > 1 so that's not really an option (did I get this correct?).

Any ideas on how I can solve this? Am I using the correct digital pot? Can I have the pot control some other circuit to control the volume?

Thanks!
 
Since no one else has answered I'll venture a guess. I think your signal is quite small, compared to the max signal the digital pot can handle. Hence the audible hiss. Perhaps boost the signal going into the pot, then attenuate it by the same amount afterwards.

It's just a guess and I'm assuming you're wiring direct from the guitar/bass into this digital pot. As always, if you can share the circuit schematic the engineering types here will have a better chance at understanding what you're doing electrically - then, a better chance at a good answer for ya!
 

rayma

Member
2011-04-29 8:37 pm
You can have a feedback digital volume control in a circuit with gain below unity,
to near zero gain in fact. Just connect the op amp in the inverting mode.
How much gain do you want? Add a series input resistor to limit the maximum gain.
 

Attachments

  • LED-switching (1).png
    LED-switching (1).png
    11.7 KB · Views: 400
Last edited:

PRR

Member
Paid Member
2003-06-12 7:04 pm
Maine USA
www.diyaudio.com
The problem with the fully-variable gain plan proposed, in a *guitar* pedal, is the input impedance can go very low (steals all the highs of a guitar) or very high (raising hiss voltage).

The other thing is: audio swings both ways. These digi-pots don't like any pin swung below zero. Some will do "OK" to a half-Volt, and for small guitar this may be "enough". We would usually use them biased-up halfway on a 5V or 9V supply, with cap coupling in and out. They do not directly replace a plain pot in audio applications.
 

Tengil

Member
2019-11-05 9:24 am
Perhaps boost the signal going into the pot, then attenuate it by the same amount afterwards.

For the boosting, would you suggest using an op-amp, say the lm368? So would that be:
op-amp (boost) digi-pot (volume control) -> resistor (attenuation) -> output?

It's just a guess and I'm assuming you're wiring direct from the guitar/bass into this digital pot.

Yes that's exactly what I've been doing, sorry for not being clear with that.
 
After further investigation I found the source to the niose. Turned out to be zipper noise from the digi pot changing resistance value. Not sure how to get rid of it though.

To remove zipper noise volume changes have to happen when the volume is near zero volts. The PGA series has a zero-cross pin that automates this. Other chips require an external zero cross detector that can impede volume changes.
 
After further investigation I found the source to the niose. Turned out to be zipper noise from the digi pot changing resistance value. Not sure how to get rid of it though.

Russ C offered excellent advice. Use a chip intended for audio. The PGA2311 is very good at its job
of controlling audio levels. It does 95 dB of attenuation and can go up to +31 dB gain if you need
it. They never make odd noises. A suggestion regardless of what chip you end up with. Only send
data to it when it's needed which will minimize noise. Ardiunos are dandy for this task.

 

Tengil

Member
2019-11-05 9:24 am
Russ C offered excellent advice. Use a chip intended for audio. The PGA2311 is very good at its job
of controlling audio levels.

This one does look promising. However, there is a delay up to 16 ms before switching volume to eliminate the noise. In my application this would be too long.

I have looked into using the digi pot to control a photo-resistor which I have seen people do but I have yet to find a photo-resistor with a decay time and rise time fast enough.
 
we may look at the DS1882 digital potentiometer (doesn't have any opamps inside, just a analog signal potentiometer which is controlled digitally via i2c). it needs to be connected to a very high input impedance stage (may be a buffer - discreet/opamp). and also takes care of zero crossing issue and also needs dual supply upto +/-7v.
 
This one does look promising. However, there is a delay up to 16 ms before switching volume to eliminate the noise. .

This is only in the absence of a zero crossing. With normal signal, zero crossings happen all the time and switching is near-delay-less. Only when there is no zero crossing the device waits 16ms and then switches anyway. So it is more a safeguard to allow switching in the absence of signal than a normal operation. And if it switches in the absence of signal there is no noise anyway.

Jan
 
Last edited:
we may look at the DS1882 digital potentiometer (doesn't have any opamps inside, just a analog signal potentiometer which is controlled digitally via i2c). it needs to be connected to a very high input impedance stage (may be a buffer - discreet/opamp). and also takes care of zero crossing issue and also needs dual supply upto +/-7v.


With zero crossing enabled the DS1882 allows itself a 50ms window to change resistance, which would not meet the OP's requirement.
 
With zero crossing enabled the DS1882 allows itself a 50ms window to change resistance, which would not meet the OP's requirement.

This is only in the absence of a zero crossing. With normal signal, zero crossings happen all the time and switching is near-delay-less. Only when there is no zero crossing the device waits 50ms and then switches anyway. So it is more a safeguard to allow switching in the absence of signal than a normal operation. And if it switches in the absence of signal there is no noise anyway.

Jan