LM386 based stereo audio amplifier with digital volume control

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.

LM386 based stereo audio amplifier with digital volume control
Stereo audio amplifier with digital volume control

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.

Schematic LM386 based stereo audio amplifier with digital volume control
LM386 audio amplifier 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.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter