How to Build a Class-D Audio Amplifier: TPA3116, Power Supply, and Speaker Matching
Introduction
A Class-D audio amplifier is the most efficient way to drive speakers from a DC power source. Unlike traditional Class-AB amplifiers that waste 50%+ of power as heat, Class-D amps use pulse-width modulation to achieve 90%+ efficiency, meaning a small amplifier board can deliver 50W or more to a speaker while staying cool enough to touch. The TPA3116D2 from Texas Instruments is the gold standard chip for DIY audio — it is cheap, sounds excellent, and powers everything from desktop speakers to portable boomboxes. This guide covers the complete TPA3116 build: power supply selection, speaker impedance matching, Bluetooth integration, enclosure design, and tuning for the best possible sound.
What You Need
- TPA3116D2 amplifier module (dual 50W or 2.1 channel with sub)
- DC power supply: 12V-24V, 3A-6A depending on target output
- Speakers: 4Ω or 8Ω full-range drivers or component set
- Bluetooth audio receiver module (optional)
- Enclosure: 3D printed, wood box, or repurposed speaker cabinet
- Speaker wire, heat shrink, connectors
Understanding Class-D Amplification
Class-D amplifiers do not amplify the audio signal in a linear analog path. Instead, they:
- Convert the analog audio input into a high-frequency PWM square wave
- Amplify the square wave using MOSFET switches (very efficient)
- Filter the output through an LC low-pass filter to reconstruct the amplified analog signal
- Send the result to the speaker
The TPA3116D2 switches at ~300kHz, well above audible range. The output filter removes the carrier frequency, leaving clean audio.
Step 1: Choose Your Amplifier Module
TPA3116D2 Dual-Channel (Stereo)
- 2 × 50W into 4Ω at 21V
- 2 × 30W into 8Ω at 24V
- Best for: Desktop speakers, bookshelf systems, portable audio
TPA3116D2 2.1 Channel
- 2 × 50W (left/right) + 1 × 100W (subwoofer)
- Built-in crossover: sub gets frequencies below 200Hz
- Best for: Full-range systems with dedicated bass
TPA3118 (Lower Power, Lower Cost)
- 2 × 30W into 8Ω
- Single-channel option available
- Best for: Small desktop speakers, battery-powered projects
Step 2: Power Supply Selection
The TPA3116 performs best at 18-24V. Higher voltage = more power, but exceeding 26V damages the chip.
Voltage vs. Power Output
Supply Voltage4Ω per channel8Ω per channel 12V15W8W 18V30W18W 21V50W25W 24V50W (current limited)30WPower Supply Options
- 19V laptop brick: Perfect for TPA3116, widely available, 3-6A
- 24V LED power supply: Cheap, high current, but may have audible switching noise
- 18V drill battery: Portable option, works with Ryobi/Makita battery adapters
- 12V lead-acid battery: For car audio or outdoor events
Current Requirements
Formula: Current = Total Wattage / Voltage / Efficiency
For 2 × 50W at 21V with 90% efficiency: 100W / 21V / 0.9 = 5.3A minimum
Step 3: Speaker Selection and Matching
Impedance
- 4Ω speakers: Maximum power output, but amplifier runs hotter and needs beefier power supply
- 8Ω speakers: Lower power but safer for the amplifier, better for battery-powered builds
Driver Types
- Full-range drivers: Single driver handles all frequencies. Dayton Audio DMA45, Tang Band W3-1876, Visaton FR8. Simple, no crossover needed.
- Component systems: Separate woofer + tweeter with a passive crossover. Better frequency response but more complex.
- Subwoofer: Dedicated low-frequency driver. Needs 2.1 amplifier or active crossover.
Sensitivity
Measured in dB at 1W/1m. Higher sensitivity = louder at same power:
- 85dB: Needs more power, common in cheap drivers
- 88-90dB: Good all-around range
- 93dB+: Very efficient, excellent for low-power builds
Step 4: Wiring the Amplifier
Basic Stereo Setup
- Connect power supply VCC and GND to amplifier module
- Add a 1000μF+ capacitor across power input near the board
- Connect audio source to 3.5mm input or RCA jacks
- Connect left speaker to L+ and L- terminals
- Connect right speaker to R+ and R- terminals
- Turn volume to minimum before first power-on
Gain Setting
The TPA3116 has a gain pin (GAIN0, GAIN1) that sets amplification:
GAIN1GAIN0Gain LOWLOW20dB (10x) LOWHIGH26dB (20x) HIGHLOW32dB (40x) — most common HIGHHIGH36dB (63x)32dB is the sweet spot for most line-level sources. Higher gain introduces more noise.
Step 5: Add Bluetooth
Bluetooth receiver modules make your amplifier wireless:
- Purchase a Bluetooth 5.0 audio receiver with 3.5mm or line-level output
- Wire module VCC (3.3V or 5V) and GND to a regulator off the main supply
- Connect audio output to TPA3116 input
- Pair with your phone — audio now routes wirelessly
Popular modules: MH-M18, MH-M28, or CSR8645-based boards.
Step 6: Enclosure and Acoustics
Enclosure Design
- Sealed box: Tighter bass, simpler design. Volume = driver Vas × 1.5-2.0
- Bass reflex (ported): More bass output, lower extension. Requires port calculation
- Transmission line: Complex but excellent bass from small drivers
Materials
- MDF (12-18mm): Best acoustic properties, easy to work with
- Plywood: Good alternative, lighter than MDF
- 3D printed: Convenient for small speakers, use 3+ walls and high infill to reduce resonance
Internal Damping
- Line walls with acoustic foam or polyester pillow stuffing
- Reduces standing waves and cabinet resonance
- Fill ~50% of empty volume for sealed boxes
Step 7: Tuning and Testing
First Power-On
- Start with volume at zero
- Power on the amplifier
- Slowly increase volume while playing music
- Listen for distortion, clipping, or buzzing
- If you hear distortion at moderate volume: gain is too high or power supply is insufficient
Measuring Output Power
- Play a 1kHz sine wave at known input voltage
- Measure AC voltage across the speaker terminals with a multimeter
- Power = Voltage² / Speaker Impedance
Heat Management
- The TPA3116 has built-in thermal protection at 150°C
- Add a heatsink to the chip for continuous high-power use
- Ensure ventilation in the enclosure
- At moderate volumes, the chip stays cool to the touch
Troubleshooting
- No sound: Check power LED, verify input connections, test with different source
- Humming/buzzing: Ground loop — use same power source for amp and source, or add audio ground loop isolator
- Distortion at high volume: Power supply sagging — upgrade to higher current supply, or reduce gain
- Overheating: Add heatsink, reduce volume, check speaker impedance (4Ω runs hotter)
- Bluetooth dropouts: Keep antenna away from power wires, add ferrite bead on power leads
Pro Tips
- Upgrade input capacitors to WIMA or Nichicon for better sound quality
- Use star grounding: all ground points connect at a single point to prevent ground loops
- Add a volume potentiometer (10kΩ dual-gang log taper) for analog volume control
- For portable builds, a 5S Li-ion pack (18.5V nominal) powers the TPA3116 for hours
- Bi-amp configurations (separate amps for woofer and tweeter) eliminate passive crossover losses
Conclusion
The TPA3116D2 makes high-quality audio amplification accessible to any maker. With a $5 amplifier module, a laptop power brick, and a pair of full-range drivers, you can build a speaker system that rivals commercial products costing 10x more. The keys are proper power supply sizing, speaker impedance matching, a well-designed enclosure, and attention to grounding. Whether you are building desktop monitors, a portable boombox, or a home theater subwoofer, Class-D amplification delivers the power and efficiency modern audio demands.
Related Guides
- How to Build a Class-D Audio Amplifier: TPA3116, Power Supply, and Speaker Matching
- How to Build a LiPo Battery Charger with the TP4056: Circuits, Safety, and BMS Integration
- ESP32 I2S Audio: Playing and Recording Sound with a MAX98357A DAC and INMP441 Microphone
- How to Build a LiPo Battery Charger with the TP4056: Circuits, Safety, and BMS Integration
- Build a Bluetooth A2DP Audio Receiver with ESP32
- How to Salvage Electronic Components from E-Waste: Desoldering, Testing, and Reuse
- How to Program Addressable LED Strips: WS2812B Patterns, Effects, and Power Design
- I2C vs SPI vs UART: How to Choose and Use Serial Communication Protocols