I am attempting to control the gain of an amplifier circuit I am building programmatically. I am using the atmega 32 MCU to control an LCD screen and take input from some buttons. Basically, I would like to include a volume up and down button that tell the MCU to change the amplifier gain.

The amplifier circuit is shown below and the 10k pot is circled in red: amp crkit

I have thought of using a transistor to do PWM control in place of the 10k pot, but I was advised that this would not work and that I should use a resistor bank instead or perhaps a switch capacitor circuit.

Can anyone point me in the right direction, and is there any reason why I wouldnt be able to replace the potentiometer with a digital pot like this one: https://www.sparkfun.com/products/10613 ??

  • \$\begingroup\$ Why not use an amp that has digital gain control in the first place? \$\endgroup\$ Feb 23, 2015 at 1:23
  • \$\begingroup\$ why not use a digital resistor? usually they are I2C devices, with at least 256 steps, sometimes more if you pay for it. Can be linear or logarithmic. \$\endgroup\$
    – KyranF
    Feb 23, 2015 at 2:37
  • \$\begingroup\$ What exactly is the nature of the signal you're going to amplify? \$\endgroup\$
    – Matt Young
    Feb 23, 2015 at 3:44

2 Answers 2


I've used those exact pots. The datasheet is not kidding about the wiper current; don't exceed it at min/max and you should be fine.

  • 2
    \$\begingroup\$ Another thing to be careful about, you aren't supposed to have voltage going through the device that is outside the supply rails, so if your audio signal is zero-centered you need to offset it before the digital pot chip. \$\endgroup\$
    – Austin
    Feb 23, 2015 at 1:25

None of the pot terminals can go below Vss. If your input doesn't go below ground you should be OK. That and the current restrictions are the factors I usually have issues with

  • \$\begingroup\$ Wow, okay, so what is the simplest way to insure that my input will be in the 0-5v input range since the pot apparently cannot handle negative input voltage? The input I have is your typical mp3 player headphone signal. \$\endgroup\$ Feb 23, 2015 at 1:58
  • \$\begingroup\$ Add an offset and another amp stage \$\endgroup\$ Feb 23, 2015 at 11:45

Your Answer

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

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