Summary of LM386 based stereo audio amplifier with digital volume control
This article describes a stereo audio amplifier project using two LM386 ICs and digital volume control. It replaces traditional potentiometers with a Maxim DS1868 dual digital potentiometer chip, managed by a PIC microcontroller via a 3-wire serial interface. The system supports both left and right channels, allowing precise volume adjustment through 256 positions per channel without mechanical components.Parts used in the Stereo Audio Amplifier:
- LM386 IC (x2)
- MAXIM DS1868 dual digital potentiometer chip
- PIC microcontroller
- 10K potentiometer (replaced by digital version)
- +9V PP3 battery
- Output speakers (Left and Right)
- External components for mono amplifier circuit
Due to its simplicity (requires minimum external components) and high availability, LM386 is very popular among hobbyists for use in low-voltage audio amplification applications. Most of the time a potentiometer is used at the input side of LM386 to provide a volume control in the output speaker. The potentiometer does not control the gain of the amplifier itself, but it creates a voltage divider network at the input, which in fact controls the fraction of the audio signal that is fed to the amplifier. This project is about a stereo audio amplifier using two LM386 ICs with digital volume control for both left and right speakers. So, how would you control the volume digitally? You are right, by replacing the traditional electro-mechanical form of potentiometers with digital potentiometer chips. This project uses MAXIM’s DS1868 dual digital potentiometer chip and a PIC microcontroller to control the volume of a stereo output from two LM386 ICs.

Theory
Tons of resources can be found on the internet about LM386 and so I am not going to describe it in detail here. The LM386 IC has got 8 pins which require very few external components to work as a mono amplifier. The circuit below is taken from the datasheet and shows the external components required for constructing a mono-channel audio amplifier with LM386. An external 10K potentiometer at the input is used to control the volume of the output speaker. For a stereo audio amplifier, we need two of this circuit.

The supply voltage range for LM386 is wide (4-18 V). It can be powered with a +9V PP3 battery. For digital volume control feature, we will replace the external 10K potentiometer at the input stage with a digital potentiometer chip. MAXIM’s DS1868 is a dual digital potentiometer chip. Each wiper terminal has 256 positions between the high and low end of the potentiometer. The wiper position is set by an 8-bit control value that is stored into the I/O register of DS1868. The communication with the host microcontroller is done through a 3-wire serial interface. Please read my previous post, ‘How to interface MAXIM’s DS1868 digital potentiometer with a PIC microcontroller‘ for further detail on DS1868.
For more detail: LM386 based stereo audio amplifier with digital volume control
Quick Solutions to Questions related to Stereo Audio Amplifier:
- How is volume controlled digitally in this project?
Volume is controlled by replacing traditional electro-mechanical potentiometers with MAXIM's DS1868 dual digital potentiometer chips. - What components are required to build a stereo audio amplifier?
You need two LM386 IC circuits, one for each channel of the stereo output. - Does the digital potentiometer control the gain of the amplifier?
No, it creates a voltage divider network at the input to control the fraction of the audio signal fed to the amplifier. - How many positions does the wiper terminal have on the DS1868?
The wiper terminal has 256 positions between the high and low end of the potentiometer. - What supply voltage range is suitable for the LM386?
The supply voltage range is wide from 4 to 18 V, and it can be powered with a +9V PP3 battery. - How does the microcontroller communicate with the digital potentiometer?
Communication is done through a 3-wire serial interface. - What determines the wiper position on the DS1868?
The wiper position is set by an 8-bit control value stored into the I/O register of the DS1868. - Why is the LM386 popular among hobbyists?
It is popular due to its simplicity requiring minimum external components and its high availability.
Related projects
Audio Spectrum Analyzer
We developed an audio spectrum analyzer as our final project for ECE 4760. This analyzer presented a histogram-style representation of audio signals....
Audio, Sound & Radio · PIC12F675Audio CRO using PIC12F675 Microcontroller
This project is a miniature Audio CRO. For those not familiar with the abbreviation "CRO," it means "Cathode Ray Oscilloscope" and this...
Audio, Sound & RadioBuild a musical EKG with the Freescale FRDM-KL05
Short Introduction: I have been following the Battle of the DreamBoards Championship with interest and I enjoyed the variation of functionality features...
Audio, Sound & RadioPIC MicroController Volume Adjuster Program(Proteus 8 Stimulation)
Hello everyone, The important aspect of every learning is to induce curiosity and doing something meaningful to satisfy that.With the help of...
Audio, Sound & RadioWireless Radio Frequency Module Using PIC Microcontroller
It's a Microcontroller Based DIY Electronics Project. Named Wireless RF Module Using PIC Microcontroller. The RF module is a small electronic circuit...
Audio, Sound & Radio · PIC16F676Shrieker using PIC16F676 Microcontroller
Recently a cell phone ring tone was in the news - it's 17,000 Hertz and meant to be heard by teenagers, but...