LM386 distortion

Thread Starter

adam450

Joined Mar 19, 2019
34
I've been playing with the LM386 for a couple days. I've tried various different schematics online.

If I plug the output of the LM386 into any raw speaker or amplified system, I get such bad distortion.
PC sine wave->Guitar Amp->Record speaker with mic (looks good).
Microcontroller sine wave->Guitar Amp -> Record speaker with mic (looks good).
Microcontroller sine wave->LM386->Guitar Amp (volume adjusted down)->Record speaker with mic ( awful distortion below).

Again I've tried all kinds of different capacitor setups, resistor setups. I tried a cheap 2 dollar speaker and an actual guitar combo amp, they both produce the same wave. Does this distorted wave look similar to a specific problem anyone has ever had?

Thanks

1616098606711.png
 

Audioguru again

Joined Oct 21, 2019
6,673
A genuine LM386 IC powered from 9VDC and driving an 8 ohm speaker through a series 470uF capacitor mounted with the correct polarity produces very low distortion when the output power is almost clipping at 0.45W.

Maybe you have a cheap fake LM386 from ebay?

It sounds like you do not have the LM386 feeding a series capacitor that feeds a low impedance speaker. Then it is a power amplifier that it is designed for but with a low output power before clipping. You are using it as a preamp without a correct load.

Did you try this circuit?:
 

Attachments

Thread Starter

adam450

Joined Mar 19, 2019
34
These were off Ebay but this is a pretty big disortion that I'm assuming is something wrong on my end that I need to compensate for.

I circled what I have different from the last schematic suggestion.
My values are slightly different due to parts on hand but very close. I've swapped with higher/lower values in every spot. I even have tried some extra capacitors on pins 2 and 4 that go to ground that I saw some people suggest. Nothing had any real affect on this distortion in my sine wave.

I've had C5 to the speaker go from 1uF up to 1000uF and only noticed a change in loudness. I've tried VCC 5V and 9V(battery). I could go grab my 12V supply as well but power doesn't seem to be the issue.

You can also see the issue I have from my sound wave recorded is not clipping.


1616109506993.png
 

Audioguru again

Joined Oct 21, 2019
6,673
Many 8 pin fake ICs from ebay are an old distorted low output LM358, or a mono copy of it.
Your output waveform shows the severe crossover distortion of an LM358 and its output current is too low to make much sound in a low impedance speaker, because it is an opamp, not a power amp.

The capacitance of C5 changes the output level of only deep bass frequencies. 100uF into 8 ohms cuts frequencies at 200Hz and below.

Do not buy ebay garbage, buy from a real electronic parts distributor like Digikey or Farnell.

The LM386 works best with a 9V supply and an 8 ohm speaker. Using a 12V supply causes almost the same max output level but a lot more heating.
 

BobTPH

Joined Jun 5, 2013
8,811
The LM386 is designed to drive a speaker directly, not an anplifier, so forget about sending the output to a guitar amp.

With no connection to pin 8, it has a gain of 200. The output from your “PC sine wave” is probably about 1V. Multiplied by 200, that is 200V. Which it cannot ouput, hence your distortion.

Tell us what you are trying to do, what is the input, what is the output, and we can tell you what you need. It might very well not be an LM386.

Bob
 

Audioguru again

Joined Oct 21, 2019
6,673
With no connection to pin 8, it has a gain of 200. The output from your “PC sine wave” is probably about 1V. Multiplied by 200, that is 200V. Which it cannot ouput, hence your distortion.
No, the gain if pin8 is not connected is 20 times and the waveform shows crossover distortion, not clipping distortion.
 

Thread Starter

adam450

Joined Mar 19, 2019
34
I'll take a look at getting some new LM386s but are there any other suggestions other than the LM386? TDA2822M , LM833N ?
 

Thread Starter

adam450

Joined Mar 19, 2019
34
I have 2x 8ohm 5-watt speakers that I want to drive audio to for a project. Just running from sd card to speaker.
 

Audioguru again

Joined Oct 21, 2019
6,673
A PAM8403 amplifier IC is was a modern class-D stereo amplifier IC. It is obsolete now but Digikey still has thousands in a surface-mount package and Chinese amplifier boards might be available. Its maximum allowed supply is 6V and with a 5V supply, It produces 1.4W per channel into 8 ohms or 2.5W into 4 ohms, with fairly low distortion.

Texas Instruments has many amplifier ICs. Most are in tiny surface-mount packages.
 

Thread Starter

adam450

Joined Mar 19, 2019
34
Ok, so the chip wasn't the problem here. So lack of experience with audio is the problem.

PC 3.5mm headphone output -> LM386-> 1Watt speaker -> Sounds Great. Amp circuit works.
3.3V Arduino reading a WAV file and output on a DAC pin. -> Headphones sounds good.
3.3V Arduino .... -> .1uF cap -> LM386 input ->1Watt speaker (BAD)

I was reading some things about having to shift my arduino signal from 0 to 3.3, to -1.65 to 1.65. I wasn't sure if this is possible without an extra DAC IC. Appreciate it everyone thanks. I did try some new audio chips but that showed right away not to be the issue.
 

Audioguru again

Joined Oct 21, 2019
6,673
The LM386 amplifier must have an input with 0VDC. If your input is 0V to 3.3V then simply connect a series coupling capacitor to pass the audio AC but block the DC. The LM386 amplifier also has an output coupling capacitor to feed the audio AC to the speaker but block the DC.
 

Attachments

Top