User avatar
Imperf3kt
Posts: 1116
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Strange behaviour of amplifier when connected to Pi0

Mon Apr 23, 2018 12:24 am

I am trying to get audio out of the GPIO on a Pi0 by using a PWM signal and have almost finished but I've hit a small problem that baffles me and was hoping someone might be able to shed some light.

I followed a guide I found on the Raspberry Pi blogs and it utilises GPIO 18 and GPIO13. This worked great and I was able to get good quality line level audio from this method.
I decided to add an amplifier and this is where things got strange.

Here is my wiring:
Image

And here is the PAM8406 module I am using (generic link)
https://www.ebay.com.au/itm/PAM8406-5Wx ... 2326432138

Using this works brilliantly and I am pleased with the sound quality. I made a heatsink for the microchip though as it did get hot once some months back.

Anyway, I was powering this through two 18AWG micro USB cables which were connected to one of the following setups.
A car battery with buck capable of [email protected]
A portable mobile phone charger capable of 2.4A @5.2v (3.4A total output) - the amp is powered via the USB port on the Pi
Multiple 1A phone chargers
AC 240v to DC 5.1v 2x2.4A USB power supply 4.8A total (not a charger)

All of the above methods of poweing both the Pi0 and amp work great and I can adjust the volume using the potentiometers on the amp.

What does not work, is if I power both the Pi and amp from Pin 2 and 39. All I get is line level audio that I cannot adjust. I also get a really strange noise during boot. It is a pitch that slowly increases in frequency until it peaks, then it'll drop a bit, then increase and decrease randomly before finally dropping to nothing just as booting finishes.

Does anybody understand what is happening here? I was under the impression that this should be the same as powering through USB, which is working fine.
Is there a mistake in my wiring? I've checked my wires multiple times and am 300% sure they are definitely exactly as shown in the diagram above.
Cutting the wire between Pin 2 and the amp, then powering them separately, stopped the strange bahaviour.

I am not using a breadboard, but rather a perfboard.
I can supply pictures and audio/video samples if required.
User experiencing technical difficulties.

User avatar
Imperf3kt
Posts: 1116
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Strange behaviour of amplifier when connected to Pi0

Thu Apr 26, 2018 9:43 pm

I found the problem, I was relying on a single grounding point and after much testing and head scratching I discovered that the traces on the Pi were too thin to carry the current.

I solved the problem by adding a second ground connection.
User experiencing technical difficulties.

Return to “Troubleshooting”

Who is online

Users browsing this forum: arkader and 26 guests