Skip to content

Hardware Hack PAM8403 Amplifier Power Off

Alvin Schiller edited this page Apr 3, 2024 · 2 revisions

Intro

Before I found this project I had found another project where PAM8403 was used as amplifier for the speakers. When I put everything together and in my room it was very quiet I heard a little noise coming from speakers even system was shutdown and in Firmware halt. This is because the 5V PIN has even power while raspberry pi is in halt. As a result the amplifier will not be switched off anytime.

Build PAM8403 shutdown (hardware)

This pictures show how to wire it.

The PAM8403 has 16 pins. It seems that not all PCBs has the same layout but the pins of the chip are the same. See the Pin above the 4 in PAM8403. It is called PIN 12. This pin is connected on the most boards directly to the 5V input of the board to always enable this chip. The connection between 5V and PIN 12 was cut at the red mark shown in the picture. I used a scalpel for cutting and a multimeter for continuity testing (DurchgangsprΓΌfung) between PIN12 and 5V. If there is still a connection between P12 and 5V you maybe damage your GPIO Port used for enabling/disabling later the amplifier.

From the picture you see that you need to connect the PIN12 to ground to pull down the pin and connect the PIN12 to one GPIO Port. I first soldered the resistor on one end to pin 12 and on the other to GND. Then I attached a wire to connect the GPIO to the resistor. My cabling doesn't look good but it just works.

I connected the PIN12 of the PAM8403 board to GPIO23 (PIN16) of the Raspberry PI. Now the amplifier is active when this GPIO is sending a high signal to amplifier. If you want to to use another pin you need to change the script in the next section. Please consult the pin out to find available pins for your project.

Setting up the software

Copy the service file to the systemd folder:

sudo cp /home/pi/RPi-Jukebox-RFID/misc/sampleconfigs/phoniebox-activate-amplifier.service-default.sample /etc/systemd/system/phoniebox-activate-amplifier.service

Now systemd has to be notified that there are new service files:

sudo systemctl daemon-reload

Enable this service:

sudo systemctl enable phoniebox-activate-amplifier

Start this service:

sudo systemctl start phoniebox-activate-amplifier

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