Electronic – How to control op amp gain with atmega 32 MCU

atmegagainoperational-amplifier

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 ??

Best Answer

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.