Skip to content

TPA3118 Power Off and EMI improvement

martinclausen2 edited this page Feb 15, 2019 · 3 revisions

Introduction

Similar to the hack shown here, I wanted to shutdown the amp, when the Pi shuts down. Since I use a Pi Zero W, I had to modify the code to use RPi.GPIO instead of the gpiozero lib, which loads much faster and enables the sound earlier. Otherwise the startup sound was not audible.

Hardware Connections

I use a TPA3118 mono class-D amplifier board as found on ebay etc. The SDZ pin (pin no 2) is permanently pulled to the amplifiers Vcc by R2. The resistor needs to be removed and a thin cable is attached to the pad connected to the TPA3118 (this happens to be the one closer to the IC on my pcb). The other end of the cable is connected directly to the GPIO. A pull down resistor of say 10k is required to avoid undefined status of the amplifier. Advice: Do check that the connection to the pin is made correctly to avoid frying your pi! Hot melt glue enables some degree of shock resistance for this connection.

Differential Input and Gain Adjustment to Reduce Noise

The pcb I received directly grounds negative input on the input connector and the negative input capacitor next to the amplifier. So the layout effectively degrades the differential amplifier to the single ended one. I highly recommend to make a truly differential connection to reduce EMI interference. To do so remove C1 and C2 and replace them by 1Β΅F/50V X7R caps (just to be sure replace them, you could also reuse the original ones of what ever quality) mounted upright. 1Β΅F is sufficient for 20dB gain setting (see datasheet for details and other gain settings) Then connect a shielded cable to the input source and ground the negative input there if it is single ended. If you have a signal source with a high level output (e.g. my ES9023 DAC) you can reduce the gain of the TPA3118 to the minimum gain of 20dB (my pcb came with resistors for the maximum gain of 36dB). To do so remove R3 (75k) and replace R4 (47k) with 5.6k SMD 0805 5% or better resistor. As a result there is no audible noise during silence anymore, the frequency response is flatter and the audio quality is generally improved.

Decoupling Caps

On my PCB the decoupling caps were missing. However, empty pads labeled C8 and C9 were there. Place on each position one 0805 NP0 1nF 50V cap and one 0805 X7R 1Β΅F 50V cap. You can stack them.

Home

πŸ”₯ Version 3

Version 3 Pages

Nothing yet

🎢 Version 2

Version 2 Pages

Installation

Specials

RFID Reader

Sound card configurations

Hardware Buttons

Displays (LED, LCD, Matrix, etc.)

Hacks

Bluetooth

AirPlay

MPD tricks

For Developers

Clone this wiki locally