-
Notifications
You must be signed in to change notification settings - Fork 0
TPA3118 Power Off and EMI improvement
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.
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.
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.
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.
If you like Phoniebox, consider: buy me a coffee or PayPal
- Code: https://github.com/MiczFlor/RPi-Jukebox-RFID
- Phoniebox home page: English | Deutsch
Phoniebox is a contactless jukebox for the Raspberry Pi, playing audio files, playlists, podcasts, web streams and spotify triggered by RFID cards. All plug and play via USB, no soldering iron needed. Update: if you must, it now also features a howto for adding GPIO buttons controls.
Visit Phoniebox.de
π₯ Version 3
- β Releases
- π΅ Install Jukebox Version 3
- π Report a bug
- π Propose a feature
- βοΈ Feature Status
- π Documentation
- π©βπ» Development
- βοΈ Contributing
- π¦ Code
πΆ Version 2
- β Releases
- π΅ Install Jukebox Version 2
- π Report a bug
- βοΈ Features
- π Documentation
- βοΈ Contributing
- π¦ Code
Version 2 Pages
-
Setup / Upgrades
- Synchronising Phonieboxes in a local network
- Smart Home remote control with MQTT
- Hardware Pinout Overview
- Systemwide Equalizer
- Phoniebox with read-only Filesystem
- HiFiBerry Soundcard Details
- WM8960 Hi-Fi HAT
- PAM8403 Amplifier Power Off
- TPA3118 Amplifier Power Off and EMI improvement
- External Non USB Audio DAC ES9023, PCM5102, etc.
- On-board LEDs with fibre optics
- Setting GPIOs at boot time
- Stop on removal with USB RFID Reader
- Firmware update improves audio out
- Architecture