gandar
Posts: 215
Joined: Sat Feb 01, 2014 5:45 pm

noise through amp powered by 5v gpio

Wed Oct 29, 2014 4:37 am

Hi all.

I made an amp using the lm386 chip and it plays well off of a separate battery supply however when I attempt to power the amp through my RPI gpio 5v out, I get loads of noise. I tried some pass filters but had no real luck.

Any ideas? It would be nice to use the 5v out for simplicity and package constraints.

Thanks for looking.

ceteras
Posts: 239
Joined: Fri Jan 27, 2012 1:42 pm
Location: Romania

Re: noise through amp powered by 5v gpio

Wed Oct 29, 2014 9:22 am

I've met this kind of noise before, it's a ground loop issue.
In theory, all ground points are at the same voltage, but in reality this is not true.
So it matters a lot where on the Pi you connect your amplifier ground connection. Try different places, I would recommend as close as possible to the power micro-usb connector.

Also a better approach is to separate the ground traces for small signals from those for power signals.
That is, inputs on one trace, then power supply and outputs on another.
The pin #2 of LM386 and the potentiometer ground should go to the audio out jack ground. Then the other ground connections should go somewhere as near as possible to the micro-usb power connector on the Pi.

gandar
Posts: 215
Joined: Sat Feb 01, 2014 5:45 pm

Re: noise through amp powered by 5v gpio

Wed Oct 29, 2014 4:09 pm

ceteras wrote:I've met this kind of noise before...

The pin #2 of LM386 and the potentiometer ground should go to the audio out jack ground. Then the other ground connections should go somewhere as near as possible to the micro-usb power connector on the Pi.
Ceteras,

Thanks loads for the information. I will try this today and let you know the results.

gandar
Posts: 215
Joined: Sat Feb 01, 2014 5:45 pm

Re: noise through amp powered by 5v gpio

Thu Oct 30, 2014 4:05 am

Ceteras,

I was not able to get rid of the noise by jumping to any other ground pins in the pi's GPIO. It looks like an external power source will be my best option here.

Thanks for your help.

Sincerely,
Gandar

ceteras
Posts: 239
Joined: Fri Jan 27, 2012 1:42 pm
Location: Romania

Re: noise through amp powered by 5v gpio

Thu Oct 30, 2014 12:59 pm

I'm sorry you didn't find a solution, even if I didn't expect it to be easy to fix.
I think none of the gpio gnd pins are appropiate for this, rather you'd need to find a better ground point on the board and solder your connection there.
I think I'm going to try this too, soon, because I want to build a small internet radio with a raspberry pi.
What kind of speaker did you use for your project?

gandar
Posts: 215
Joined: Sat Feb 01, 2014 5:45 pm

Re: noise through amp powered by 5v gpio

Thu Oct 30, 2014 2:48 pm

Ceteras,

I used a small .5 watt 8 ohms speaker that I salvaged from a non amplified pair of speakers that I purchased from a dollar store.

The speaker sounds fine and using a 9v battery isn't terribly bad but I hope to find another way.

I wish you luck.

Aydan
Posts: 704
Joined: Fri Apr 13, 2012 11:48 am
Location: Germany, near Lake Constance

Re: noise through amp powered by 5v gpio

Thu Oct 30, 2014 5:09 pm

I don't think the ground is your problem, but noise on the 5V rail from current ripple (caused by the SOC) and thus voltage ripple over the polyfuse.
You might be able to get rid of that with a LC filter between the Pi and your amp supply input.

Regards
Aydan
Last edited by Aydan on Fri Oct 31, 2014 6:14 pm, edited 1 time in total.

pksato
Posts: 295
Joined: Fri Aug 03, 2012 5:25 pm
Location: Brazil

Re: noise through amp powered by 5v gpio

Fri Oct 31, 2014 11:41 am

Hi,
LM386 is very sensible for noise from power line.
Noise come from PSU and RPi.
Have some way to reduce this type of noise.
Low pass filter on 5V line, a low value resistor <10Ohms and a 470uFx10V capacitor.

Code: Select all

5V---[R]----[C]--->lm386
Resistor can be replaced by a diode (1N4001).

A LDO voltage regulator, drop 5V to 3v3 or 4.5V. Proper decoupled.

A NPN transistor configured as voltage flow.

A 100uF to 470uF capacitor need to placed very near to LM386 power pins (+v and gnd).

RPi audio out have high level, not need lots of gain on power amplifier, put LM386 on low gain mode, removing capacitor between pin 1 and 8.

My be, a extra filtering need on RPi audio out.

Return to “General discussion”