brandoncheah
Posts: 20
Joined: Thu Sep 27, 2018 9:52 am

LM386 Audio Amp Module Producing buzzing/cracking noise

Fri Apr 26, 2019 5:58 am

I've connected my circuit as you can see in the image below:

LM386 module: https://www.lelong.com.my/lm386-chip-20 ... Sale-P.htm

It produces white noise, cracking/buzzing when its connected to the 5V and GND GPIO pins on the RPi

I've tried to use an additional power supply for the audio amplifier and it doesn't produce as much noise as the previous method

However I only wish to use 1 power supply, is there any methods like connecting resistor or capacitor helps to smoothen the connections?
I am not an expert in electronics, I think I am facing the ground loop issue but I am not sure about it, or how to solve it

If possible, please guide me on how to add electronic components like resistor/capacitor into the circuit to eliminate the cracking noise

Thank you
Attachments
AudioAmp.PNG
AudioAmp.PNG (29.33 KiB) Viewed 646 times

User avatar
Joel_Mckay
Posts: 289
Joined: Mon Nov 12, 2012 10:22 pm
Contact: Website

Re: LM386 Audio Amp Module Producing buzzing/cracking noise

Fri Apr 26, 2019 9:57 am

Many low-end sound-cards use a rather noisy class-d amplifier for the audio output.
The picture/site doesn't really give enough details about the amp or sound-card.

However, if a pair of headphones in the sound-card sound fine, than there are several possibilities:
1. you are over-driving the input and causing the amp to clip and sound bad. You can often reduce the sound output volume, but a resister-divider is normal to see on the input of these little audio amps.
See: https://en.wikipedia.org/wiki/Clipping_ ... rocessing)
And: https://electronics.stackexchange.com/q ... capacitors

2. digital noise on the power bus probably needs a better filter, so a few 1uF 16vDC and 100uF 10vDC electrolytic capacitors in parallel across your +5 to GND on the amp power-input may help somewhat.
See: https://en.wikipedia.org/wiki/Decoupling_capacitor

3. Although some will leave it out, a DC blocking element on the amp input may help in some cases. try 100uF on your sound-card output, as class-d amps can often benefit from a bit of filtering.
See: https://electronics.stackexchange.com/q ... r-block-dc
And: https://www.youtube.com/watch?v=pyBkns9Qh3w

Cheers,
J

LTolledo
Posts: 1942
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: LM386 Audio Amp Module Producing buzzing/cracking noise

Fri Apr 26, 2019 10:02 am

I also gave up the idea of a single power supply for both the RPi and the audio amp, even if I get the power for the amp directly from the 5v PSU. (not using the GPIO 5v source).

you may try to experiment as much, it will only cost more. try adding a ground fault isolator unit between the USB sound card and the amp.

separate PSU is still best solution
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

User avatar
Burngate
Posts: 6003
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: LM386 Audio Amp Module Producing buzzing/cracking noise

Fri Apr 26, 2019 5:25 pm

brandoncheah wrote:
Fri Apr 26, 2019 5:58 am
I've tried to use an additional power supply for the audio amplifier and it doesn't produce as much noise as the previous method

I think I am facing the ground loop issue but I am not sure about it, or how to solve it
You may very well be right about the ground-loop.
One way to check is to disconnect either the ground from the GPIO header, or the ground of the input

There are audio isolators around, with transformers in them. You could try one of them.

gordon77
Posts: 4162
Joined: Sun Aug 05, 2012 3:12 pm

Re: LM386 Audio Amp Module Producing buzzing/cracking noise

Fri Apr 26, 2019 6:36 pm

Any reason why you are using a usb audio adaptor and not just using the pi audio output on the 3.5mm jack?
I haven't tried it but presumably will give one less stage of amplification and potential noise.

LTolledo
Posts: 1942
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: LM386 Audio Amp Module Producing buzzing/cracking noise

Sat Apr 27, 2019 10:48 am

In my earlier test (when my RPi3B was still sporting Jessie) the audio coming from RPi3B's audio jack was more noisy than the USB sound dongle (sound blaster X-Fi).

Even using ferrite beads on the power side (both the amp and RPi) the cracks, crackles, buzzing sound didnt go away. Was much lesser when battery powered, but not practical for my use case.

My first DIY amp was based on JRC 2073D audio amp IC and was quite "sensitive" to noise, just moving a wired mouse made the noise worse.

Powering the RPI and audio amp separately was the best solution for me that time, the PSU for the amp being from the one sold in a dollar store.
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

User avatar
TimG
Posts: 291
Joined: Tue Apr 03, 2012 12:15 am
Location: Switzerland

Re: LM386 Audio Amp Module Producing buzzing/cracking noise

Sat Apr 27, 2019 12:55 pm

- The LM386 has two audio inputs: inverting and non-inverting. Are they both connected to something?
- The speaker output needs a DC-blocking capacitor.
- Likely the USB headphone output needs a load. Connect a set of headphones in parallel.

If you still get distortion, you may need DC-blocking capacitors and bias resistors on the LM386 inputs. But try the things above first.

The LM386 datasheet has a useful minimal circuit diagram:
http://www.ti.com/lit/ds/symlink/lm386.pdf

Return to “Advanced users”