LM386 Resonance Mystery

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hi All,
I'm building a little theremin/synth thingy as a present for my sister, who's a musician. For the I/O and tone generation, I'm using an Arduino microcontroller, and for the audio output I'm using an LM386 amplifier and a little 8ohm speaker I pulled out of a clock radio. I'm not expecting awesome audio quality out of this setup, but I've got this odd resonance thing happening when I connect the speaker.

Here's a picture of the trace on my oscilloscope without the speaker connected:
An externally hosted image should be here but it was not working when we last tested it.


Looks exactly like the intended waveform. But, once I connect the speaker to the amp, I get this:
An externally hosted image should be here but it was not working when we last tested it.


That fuzzyness on the bottom of the waveform is audible as a high pitched tone. I'd like to get rid of it, if possible.

I'm using the example circuit in the datasheet, with the addition of a low-pass filter before the circuit to get rid of the pin noise from the microcontroller. For convenience, here it is:
An externally hosted image should be here but it was not working when we last tested it.


Any help is greatly appreciated, sorry if this is a common question but I don't know what it's called so I don't know what to search for. Thanks!
 
I tried putting a bypass cap on pin 7 to ground, with a variety of small values-- 2.2uF, 10uF, 33uF with no effect.

I've currently got the power supply bypassed with a 4000uF cap, and I also added a .1uF ceramic bypass, with no effect. I don't think it's a power supply problem, because when the amp is just idling, there's <10mV ripple voltage coming through the audio.

I did notice one thing: when I sweep it through frequency, the bounce or fuzz or whatever is minimal around 250Hz, and increases as I change the frequency away from 250Hz.

Thanks for your help so far, I am ???
 
The LM386 is famous for this sort of thing. If you can use one of the newer IC power amps, you'll find it far easier. Layout is critical- any path from output to input will cause oscillation so the 386 is very sensitive to grounding. Single point recommended. Think about how current to the two ground points to the right can cause a voltage rise on the pot and into the positive input. All traces have resistance. I have a whole tube of the silly things and shudder whenever I have to use one.
 
That kind of oscillation is usually related to speaker load inductance and an inadequate output zobel. The original zobel values for this family of amplifiers was .1 uF in series with a 2.7 ohm resistor (as opposed to the .05 uF and 10 ohms shown in the application notes for the LM386). If you mess with these values you may have a fair chance of eliminating the oscillation. Try going up to .1 uF first, if that doesn’t cure it, start lowering the R value in conjunction with the .1 uF cap. Good luck …
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.