LM386 Amplifier For The Bench

Render of the Front of the Amplifier

Presented here is a small monophonic audio amplifier with an integrated speaker. It uses the LM386N-4 amplifier IC from Texas Instruments.

This unit will find some use as a general purpose audio amplifier on my work bench, but mainly I built it as a learning experience and for the fun of it. I thought others might want to build something similar so I have documented it here.

The renders shown above and below were originally intended as place holders until I got photos of the completed amplifier. Ends up I like how the renders look, so I am leaving them in place. Photos of the actual amplifier are at the bottom of this post.

The amplifier is housed in a 3D printed enclosure which was designed in SolidWorks. A PCB mounted power on/off switch and volume control protrude through the front panel, along with a headphone jack, and a high efficiency LED that illuminates when the amplifier is powered on.

Render of the Rear of the Amplifier

An RCA jack is located on the back panel and accepts the audio signal to be amplified. Text under the jack reminds that the maximum peak voltage that the LM386 can tolerate at its inputs is 800mV.

The unit is powered by a 9V battery which is accessed by removing the three screws and the back panel.

Schematic

The schematic of the LM386 amplifier is shown below. Leaving the power supply portion out of the discussion (that’s the bit at the top of the schematic, beginning with the “Battery Snap Connector”), this schematic shows what I consider to be the minimum requirements for a functional and robust audio amplifier using the LM386 IC.

A PDF of the schematic is here:
PDF – LM386 Amplifier Schematic

Amplifier Gain

In this circuit, the LM386 is using its default gain of 20X.  The LM386 datasheet shows the circuits and components that can be used to increase the gain up to 200x.  Increasing the gain has drawbacks such as increased sensitivity to noise, instability, and higher distortion. Unless there is a specific circumstance for increasing the gain past the 20x default, I see no reason to do so.

Audio Input Circuit

The audio input circuit consists of everything between the audio in jack (J4) and Pin 3 of the LM386N-4 IC (U1).

My calculations indicate  that the input impedance seen at J4 will be approximately 9k. This figure was arrived at by taking the resistance of potentiometer R5 (10k) in parallel with the stated input resistance of U1 (50k)  and adding the resistance of R6 (1k).

The amplifier’s input impedance was calculated like this:

    \[ R_i_n = 10k   //   50k + 1k = {\underline{9,333\hspace{1 mm}\Omega}} \approx 9k \]

Whether or not that’s the correct way to calculate it, I don’t know.  That’s the way I did it.

I selected a value of 4.7µF  for the input coupling capacitor (C8). That capacitor, along with the assumed U1 input impedance of 9k, form a high pass filter with a 3dB cutoff off of approximately 4 Hz.

The 3dB cutoff frequency for the high pass filter is calculated using this formula:

    \[ F_c = \frac{1}{2 \pi R C} \]

Adding the values from the text:

    \[ F_c = \frac{1}{2 \pi  * 9,000 * .0000047} = {\underline{3.8\hspace{1 mm}Hz}} \approx 4Hz \]

After the high pass filter, potentiometer R5 acts as an input signal attenuator, more commonly known as a volume control.

A RC low pass filter with a 3dB cutoff of approximately 340 kHz,  composed of R6 (1k) and C6 (470pF), follows the potentiometer to filter out high frequency signals.

The equation for calculating the 3dB cutoff for a RC low pass filter is the same one used for calculating the cutoff of a high pass filter. Here we use our new values:

    \[ F_c = \frac{1}{2 \pi  * 1,000 * 4.7x10^{-10}} = {\underline{339\hspace{1 mm}kHz}} \]

Power Supply Decoupling

Proper power supply decoupling is critical for the LM386 if one wishes the amplifier to perform to its specifications.  Here I’ve used a 220µF electrolytic (C3) and a 100nF MLCC (C4) in parallel. It is good practice to place these decoupling capacitors right at pin 6, not several inches away.

With local battery power it is likely that the 220µF is not required. However, adding it gives me the option of running this circuit from other power sources.

A 100µF Electrolytic (C7) is connected to the “bypass” pin (pin 7) of the LM386 (U1).  This capacitor isolates the input stage of the amplifier from power supply noise.  Actually, a 10µF capacitor connected to pin 7 would probably be sufficient.  I’ve not noticed an issue with the value at 100µF so I am leaving it in place for now.

Bass Boost

The “Bass Boost” circuit from the datasheet, R2 (10k) and C5 (33nF), is included to help compensate for the small (77mm) speaker’s lack of bass. It also appears to quiet the hiss that is prevalent with the LM386. One drawback of adding this circuit is that the bass is a bit overwhelming when using headphones. I suppose a switch could be added to switch the bass boost components in and out of circuit but I’ve decided to live with the consequences of my decision.

Audio Output

Signal output from the LM386 is via pin 5 of the IC.  A Zobel network composed of C1 (100nF) and R1 (10Ω) provides a load for high frequency components of the amplified signal and quells high frequency oscillation.

The output capacitor C2 (1000µF) is necessary since the LM386, by its nature, uses a single polarity power supply. This results in the amplifier internally adding a DC bias to the input signal. The output capacitor blocks that DC from getting to the speaker.

In addition to blocking DC from the speaker, C2 (1000µF), along with the speaker’s impedance (in this case 8 ohms), form a high pass filter. The value of C2 needs to be of sufficient value to pass the lowest desired frequency to the listener. In this circuit, the chosen value of 1000µF results in a low end cutoff of approximately 20 Hz.

Once again we use the equation for calculating the 3dB cutoff for RC filters with the new values:

    \[ F_c = \frac{1}{2 \pi  * 8 * .001} = {\underline{19.9\hspace{1 mm}Hz}} \approx 20 Hz \]

A 330Ω resistor (R3) is placed in series with the headphones (when they are plugged in).  This resistor reduces the audio level in the headphones and will help prevent damage to the LM386 IC should the headphone wiring produce a short circuit, or if a monophonic plug is inserted into the stereo jack.

The PC Board

The PCB holds all the components (except for a speaker) necessary for the amplifier to be fully functional.

Connections are provided for SPEAKER OUT, PWR IN, AND AUDIO IN. The 9V battery snap connector is soldered to the PWR IN pads

The three connection points will accept 2.54mm, 2 pin, Molex KK headers. However, I don’t have the proper crimping dies for the mating connectors so I don’t use the headers and, instead, solder the wires directly to the pads.

A dimensional drawing of the assembled PCB (PDF) is available here:
PDF – PCB Dimensions, LM386 Amplifier

The Enclosure

The enclosure for the amplifier consists of three 3D printed parts. Renders of the housing and back panel are shown at the top of this post. Inside the case, there is a 3D printed retainer to keep the speaker in place. It fits a CUI Inc. Speaker, P/N GF0771. I ordered the speaker from mouser.com.

That speaker retainer makes for a chunky looking creature. However, it is going to be under constant stress since it will be clamping the speaker in place. I don’t know how the PLA will hold up to that. It is likely chunkier than it needs to be.

Threaded brass inserts (M3) are installed into the case with a soldering iron. The fasteners for the project consists of 2x M2 x4 screws and companion nuts that hold the battery bracket to the PCB, 2x M3 x 12 screws that clamp the speaker retainer in place, and 3x M3 x 6 screws that hold the back panel on.

Inside, the amplifier looks something like this:

The PCB assembly slides in from the back and is held in place by the back panel. A nut on the potentiometer can also be added but it is not shown in the render above.

STL files for the enclosure parts are available at the bottom of this post. Use at your own risk.

The Completed Amplifier

The 3D printed case got a couple of coats of filler primer, a small amount of filler putty and pitiful little sanding. The finish coat is Krylon Gloss White enamel.

The raised lettering on the back panel did not come out too well.


Here are the STL files for the Case, Back Panel, and Speaker Retainer. If you want to 3D print these parts you’re on your own. The same goes for using any of the information presented here. There are no guarantees or warranties that any of the files and/or information is correct, or is of any use at all.

ZIP of STL Files – Speaker Housing Parts