Introduction: Tales From the Chip: LM386 Audio Amplifier

Picture of Tales From the Chip: LM386 Audio Amplifier

Audio is one of the most entertaining, time-consuming and (eventually) wallet-draining ways of learning about and falling in love with electronics. Reproducing, recording and amplifying audio gets you up close and personal with the electrons rocketing through your circuits.

Which brings us to what is in my mind the best kickoff point in learning about audio electronics - amplification. If you have access to an old speaker and an audio source (such as your phone or MP3 player) you can easily start building low cost circuits that have immediate results - music blasting into the airwaves.

Chip Amps

It used to be that audio amplification depended on large numbers of discrete components or power-hungry vacuum tubes to get decent sound from a source to a speaker. Like everywhere else, integrated circuits have made the barrier to entry much lower, letting us use any number of op-amps designed specifically for audio. These ICs are collectively called audio amplifier ICs, amplifier chips or chip amps. Typically they require few external components, can be prototyped with simple circuit designs and require less current than their discrete and tube counterparts.

Which brings us to the venerable LM386 by Texas Instruments. This bad boy has been with us since 1983, and can still be found in low power, battery driven applications all around the world. And being...

  1. easy to power (using a single supply)
  2. low heat (no heatsink required)
  3. efficient
  4. available in the prototyping-friendly DIP package

...means it's much loved by the DIY audio community and a terrific place to start experimenting with chip amps. Also, you can pick one up for around $0.50 USD :) Here we'll learn about the chip and build a simple circuit to put it to work. Let's take a look.

Step 1: LM386 101

Picture of LM386 101

A good place to start is the official datasheet (PDF) where you can get all the technical information you need. But I'll go over the basics here.

The LM386 is an operational amplifier than has been specifically designed for use in audio applications... which means its performance is based on the assumption that it will be driving speakers. At least at some point. However it can, like most other basic audio amplifier chips, be used as a regular op-amp as well.

It has a default gain of 20x - meaning it will multiply the voltage it receives on the input by 20 times, passing this through to the output. The gain value can be adjusted if needed.

The pins

1, 8 - Gain
Pins 1 and 8 are used to adjust the gain level from the default 20x using specific values of connected capacitors.

2 - Negative Input
3 - Positive Input
These are the standard op-amp inputs. Typically in a simple LM386 circuit, the negative input will be tied to ground while the positive input will receive the audio signal from the source.

4 - GND

5 - Vout
Pin 5 is the op-amp output, in our case the amplified signal which we send on to the speaker.

6 - Vs
The Voltage Supply pin receives the power required to operate the amplifier.

7 - Bypass
This pin provides direct access to the signal input, primarily used to remove power supply noise (preventing noise from being amplified).

Specifications

The LM386N ("N" signifying the preferred DIP package for our purposes) comes in 4 flavours: LM386N-1, -2, -3 and -4. The "3" and "4" versions have slightly higher output power, with the "4" version more so given its ability to handle more input voltage (at the cost of a higher minimum voltage requirement). For the rest of this article I'll refer to the LM386N-1, as it's the chip I had laying around and represents the most basic of the variants.

Supply Voltage (Vcc):
The chip requires a minimum of 4V to operate, with a maximum of 12V.

Speaker impedance:
The LM386 was primarily designed for a 4Ω speaker load, but is rated for 8Ω and 32Ω loads as well.

Distortion:
Under ideal conditions, 0.2% total harmonic distortion (THD) when driven with 6V of power into an 8Ω speaker at low power ratings, and up to ~10% THD closer to maximum power.

Output power:
Under ideal conditions you can expect about ~700mW of clean output power, or 0.7W.

Step 2: ​What, Less Than One Watt?

Despite the marketing hysteria surrounding power output for speakers and amplifiers, you'd be surprised how loud 1W of output power can be. While you won't get deep, booming bass, 1W of clean power is more than enough to drive small desktop computer speakers and many mobile audio applications. And in the world of headphones (where the speakers are right next to your eardrums) you're talking a couple dozen milliwatts of power needed to crank up the volume. Here's a useful, myth-busting rule to remember:

Doubling output power gains you 3dB of acoustic power.

Which means the difference between 50W and 100W is 3dB.

The difference between 100W and 200W... 3dB.

500W and 1000W? Still only 3dB!

So you hit diminishing returns pretty quickly, and get comparatively little increase in perceived volume as you go up the power scale.

Side note: The relationship between dB, power and sound pressure is complicated, but essentially you'd need to quadruple the amplifier power to double the sound pressure, which equates into varying levels of loudness depending on the listener. See these great articles to understand more:

Relationship Between Watts and dBs

Double amplifier power does not double the volume

In fact some of the most celebrated integrated and power amplifiers (such as the legendary NAD 3020) were capable of delivering "only" 20W into 8Ω speakers, which by today's standards isn't something the marketing suits would be happy to advertise. But the fact remains that after basic power requirements have been met to drive a specific set of speakers at an ideal volume, factors such as frequency response, total harmonic distortion and transparency are far more important than raw power.

Step 3: A Simple Circuit

Picture of A Simple Circuit

Building a basic functional circuit for the LM386 is dead easy. The schematic is a mono amplifier, so if you wanted to amplify a stereo signal you'd need two of these circuits (one for each channel and each speaker).

1. We need to supply an audio signal to the +Input of the amplifier (pin 3). The audio signal also needs its own path to GND. In addition, a high value resistor between the signal input and GND (10KΩ in the schematic) acts as a pull-down resistor that drives the input to ground when a source isn't connected. Without this resistor, you'll get a loud buzz/hum if your music player isn't hooked up.

2. Pins 1 and 8 have been left open, as we're using the default gain of 20x.

3. A 100uf capacitor is placed between the bypass pin (7) and GND, in order to prevent some power supply noise from being amplified.

4. The -Input and GND pins (2, 4) are connected to... GND :)

5. The power source is fed into pin 6, along with a 100uf decoupling capacitor in parallel to GND to filter out low-frequency noise.

6. Finally, the output from pin 5 is fed into the speaker, with two more capacitors paralleled to GND: a 0.1uf (100nf) cap to filter out high frequency noise, and a 1000uf supply capacitor for filtering and smoothing.

Step 4: Build It!

Picture of Build It!

To build the circuit, you'll need:

☐ 1 x LM386N DIP8 IC

☐ A standard 400-hole ("half size") breadboard

☐ 1 x 0.1uf ceramic cap

☐ 2 x 100uf electrolytic cap

☐ 1 x 1000uf electrolytic cap

☐ 1 x 10KΩ carbon / metal film resistor

☐ Jumper cables

☐ A ~9-12V DC power source (a 9V battery will do fine!)

☐ A 3.5mm headphone socket and 3.5mm audio cable

☐ A cheap, 4Ω or 8Ω speaker and speaker hookup wire


Step 5: Test It!

Picture of Test It!

Plug in an old 4 or 8Ω speaker (one you don't mind risking!) and an audio source and slowly turn up the volume. Experiment with different styles of music and see if you can detect any clipping or noise, especially at higher volumes. I found clipping was reached at about 80% volume on my iPhone, but by then it was already louder than comfortable average listening.

  • Try the circuit with and without the various filtering capacitors and see what differences you can hear.
  • Unplug the audio cable and remove the 10K pulldown resistor to appreciate what that bad boy is doing for you.
  • Turn down the volume and try add a 10uf ceramic capacitor between pin 1 and 8 to increase the gain from 20x to 200x.

Experiment, and listen! But when in doubt, keep the volume low and turn it up later.

Stress test

Using a small collection of audio test equipment I've put together, I got the following results while driving an 8Ω dummy load:

  • With a 1kHz sine wave, a maximum input of 120mV RMS before clipping
  • Around 2.38V RMS on the output
  • ... meaning our gain of 20x was pretty much spot on (2380mv / 120mv = 19.83x)
  • 707mW of output power, which significantly exceeded the rated output. But to be fair I was pushing it harder than recommended.

THD:

Running the circuit through a spectrum analyser for the whole 20Hz to 20kHz audio spectrum got a total of -35dBc average, or 1.7% THD (total harmonic distortion). Not audiophile by any stretch of the imagination, but for a $2 audio circuit on a cheap breadboard, with lightweight cables and unshielded inputs... not too shabby! We'll leave the 0.0001% distortion for future circuits :)

Step 6: Where to From Here?

Picture of Where to From Here?

If you like the idea of experimenting with chip amps of higher power, better noise ratings and in more demanding applications, your next steps could be:

The LM1875 - an excellent 20W mono audio amplifier that also relies on few external components, although some cooling will be required. Datasheet

The TDA2050 - a 32-35W mono chip that's heading into "audiophile" territory. Don't let that scare you away. You'll need a decent heatsink, some extra external caps and resistors and a little patience. But this baby is capable of some serious performance. Datasheet

And of course...

The LM3886, the most widely respected hifi grade DIY-friendly audio chip there is. Vanishingly low distortion, high power (35-50W) and loads of built in protection mechanisms. Get a fat heatsink! Datasheet

I'll put up new Tales From The Chip articles on these little guys soon, and other audio related Instructables in the near future.

Cheers!

Comments

Newoldbuilder (author)2017-11-14

I only had an electret mic so it did not work with just the LM386. I put an LM741 between the mic and the LM386 and it worked great.

Dylan91 (author)2017-11-04

Thank you for this Instructable, I learned a lot from it:)

abzza (author)Dylan912017-11-06

No problem! The LM1875 Instructable is almost finished, will be up in a day or two.

FOMcDuff (author)2017-09-26

Excellent many thanks!

vettebob (author)2017-09-22

I have a tiny microphone taken from a set of headphones with mike. Would that mike drive this amp? Also, how would you add volume control to this amp. (I want to use a mike, into a small amp, into headphones. I need high, but controllable gain.)

Thanks, and nice instructable!!

beul (author)2017-09-21

Thanks for shared, this i need

Chikote (author)2017-09-20

Well done! A great and interesting project :)

Diehard2501 (author)2017-09-18

So many memories. I remember building my first headphone amplifier with a pair of them in '86 and it was the coolest project ever. I had an old pair of '70s tan plastic headphones that my cheap walkman could never get loud enough so I took them apart and there was enough space inside each earpiece for me to get all the parts inside except the batteries. I ended up taping the battery pack to the headband.

abzza (author)Diehard25012017-09-19

Ah man, thanks for the trip down memory lane! I don't suppose you still have your chop-shop headphones?

Diehard2501 (author)abzza2017-09-19

Sadly no, they got tossed out many years ago.

sollyman (author)2017-09-18

The real thing about this chip is it has distortion that rivals a Pignose amp. Look for Cricket amp in Instructables. There is also a bass boost circuit for 'smoother' sound from small speakers. One more tip: piggy-back another chip by soldering pin to pin, and get double output power. Glue a heat sink on top for luck.

abzza (author)sollyman2017-09-19

Oh cool, that piggybacking idea is awesome, will investigate!

bwelkin (author)2017-09-18

One more interesting factoid: a 3Db increase is the least volume increase the the human ear can discern. Double the power and you barely hear the difference.

abzza (author)bwelkin2017-09-19

Yeah, the obsession with wattage as it relates to volume is really bewildering, but you can understand why the marketing departments need to latch on to something somewhat relatable. I honestly don't know why anyone would need a 300W speaker in say, their living room.

DylanD581 (author)2017-09-18

Very nice introduction to the LM386 and audio circuits and electronics in general. Please make more!

abzza (author)DylanD5812017-09-19

Cheers - no problem! I've got a bunch of classic audio and general-use chips I'd love to write about, as well as some details about audio electronics in general.

John BarryL (author)2017-09-18

I have a question about capacitors in general (I'm trying to restore a Hallicrafters S-38A receiver, and this topic has me stumped).

In your instructions, you say use a pair of 100 uf electrolytic caps, and 1x 1000 uf ceramic cap. I always was under the assumption that electrolytic caps are used for higher values of capacitance, as long as the polarity is observed. Why 100 uf electrolytics and a 1000 uf ceramic? Maybe I missed something?

Excellent presentation, by the way. Thanks.

abzza (author)John BarryL2017-09-19

Hey John!

Thanks - you spotted a typo. Changed that cap to "electrolytic" :)

To add to your comment, although we don't tend to think this way anymore 100uf is actually a heck of a lot of capacitance, and really at the upper limit of what ceramics can offer reliably (and cheaply).


However, it is a little-known fact that higher value ceramics also degrade at higher voltages, with greater variance and unwanted microphonic effects that electrolytics largely avoid. And considering that many audio applications require higher voltages (a typical DIY speaker amplifier might need +-24V) these effects start becoming relevant.

So your rule of thumb is spot on - once you start getting into micro-farad territory, electrolytics should generally be considered.

SteveJ25 (author)2017-09-17

LM386 is old. a good chip in its day but there are too many modern opamps that blow it away with better noise and distorion specs

jwzumwalt (author)SteveJ252017-09-17

You are right, but I still have about 40 of these in my parts drawer and I keep coming back to them :)

abzza (author)jwzumwalt2017-09-18

Yeah, I've got a pile of these lying around :) That being said, "old" doesn't mean "useless", and there is certainly a lot to be learned about audio electronics by understanding some of its more basic components, particularly one like the LM386 which has a very low barrier to entry. A great place to start, with little upfront cost and few extra components required. From there you can of course graduate to your dual LM4780 monoblock beasts!

jwzumwalt (author)abzza2017-09-18

As I mentioned above, if a LM386 won't do it, then I prefer the tda2822. It is up to 3w stereo and can be used with microprocessor supplies; 3-15v. Almost all my work ends up on 3-5v now days. I rarely use a 6-12v pwr supply.

How things change. 40years ago I usually needed 67-1/2v & 48v A&B power, then it was 24v, then 12v, now its 5v !!!

nibbs (author)2017-09-18

The TDA7052A is also worth looking at for driving a speaker as it has the advantage of having a differential output so does not need the large electrolytic (keeping cost and complexity down). The downside is that the output is no longer ground referenced and so can not come out of a grounded jack socket, but for good audio that is actually an advantage..

jwzumwalt (author)nibbs2017-09-18

I prefer the tda2822 over the 7052. It is up to 3w stereo and can be used with microprocessor supplies; 3-15v.

RobPaige (author)2017-09-18

Great write-up. Plenty of further information linked to for those of us who want it, but what you've got here is easily accessible to the maker who just wants to build an audio amplifier circuit for a project.

wooduino (author)2017-09-17

Thanks! Very interesting.

Just a quick note that your schematic and the image of the breadboard layout do not match. While the pictures of the breadboard are fine, check out the position of the 0.1uF cap on the output of the image of the breadboard layout.

abzza (author)wooduino2017-09-18

Ha ha, yeah - I built the circuit before drawing out the schematic, so had the benefit of neatening things up and simplifying the layout somewhat. The two are electrically identical, however. And as long as the 0.1uF cap is between the output path and ground, it should still work like a charm. Thanks for the comment!

jwzumwalt (author)2017-09-17

Thanks for the extra effort and details. This SOOO much better than most the chip instructible where someone just redrew a Google standard circuit and slapped it on thier Arduino, Raspberry Pie, or head phones - :)

abzza (author)jwzumwalt2017-09-18

Thanks for your feedback! Cheers :)

caverob (author)2017-09-17

Great tutorial but can anyone recommend a good book to understand audio circuits beyond just the basic. I'd like to experiment but it would be nice to understand a bit more first.

jwzumwalt (author)caverob2017-09-17

I am not trying to dishearten you, but "a book on audio" is far to general a request. I would suggest you study 1 and two transistor audio amplifiers. That will pretty much get you grounded an theory, termonolgy, and circuit design.

http://www.colorado.edu/physics/phys3330/PDF/Exper...

http://www.electronics-tutorials.ws/amplifier/amp_...

look at the bottom of the second link for about 10 additional related topics

tonep (author)caverob2017-09-17

Just google "audio schematics" or "amplifier schematics" or "ic amplifier schematics". You will find enough stuff to keep you going for quite a while. In my experience, the more fun way is to learn by doing.

derekguenther (author)2017-09-17

Great write-up, but can you please fix your commentary regarding dB? It's a bit misinformational. An increase of 3dB (which means "double" for power measurements) and a measurement of 3dBPa (decibels from a Pascal, which is how audio measurements are actually taken) are two very different things.

abzza (author)derekguenther2017-09-17

You're correct! A more accurate term in my context would have been "loudness" as well as sound-pressure level (dB-SPL). That being said, dB is useful when talking relative terms or comparing levels, which was my intention here. I'll attempt to clarify :)

derekguenther (author)abzza2017-09-17

Just to be clear - the problem I'm trying to get at is you seem to be treating the dB scale as if it were linear. It isn't, that's the whole point. For example, a quick Google search for "spl scale" shows that a normal conversation is about 60dB while a 747 jumbo jet taking off is 120dB. But saying that the jet is twice as loud as a conversation is nonsensical, and while you don't actually say that you do guide the reader down that path of thinking with your "doubling power still only gets you 3dB!" comment. Any attempt to relate two different sound loudnesses using dB (without using an SPL meter and a chart) makes no sense unless you understand the meaning (and math!) behind the decibel, and why it is useful - which is strictly because we can say "70dB" and "120dB" instead of "0.02 Pa" and "20 Pa" which is harder for a human to wrap their head around. Generally, logarithmic scales like dB are more useful when you're graphing things out in my experience, but I'll admit that I'm not very well versed in day-to-day dB use when it comes to sound engineering. If I'm incorrect, if there's some way that dB is far more useful in day-to-day sound engineering than I've seen, please let me know as I am very interested.

Also, I apologize for my earlier incorrectness - I mistakenly thought that the SPL dB was dB from a Pascal, but in actuality it is dB from 0.00002 Pascal which was chosen as the lowest threshold of human hearing. So 120dB actually means "1,000,000 times more pressure change than the smallest pressure change (sound) a human can hear." Which is pretty awesome when you think about it - the human ear is amazing.

Dominguez alejandro (author)2017-09-17

Imagino a usted una persona joven. Ha descubierto y analizado las bondades del CI LM386. La informacion (data Sheets) se puede obtener del manual DataBoock Linear de National Panasonic Editado en 1982. Yo todavia lo consulto a diario y es increible los diagramas y circuitos que posee este antiguo manual. Hoy ante tanta miniaturizacion e integracion de los circuitos de audio es preferible mil veces a uno volver a los circuitos clasicos que son mas faciles y principalmente .................. mas baratos. Adelante , la electronica convencional volver{a por falta de gente capacitada para resolver los enormes problemas que genera el avance sin final de la esctronica moderna.

Saludos Alejandro

misterxp (author)2017-09-17

Thanks ! Very interesting. I used one of these chips for a mousebot project that I found in Instructables : https://www.instructables.com/id/Mousebot-Revisited

But I wanted to do some music experiments too and this is just right for getting started.

wing_strut (author)2017-09-17

How about a 555 timer .... great chip.

abzza (author)wing_strut2017-09-17

A true classic! Here's a little 555 test circuit I slapped together the other day. Crazy useful chip:

HuntX123 (author)abzza2017-09-17

What does your 555 Timer circuit do?

abzza (author)HuntX1232017-09-17

It's just the most bare-bones 555 circuit you can get - blinking an LED on and off :) This was just put together to test the relationship between the resistor/capacitor network on the timing itself.

tonep (author)2017-09-17

Nicely done. Just the right amount of theory to get going with the practical.

In case you are interested, I have a tiny little pcb for this IC amplifier (with no etching required) here: https://www.instructables.com/id/Compact-Circuit-Boards-with-Eagle-No-Etching/. It will take up to 470uF capacitor in the speker output quite confortably. For the 1000uF in your schematic, some adjustment may be needed.

abzza (author)tonep2017-09-17

Oh, awesome - your Instructable looks well worth a read! Thanks for the link, and the kind words!

thorathome (author)2017-09-17

This terrific - and terrifically clear - article got me back to the bench. I'd built an excellent Bluetooth boombox from another wonderful Instructable (thanks, Barry_L) which got me more curious about general audio circuits. I build Heathkit amps as a kid, which dates me mightily, but this piece got me tinkering with audio again. Yes, a small amp can create a mighty sound. Thanks.

abzza (author)thorathome2017-09-17

Fantastic! Great to have another devoted audio tinkerer, particularly one who started early ;) Chip amps are truly awesome - they've come a long way, and aren't (yet?) so inaccessible that an amateur hobbyist can't dive right in. Thanks for the feedback!

NavyBuff (author)2017-09-17

Nice! Great write-up Thanks

abzza (author)NavyBuff2017-09-17

Any time!

ajayt7 (author)2017-09-17

Thank you for this simple but well explained, basic project

abzza (author)ajayt72017-09-17

Thanks for reading it!

andrea biffi (author)2017-09-17

That is cool, i have to try it! I used the same IC for other purposes

About This Instructable

19,471views

336favorites

License:

Bio: DIY audio, Arduino and whisky enthusiast
More by abzza:Headphone Dummy LoadDIY External Volume ControlTales From the Chip: LM386 Audio Amplifier
Add instructable to: