Ultra-Simple Class D Audio Amplifier
by cartlemmy in Circuits > Audio
4073 Views, 5 Favorites, 0 Comments
Ultra-Simple Class D Audio Amplifier
This is a relatively easy to build circuit to aid in the understanding of the principles of self-oscillating class D amplifiers. And in the end you'll have an amplifier good enough for casual listening. Skip to step 2 if all your interested in is the build.
Downloads
Supplies
One of the main design goals of this amplifier is to use commonly available / very affordable parts. The amplifier consists of an LM393 comparator, BJT output transistors and some supporting jelly bean parts. Many (possibly all) of the parts can be salvaged from old electronics. Old computer power supplies are a good source of many of these parts. The rest of the parts can be purchased online.
Below is the complete supply list, you can also download a detailed PDF version of the list below.
- 9-12v Power Supply
- 8-16 Ohm Speaker
- Audio Source
- Wire
- Wire Cutters / Strippers
- Solder
- Soldering Iron
- Printer
- Adhesive Spray, Glue, or Double Sided Tape
- Plastic sheet (Thick enough to support the parts of the circuit, thin enough to cut with scissors.)
- Scissors
- Resistors: 1k (x2), 3k, 4.7k, 10k (x2), 100k, 220k (x2), 1M
- Capacitors: 100nF (x3), 10uF, 1000uF (x2)
- 100nF Snubber Capacitor
- 100uH Inductor
- Small Signal NPN Transistor (x2)
- Small Signal PNP Transistor
- Medium Power NPN Transistor
- Medium Power PNP Transistor
- LM393 Comparator
- LED
- Power Connector
- Audio In Connector (3.5mm, RCA or similar)
- Speaker Connector
Get Familiar With the Circuit
You can skip this step if all you'd like to do is build the amplifier; But sometimes it is nice to understand how the things you build work :) I've created a simulation of the circuit using the Falstad Circuit Simulator, click the below link to check it out:
Preamp
The preamp stage is a simple Class A amplifier that boosts the small input signal to a signal large enough to be usable by the rest of the circuit. It consists of two decoupling capacitors C1 and C3 (which get rid of the DC part of the signal going into and out of the preamp) biasing resistors R1 and R2, feedback resistor R4, collector resistor R3, and a small signal NPN transistor Q1.
Comparator
Next is the comparator stage, arguably the most important part of the amplifier. This circuit is a “self oscillating” class D. This is because this amplifier does not have a triangle or sawtooth wave generator, but instead relies on negative feedback and hysteresis (positive feedback) to create the oscillations.
The audio signal is biased to half of the supply voltage before passing into the positive input of the comparator via R6 and R7. R8 and R9 allow the input signal to be mixed with the hysteresis before the (+) input of the comparator. If the (+) input is lower than the feedback (-) input, then the comparator pulls the output low (0V); if (+) is higher than (-), then the comparator does nothing with the output signal and R10 pulls the output high (VCC). The comparator will rapidly switch between high and low attempting to keep the output moving towards the input signal. The speed at which it switches (oscillates) is determined by the comparator, transistors, output filter, and value of the hysteresis resistor.
The pair of transistors (Q2 and Q3) immediately after the comparator provide a buffer between the output of the comparator and the rest of the circuit. Without them the hysteresis wouldn’t work properly and there wouldn’t be enough current for the power transistors.
Output
Q4 and Q5 are what make the PWM signal generated by the previous stages strong enough to drive the speaker.
Output Filter
L1, C6, and R11 form a LC lowpass fiter that removes high frequency content from the PWM signal, which transforms it into a listenable audio signal. Getting these values just right is the most important part of the amplifier's performance. Keep trying different values for L1 and C6 until the PWM signal frequency (with no audio input) is about 120-200kHz; try values between 100uH and 470uH for L1, and values between 100nF and 680nF for C6. If you have no way to measure the output PWM frequency you can just listen to the output (again with no audio input) and keep swapping L1 and C6 until there is as little hiss as possible. You can omit R11 if you are using a snubber type capacitor.
And last but not least: C7 removes the DC part of the output signal so it won't destroy your speaker.
Downloads
Print and Assemble the "Board"
Download the below PDF and print it out. The PDF consists of both the
back and front of the circuit board, as well as a parts list.
- Cut along the dotted lines
- Cut a sheet of plastic into a 5.5"x3.5" rectangle
- Adhere the plastic to one of the circuit template sides
- Poke holes in a few of the drill points of the adhered template
- Use the holes as a guide to line up and adhere the remaining side (hold it up to a light)
- Poke holes in the remaining drill points
After all that you are the proud owner of a paper circuit board!
Place the Parts
Place the parts into the holes you made in the previous step. Bend the pins a bit to keep them in place. Some of the larger parts might need a bit of tape or hot glue to hold them in place. Make sure to line up the polarity of the capacitors right.
Solder It Up!
Solder wires between the connectors on the back side of the board using the template and the schematic as a reference. Soldering on a paper board isn't ideal so be sure the connections are good.
Test It Out
- Connect audio source and speakers.
- It would be a good idea to connect a 100Ohm (or thereabouts) resistor in series with the positive power connector when first testing the circuit, that way you will lessen the chance of the circuit being destroyed if there are any shorts.
- Connect the power supply and check the positive power connection to make sure the voltage isn't dropping too much at the resistor we just connected.
- Also check your output transistors to make sure they are not getting too hot.
- And lastly, play some music through it
You will probably have to tinker with the output filter (L1, C6 and R11) to get a descent sound. Also, some BJTs don't work so well for this circuit. The larger ones tend to be too slow to run efficiently. The pair I had the best luck with was a 2SC2229 and a 2SA949 .