Introduction: DIY Class D Audio Amplifier

In this project I will show you why a class AB amplifier is pretty inefficient and how a class D amplifier on the other hand improves this efficiency. At the end I will show you how we can apply the theory of operation of a class D amp to a couple of common components in order to create our own DIY class D audio amp. Let's get started!

Step 1: Watch the Video!

The video gives you all the information you need to build your own class D audio amp. During the next steps however I will present you some additional information to make the project even simpler.

Step 2: Order Your Components!

Here you can find a parts list with example sellers:

Ebay:

1x 3.5mm Audio Jack: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x 10kΩ Potentiometer: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x LM393 Comparator: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x TLC555 Timer: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x 74HC04 Inverter: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x IR2113 MOSFET Driver: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

2x IRLZ44N MOSFET: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x 7805 Voltage Regulator: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

1x 7812 Voltage Regulator: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

2x PCB Terminal: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

3x 47µF, 1x 22µF Capacitor: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

7x 220nF Capacitor: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

3x UF4007 Diode: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

2x 10kΩ, 2x 10Ω, 1x 2kΩ Resistor: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

2x 33µH Inductor: http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

Amazon.com:

1x 3.5mm Audio Jack: http://amzn.to/2qNwlMT

1x 10kΩ Potentiometer: http://amzn.to/2qNnpXy

1x LM393 Comparator: http://amzn.to/2ssBn2f

1x TLC555 Timer: http://amzn.to/2rGgUZX

1x 74HC04 Inverter: http://amzn.to/2qPW8YA

1x IR2113 MOSFET Driver: http://amzn.to/2rG7qxK

2x IRLZ44N MOSFET: http://amzn.to/2rFR3Bk

1x 7805 Voltage Regulator: http://amzn.to/2rGe1bL

1x 7812 Voltage Regulator: http://amzn.to/2qNx5S0

2x PCB Terminal: http://amzn.to/2qPZniW

3x 47µF, 1x 22µF Capacitor: http://amzn.to/2ssBJWD

7x 220nF Capacitor: http://amzn.to/2ssm3Tz

3x UF4007 Diode: http://amzn.to/2rFQd7S

2x 10kΩ, 2x 10Ω, 1x 2kΩ Resistor: http://amzn.to/2qPPnWG

2x 33µH Inductor: -

Amazon.de:

1x 3.5mm Audio Jack: http://amzn.to/2rpKbHN

1x 10kΩ Potentiometer: http://amzn.to/2rT8PSN

1x LM393 Comparator: http://amzn.to/2rG3dKL

1x TLC555 Timer: http://amzn.to/2qUBsd9

1x 74HC04 Inverter: http://amzn.to/2rGfizn

1x IR2113 MOSFET Driver: http://amzn.to/2rpQWtr

2x IRLZ44N MOSFET: http://amzn.to/2rT1X7R

1x 7805 Voltage Regulator: http://amzn.to/2ryYCI3

1x 7812 Voltage Regulator: http://amzn.to/2qUK5EG

2x PCB Terminal: http://amzn.to/2qQ1ymz

3x 47µF, 1x 22µF Capacitor: http://amzn.to/2qPYdE6

7x 220nF Capacitor: http://amzn.to/2rGg1k5

3x UF4007 Diode: http://amzn.to/2qUxLnM

2x 10kΩ, 2x 10Ω, 1x 2kΩ Resistor: http://amzn.to/2ryTxiV

2x 33µH Inductor: http://amzn.to/2rG8wtn

Step 3: Build the Circuit!

Here you can find the schematic of the project with and without the LM386 preamplifier. Feel free to use the pictures of my finished perfboard circuit as a reference.

You can also find the schematic on EasyEDA: https://easyeda.com/editor#id=74409197e62e4ff6b09d...

Step 4: Success!

You did it! You just built your own Class D Audio Amplifier!


Feel free to check out my YouTube channel for more awesome projects:

http://www.youtube.com/user/greatscottlab

You can also follow me on Facebook, Twitter and Google+ for news about upcoming projects and behind the scenes information:

https://twitter.com/GreatScottLab

https://www.facebook.com/greatscottlab

Comments

author
DmitriyU2 (author)2017-06-06

Great instructable and amazing video! Thank you!

What is missing, from my point, is a test for max power output, and distortions analysis.

author
bassbindevil (author)DmitriyU22017-06-29

Also, signal to noise measurements, and frequency response. RMAA could do that using a computer sound card, except there is the problem of the bridged output. I'd try a sound card with optical input and a battery-powered ADC with optical output (eBay, analog digital audio converter).

I suspect performance will be unimpressive, since there's no feedback. Suitable for a vehicle PA horn or siren, the kinds of music production applications where distortion is a good thing, or a science fair project. If you actually want to listen to music, there are awesome little class-D amp boards from China for the price of a burger combo.

author
Polymorph (author)2017-06-12

All the unused inverters need to have their inputs grounded. Never leave inputs floating.

author
asfi235 (author)2017-06-10

Yeah, there's a DC offset on the output which will toast the speaker. The easiest way to get around this with single-supply operation is to use a full-bridge circuit. Yes, more parts, but you get better fidelity too. See:
http://www.infineon.com/dgdl/an-1071.pdf?fileId=55...

[International Rectifier AN-1071: Class D Audio Amplifier Basics]

Adding the input buffer/preamp is an inherently good idea, though I don't see why you'd use a small power amp for the job. No harm in doing it this way, though.

The 74HC04 would be even better if you used it to buffer both phases. Fast clean edges are best. And ground the unused inputs on the IC!

author
slimtender. (author)2017-06-10

Very interesting circuit!

author
AgilePhil (author)2017-06-08

I would have used the other half of your comparator as the inverter instead of adding another IC, but otherwise a great project.

author
CarlosL210 (author)2017-06-06

Is the power source a 12v car battery?

author
GreatScottLab (author)CarlosL2102017-06-07

I used my lab bench power supply set to 15V.

author
CliveB10 (author)2017-06-06

Doesn't using a saw tooth wave instead of a triangle for the PWM make the amplifier non-linear, and create distortion? - I also agree with andyfras - you should decouple the speaker.

author
FindlayF (author)CliveB102017-06-07

Saw tooth or triangular does not matter. The slope of the ramp must be absolutely linear to give overall O/P linearity. This can be achieved b driving C5 with a switched constant current. Efficiency depends entirely on comp, buffer , mosfets switching as fast as possible.

Use of a large electrolytic to the speaker will stop possible core saturation of the inductor and the speaker.

author
ClaudioK3 (author)2017-06-06

Nice work, I m an audiophile end I like vacum tube, I have vacuum tube class A amplifier 2 x 11wat, interesting how 100y technology have implications in hi end, I D.I.Y my almost 3 maount and very happy with tube sound, if someone need to diagrams or any help about this, This is hard, because I m generation after tube technology, sorry for my bad English
C.

author
pro731 (author)2017-06-06

Well done, a very clearly presented video, and a great build.

author
PaulB63 (author)2017-06-06
author
DonnH1 (author)PaulB632017-06-06

I remember one or two guys building an X10 back in 1965. It was an amazing small amp with little distortion.

author
PaulB63 (author)2017-06-06

I got an old Sinclair X10 Class D amp working in the early 1970s .. it was originally released in 1964. It was horrible, but fun. I like yours much better.

https://en.wikipedia.org/wiki/Sinclair_Radionics mentions it.

author
loki2012 (author)2017-06-06

I like this instructable, I will try my had at it!

Is your schematic correct? On the input, you have the input ground going to the op-amp,and the left channel wired to the amp ground.

Tip is left, Ring is right, and the base is ground.

author
JonathanC256 (author)2017-06-06

How many Watt speakers can this drive?

author
andyfras (author)2017-06-06

The output will be at 1/2 VCC, so shouldn't the speaker be fed via a large value capacitor?

author
PaulB63 (author)2017-06-06

Nice description, good video. Are you sure your circuit diagram of J1 is the right way up? Earth should attach to barrel (and your soldered photo shows it correctly soldered that way).

author
Alexisgm97 (author)2017-06-06

Neat! Your PCB layout is amazing! No doubt I will make it!

About This Instructable

32,402views

317favorites

License:

Bio: Awesome Electronics Tutorials, Projects and How To´s
More by GreatScottLab:Make Your Own ESCDIY Short Circuit (Overcurrent) ProtectionMake Your Own Photovoltaic Off-Grid System
Add instructable to: