Learn & build · Electronics · Part II · Chapter 21
A speaker amplifier: the LM386
Every build so far dealt in levels: on or off, high or low, dark or not. Audio is a signal, a voltage that wiggles above and below zero hundreds of times a second, and that raises a problem the other builds never had: this circuit has only one supply, 0 and 5 V, so where does "below zero" go? This build answers it with the LM386, a small amplifier chip that has driven toy speakers and guitar practice amps for decades, wired exactly as its datasheet's simplest figure shows, and explains every part that figure adds.
1. The goal and the datasheet's circuit
The goal: a phone's headphone output plays out loud through a small 8 Ω speaker, with a volume knob, from the 5 V rail. The blocks: a volume control, an amplifier, and the speaker. This time the parts come straight from the datasheet: its "LM386 with gain = 20" figure is the minimum circuit, and the first habit of a good designer is to start from it and understand each part before changing anything. Here it is, live, playing a 440 Hz tone (the A above middle C) at half volume.
Hover the chip's output, pin 5, and then the speaker's top: the numbers are wildly different. That difference is the whole chapter.
2. A signal riding on half the supply
With one supply, the output can't go below 0 V, so the LM386 does what every single-supply amplifier does: it parks its output at half the supply, 2.5 V here, and swings up and down around that. The datasheet calls it "self-centering." The music is the wiggle; the 2.5 V is just where it lives. But a speaker connected straight to pin 5 would see the 2.5 V too, all the time. Predict what that does, then toggle the capacitor.
🎯 Challenge: find the largest input that comes out unclipped on 5 V.
Without C1, what happens to the speaker even in silence?
- Nothing: no signal, no current
- 2.5 V of DC drives about 0.31 A through its 8 Ω coil: it heats, and the cone sits pushed to one side
- It plays louder
On a single supply, a signal rides on a DC level at half the supply; a capacitor in series passes the signal and keeps the DC off whatever comes next.
3. The capacitor sets the bass
C1 and the speaker are chapter 2's RC filter, the other way round: a capacitor in series and a resistance (the 8 Ω coil) to ground make a high-pass. Low notes pass less. The cutoff is \(f_c = 1/(2\pi R C)\), and with R only 8 Ω, C has to be big. Choose C1.
The datasheet draws 250 µF, which isn't a standard value, so this build uses 220 µF. What's the cutoff into an 8 Ω speaker, in hertz?
4. The chip: gain, and the input's limit
Two of the eight pins set the gain. Open, the LM386 amplifies 20 times. A 10 µF capacitor between pins 1 and 8 makes it 200; 1.2 kΩ in series with that capacitor, 50. More gain isn't more power, though: the output can only swing so far, about 1.8 V each way on 5 V before it clips (chapter 16), so more gain just means a smaller input already reaches that ceiling.
And the input has its own limit: the datasheet's absolute maximum for pins 2 and 3 is ±0.4 V. A phone's headphone output at full volume can exceed that, which is why the volume pot comes first, before the chip, and why you start with it turned down.
Where it breaks: 325 mW is a promise at 6 V, at 10% distortion
The datasheet's typical output power is 325 mW, into 8 Ω, on a 6 V supply, with the distortion already at 10%: a sine flattened enough to hear. On this build's 5 V, the clean swing is about ±1.8 V, which is \(1.8^2 / (2 \times 8) \approx 0.2\) W (chapter 16's power into ohms). Spec-sheet power figures always come with conditions; read them before comparing two chips.
5. The little network on the output
R1 and C2, 10 Ω and 0.05 µF from pin 5 to ground, appear in every circuit in the LM386's datasheet, with not a word about why. That's common: datasheets show what works and leave the reason to you. At audio frequencies C2 is nearly an open circuit (about 3.4 kΩ at 1 kHz with this build's 47 nF), so the network takes almost none of the music. Far above audio it's nearly a short, and then the amplifier sees at most 10 Ω.
Why would an amplifier need a load far above audio?
- The LM386 is a feedback amplifier, and feedback can turn into oscillation (chapter 9: a signal coming back in step, strong enough).
- Whether it does depends partly on the load, at the very high frequencies where the chip's own gain is running out.
- A speaker is a coil (chapter 16), so its impedance rises with frequency, and its leads add more coil; far above audio, the amplifier is driving almost nothing.
- The network holds the load near 10 Ω up there, where the chip's designers assumed a load. Builders call it a Zobel network. Leave it out and many LM386 boards work; some squeal or run hot with a faint oscillation you can't hear but a scope shows. It costs two cheap parts.
6. The breadboard
The datasheet's layout advice applies even on a breadboard: keep everything close to the chip, keep the speaker's wires short, and keep the input away from the output. The input is a few millivolts to a few hundred; the output wires carry hundreds of milliamps. Run them side by side and the amplifier hears its own output, which shows up as hum, howl or motorboating (a slow "putt-putt").
🎯 Challenge: click pin 5's column and find where the speaker's current goes.
7. The shopping list
| Ref | Part | Why this one |
|---|---|---|
| U1 | LM386N-1 (8-pin DIP) | 4–12 V; gain 20 to 200. The N-4 runs to 18 V. |
| RV1 | 10 kΩ pot, log taper | Volume, before the chip. |
| C1 | 220 µF electrolytic, 16 V+ | Blocks the 2.5 V; cutoff ≈ 90 Hz into 8 Ω. |
| R1, C2 | 10 Ω ¼ W, 47 nF ceramic (473) | The datasheet's output network. |
| C3 | 0.1 µF ceramic + 100 µF electrolytic | Supply bypass at pin 6. |
| LS1 | 8 Ω speaker, 0.5 W or more | Small is fine. |
| — | 3.5 mm audio jack or cable | Tip (left) to RV1, sleeve to ground. |
| opt. | 10 µF on pin 7 to ground | Less supply hum (the datasheet's bypass pin). |
8. Power up and check
- 1. Volume at zero, nothing playing: pin 6 5 V; pin 5 2.5 V (half the supply). This one reading tells you the chip is alive and biased.
- 2. The speaker side of C1: 0 V DC. If it reads 2.5 V, C1 is shorted or has failed (an electrolytic put in backwards leaks and soon fails).
- 3. Play, and turn up slowly: clean sound until about the middle of the pot with a phone at moderate volume; past that it starts to clip, as section 2 predicts.
- 4. Feel the chip after a minute of loud music: warm is normal; too hot to touch means oscillation (check R1 and C2) or a short at the speaker.
9. What's wrong?
A loud hum, louder when you touch the input wire, even with the phone unplugged.
- The gain is too high
- C1 is too small
- The input is floating: with the phone unplugged, nothing holds pin 3's side of the pot near ground
It plays, but with a slow "putt-putt-putt" at any volume, and the 5 V rail wobbles on the meter.
- Motorboating: the supply sags with each beat of the output and feeds back into the input; add the bulk capacitor at pin 6 and keep the input's ground away from the speaker's
- R1 and C2 are missing
- The speaker is damaged
10. Make it yours
- More gain: a 10 µF capacitor from pin 1 (+) to pin 8: gain 200, for a microphone instead of a phone. The datasheet then asks you to bypass the unused input (pin 2) to ground through 0.1 µF.
- Bass boost: the datasheet's trick: a series RC from pin 1 to pin 5 (about 10 kΩ and 0.033 µF in its figure) lifts the low notes a small speaker loses.
- Louder: run it from 9 V (the -1 version takes up to 12 V): the swing grows with the supply. Re-check C1's voltage rating and the chip's heat.
Next: a microcontroller board: an ESP32 reading a sensor and drawing on a little display, over two shared wires, and choosing which of its pins to use.
Previous: Sensor to switch: a dusk light · All chapters: Learn & build.
Last updated