We’ve seen a few LM386-based amplifiers over the years including one that fits inside a 9V battery, but this is the first implementation of digitally controlled volume we’ve seen. The volume control of this amp uses the DS1868 dual digital pot IC in place of the usual 10K pot providing 256 steps between zero and full volume. The DS1868 is controlled by a PIC μC with a 3-wire serial connection, although this could be implemented on any microcontroller.

Although the code provided with this build outputs volume as a linear function, it would be trivial to implement a logarithmic volume output. Because the ear perceives loudness on a logarithmic scale, this would be a great way to adjust audio volume and provide a more fine-grained control. Of course this could be implemented with a logarithmic pot, but where’s the fun in that?

[jefffolly] published some straight forward plans for a passive volume control. It uses a resistive ladder built across the contacts of 12W rotary switches. Each resistor provides a 5dB difference, and he recommends using 0.1% tolerance resistors to maintain accuracy. The use of discrete resistors instead of volume pots means that the output is much more predictable. All of the RCA sockets were connected using oxygen-free copper wire.