Circuit 3D

Audio amplifier circuits

An audio amplifier turns a weak sound signal into enough power to drive a speaker. A class AB amplifier copies the wave smoothly at about 60% efficiency; a class D amplifier switches at about 90%, so a PAM8403 gives 3 W from a 5 V USB supply.

P = Vpeak² ÷ 2R

where Vpeak is the most the speaker swings and R its resistance, 4 or 8 Ω: 5 V swung each way into 4 Ω gives about 3 W.

The LM386 is the classic beginner’s chip; class D modules have taken over most new designs.

What is an audio amplifier?

An audio amplifier is a circuit that turns a weak sound signal, a few hundred millivolts from a phone or a sensor, into enough voltage and current to move a speaker’s cone.

It has gain, to raise the signal, and an output stage strong enough for a 4 or 8 Ω speaker. How that output stage works sets its class, and Figure 1 shows the two that matter today. See how an amplifier works for gain and clipping.

0 pulses, averaged by the speaker

Class D: the output transistors switch fully on and off hundreds of thousands of times a second, the width of each pulse following the sound, the dashed line, which the speaker’s inertia averages back out. Fully on or off, they waste little: about 90% efficient.

Figure 1. One cycle of a sound, the small grey wave, and what each class of amplifier sends to the speaker. Real class D switching is far faster than the 24 pulses drawn.

What is a class D amplifier?

A class D amplifier switches its output transistors fully on and off hundreds of thousands of times a second, varying each pulse’s width with the sound, at about 90% efficiency.

It is PWM at audio speed: the speaker’s coil and cone average the pulses back into the sound, sometimes helped by a small filter. Its efficiency means small boards, no big heat sinks and long battery life.

What is a class AB amplifier?

A class AB amplifier uses two output transistors that take turns, one for each half of the wave, each slightly on all the time so the hand-over is smooth, at about 50 to 70% efficiency.

It copies the wave directly, with no switching, which is why many hi-fi amplifiers still use it, at the cost of heat sinks. The LM386 is a small class AB chip.

How do you use an LM386 amplifier?

To use an LM386, power it from 4 to 12 V, feed the signal into pin 3 through a volume potentiometer, and drive an 8 Ω speaker from pin 5 through a 220 to 250 µF capacitor.

Its gain is 20; a 10 µF capacitor between pins 1 and 8 raises it to 200. Add 10 Ω and 0.047 µF in series from pin 5 to ground to keep it stable. From a 9 V battery it gives about half a watt, enough for a small speaker.

What is a PAM8403?

The PAM8403 is a tiny stereo class D amplifier chip that gives up to 3 W a channel into 4 Ω from 5 V, needs no output filter, and comes on thumbnail-size boards with a volume knob.

It runs from 2.5 to 5.5 V, so USB or a lithium cell powers it. Its outputs are bridged, so never connect either speaker lead to ground.

What is a TPA3116?

The TPA3116D2 is a class D amplifier chip that drives two speakers at up to 50 W each into 4 Ω from about 21 V, and runs on 4.5 to 26 V.

In mono mode it gives up to 100 W into 2 Ω. Boards built on it power bookshelf speakers from a 19 to 24 V laptop-style adapter, which runs from 120 V or 230 V mains. Use speaker wire of 18 to 16 AWG, 0.82 to 1.3 mm², for runs of a few meters.

How do you make a simple amplifier?

To make a simple amplifier, build an LM386 circuit on a breadboard: chip, volume potentiometer, a 10 µF capacitor for more gain, an output capacitor, an 8 Ω speaker and a 9 V battery.

  1. Power pins 6 and 4 from 9 V and ground, with a 100 µF capacitor across them.
  2. Put the signal across a 10 kΩ potentiometer, feed its wiper into pin 3, and ground pin 2.
  3. Connect pin 5 to the speaker through a 220 µF capacitor.
  4. Add 10 µF between pins 1 and 8 for a gain of 200, and play some sound.

Which audio amplifier should you choose?

Choose an amplifier by the power and supply you have: an LM386 for a small battery project, a PAM8403 for up to 3 W from 5 V, and a TPA3116D2 board for room-filling sound.

Figure 2 compares them. Match the speaker to the amplifier’s rated ohms: a lower one than it expects can overload it.

LM386 0.5 W PAM8403 3 W TPA3116D2 50 W

PAM8403, class D: about 3 W into 4 Ω, from 2.5 to 5.5 V, so USB or a lithium cell; two channels of 3 W each, filterless class D on a tiny board, for speakers in gadgets.

Figure 2. Three common amplifier chips by power a channel, on a scale where each step is ten times the last. Typical ratings at their usual supply and speaker.

How do you work out an amplifier’s power and heat?

Square the peak voltage a speaker can swing and divide by twice its ohms for the power, and divide the output by the efficiency, less the output, for the heat.

Example 1: the most power from a supply

How much clean power can an amplifier give a speaker at PAM8403, 5 V, 4 Ω?

Given
a PAM8403 on 5 V into 4 Ω, bridged, so the speaker swings the whole supply each way
Find
the most clean power, before losses
Solution
Vpeak = 5 VP = Vpeak² ÷ 2R = 5² ÷ 8 ≈ 3.13 W
Answer
3.13 W at most, ideally, and a little less from a real chip

Example 2: why class D runs cool

An amplifier delivers 10 W to a speaker. How much heat does a class AB amplifier make, and a class D?

Given
10 W to the speaker, from a class AB amplifier at 60% efficiency or a class D at 90%
Find
the heat each must shed
Solution
Class AB: 10 ÷ 0.6 − 10 ≈ 6.67 WClass D: 10 ÷ 0.9 − 10 ≈ 1.11 W
Answer
6.67 W against 1.11 W: class D makes a sixth of the heat

Summary

Key equations

  • P = Vpeak² ÷ 2R sine power into a speaker
  • dB = 20 log10(gain) voltage gain
  • heat = P ÷ efficiency − P an amplifier’s loss

Key terms

Class AB
Two transistors sharing the wave.
Class D
A switching amplifier.
Bridged
Both speaker leads driven, twice the swing.
Impedance
A speaker’s ohms, 4 or 8.

Practice problems

  1. Which class of amplifier is most efficient?

  2. What gain does an LM386 have with nothing between pins 1 and 8?

  3. A bridged amplifier on 5 V drives a 4 Ω speaker. About how much power, ideally?

  4. What voltage does a PAM8403 run from?

  5. A class AB amplifier delivers 10 W at 60% efficiency. How much heat does it make?

FAQ

Is class D better than class AB?

For efficiency, size and battery life, yes; good class D now sounds excellent. Class AB avoids switching noise and is still used in many hi-fi amplifiers.

Can I connect a speaker directly to an Arduino?

Only a tiny one, quietly, through a resistor; for real volume, drive it through an amplifier such as a PAM8403 or LM386.

What does a 4 Ω or 8 Ω speaker mean?

Its impedance: about the resistance it presents to the amplifier. Lower ohms draw more current and power from the same voltage.

Why does my LM386 hum or hiss?

Usually from long input wires, no capacitor across its supply, or the gain set to 200; shorten the wires, add 100 µF across the supply, and lower the gain.

How many watts do I need?

A few watts fill a desk or small room with a reasonably efficient speaker; tens of watts suit a living room.