In this project guide, we show you how to make your own class-D amplifier using the versatile Desktop PCB Milling Machine. This amp combines high-power efficiency, power output, and audio quality. This circuit is designed for 4Ω speakers in a stereo configuration. Let’s get rockin’ and rollin’.
TOOLS
- Bantam Tools Desktop PCB Milling Machine
- Computer with Bantam Tools Desktop Milling Machine Software installed
- Flat end mill, 1/32"
- Bit fan
- Alignment bracket
- Soldering iron
- Diagonal wire clippers
- USB cable
MATERIALS
- PCB blank, FR-1, single-sided
- Tape, high-strength, double-sided
- Speakers, 4Ω (2)
- Audio power amplifier, TPA3122, DIP-20
- DIP socket, 20-pin
- Horizontal stereo jack
- DC barrel jack
- Inductor, 22uH (2)
- Polar electrolytic capacitor, 1000 uF
- Polar electrolytic capacitor, 10 uF
- Polar electrolytic capacitor, 1 uF (4)
- Resistor, 0.68 uF, SMD 0805 (2)
- Resistor, 0.22 uF, SMD 0805 (2)
- Resistor, 0.1 uF, SMD 0805 (3)
FILES
- Class-D-Amplifier.brd file downloaded
Step 1: Set up your job.
Hook up the Desktop PCB Milling Machine to your computer, open the Bantam Tools Desktop Milling Machine Software, and home the mill. Next, install the alignment bracket onto the spoilboard. In the Bantam Tools software, under Fixturing, select Locate and follow the instructions.
Note: Using the alignment bracket will ensure that your board is perfectly squared in the front left corner. If you haven’t installed the alignment bracket before, follow the steps in our support guide.
Now it’s time to set up your job. If you need more guidance on how to load your tool or enter information into the software, refer to the Light-Up PCB Badge project.
- Double-check to make sure it says Bracket under Fixturing.
- Select the 1/32” Flat End Mill, load it into the mill with the bit fan attached, and locate the tool.
- In the Material dropdown menu, select Single-Sided FR-1.
- Measure and enter dimensions in the X, Y, and Z values under Material for the FR-1. Then apply high-strength, double-sided tape on the backside of the PCB, and place it onto the spoilboard so it aligns with the corner of the alignment bracket.
- Be sure to account for the tape’s thickness (Z height) under Material Placement. The thickness of the high-strength, double-sided Nitto tape we sell in our store is typically 0.006 in.
Step 2: Import your file.
In the Bantam Tools software, under Plans, click Open Files and select the Class-D-Amplifier.brd file. Under plans, select the 1/32” flat end mill. For this project, we used the following recipe.
For the 1/32" flat end mill:
- Feed Rate: 59 in/min
- Plunge Rate: 15 in
- Spindle Speed: 25,000 RPM
- Stepover: 49%
- Pass Depth: 0.010 in
Your mill time will also vary depending on your speeds and feeds recipes. If you’d like to adjust your speeds and feeds to match ours, click File > Tool Library > Add Tool. Name your new tools and then input the speeds and feeds recipes. You can learn more about customizing your Tool Library in our guide.
Step 3: Start milling.
When you’re ready, click Start Milling!
Step 4: Solder the components.
Lay out your components and turn on your soldering iron. It’s easiest to solder the components in the following order:
- SMD components
- Audio power amp and IP socket
- Audio jack
- DC barrel jack
- Screw terminals
- Inductors
- Electrolytic caps
- Speakers
This stereo class-D amplifier uses the TPA3122 IC to do the heavy lifting and is capable of driving up to 15W per channel. The circuit takes an input signal and converts it into a high-frequency square wave. The high frequencies are then filtered out using an LC lowpass filter, leaving the amplified version of the original signal to be transmitted to the speakers.
The circuit operates on 12V with Pins 1 and 10, which supplies power to the left and right channels’ internal H-bridges. These aren’t powered internally by the AVCC pins, which are powered separately on Pins 16 and 17. The shutdown pin is connected to 12V, and mute is connected to ground since the circuit doesn’t include external controls. The LIN (left in) and RIN (right in) pins are connected to a 3.5 mm input jack through 1 uF capacitors for filtering out the low frequencies of the input signal.
Also note that connections on Pins 14 and 15 are used to set the overall gain of the amplifier. The TPA3122 allows for four configurations (see table below). The circuit is currently configured for a gain of 26 dB, however it could easily be adjusted for a lower/higher gain.
Pins 12 and 19 emit the left and right signals and are followed by an LC filter and coupling capacitor. The circuit is designed in a 4Ω, single-ended (SE) configuration with the LC filter speced according to this datasheet for optimal performance.
The board should look like this once you’ve assembled and soldered it.
Congrats on making your own class-D amplifier using your Desktop PCB Milling Machine! If you want to take your amplifier to the next level, mill an enclosure to house your circuit and speakers. We made our enclosure using scraps of polycarbonate and acrylic.
Here are resources to help you get started with designing enclosures for your electronics: