Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LM386 woes?

Status
Not open for further replies.
Hey there folks,

I had a problem with the LM386 amplifiers I bought. Hooked it to a polyphonic microcontroller-based music generator which has two-channels inside, and I get very bad, static and also hissing noise. Worse, the two channels couldn't mix properly, resulting in the other channel being more louder than the other. The speaker, which has two wires connected on it, when I lifted the speaker some more, the sound went away, and something else overpower the sound output.

I wired the LM386 as shown in the datasheet, the low component count, 20 Gain only. What could be the problem?
 
It's a general purpose, common usage 8-ohm impedence speaker. Must I put some more filter capacitors?

Edit: There is the music, but I doubt there is 20 Gain inside as I only get to hear half as loud sometimes, and it's sizzling and clicking like some sorta old jukebox. It couldn't mix with two channels properly.
 
Last edited:
Where did you download the datasheet? It would be easier to help if I could see what you're working with. Did you substitute any parts? How are you trying to mix two channels of audio?
 
It's a general purpose, common usage 8-ohm impedence speaker. Must I put some more filter capacitors?

Edit: There is the music, but I doubt there is 20 Gain inside as I only get to hear half as loud sometimes, and it's sizzling and clicking like some sorta old jukebox. It couldn't mix with two channels properly.

The LM386 is a cheap, low quality audio amplifier, intended for general purpose work. It should not be expected to produce audiophile quality. At the very best, it will only provide a few milliWatts of power.
 
The LM386 is a cheap, low quality audio amplifier, intended for general purpose work. It should not be expected to produce audiophile quality. At the very best, it will only provide a few milliWatts of power.
The LM386 will produce 450mW at clipping with a 9 supply.
slightly below clipping its distortion is only 0.1% and its bandwidth is as low as the size of the capacitors allow and up to 300kHz when the gain is 20. It sounds very good.
 
The LM386 is a somewhat ancient part, but it can work ok within its limits. It does have a terrible tendency to oscillate at high frequencies, which is what your problem sounds like. Be sure the part is bypassed right next to the chip, and that the return line for the load isn't connected where it can generate any possible tiny signal in the input. Layout and bypassing with this chip is everything. IMHO, the newer stuff is far easier to work with.
 
Oh I see. Well, the LM386's brand is UTC, and it's connected with a +5V supply.

Must I put a filter capacitor on the inputs as well? How much farads should I have there?

edit: Mr. Hoffman - any recommendations on a newer, equivalent LM386? :D
 
Last edited:
It's been a while since I used one of these! Look at the first circuit in the data sheet and start with that. Be sure the polarity of the output cap is correct. Bypass from the positive supply pin to the negative with something like a small 10-100 uF cap, paralleled with maybe .001 uF. No cap needed on the input, in fact it needs the resistance to ground. Here's the trick- look ahead to the square wave oscillator. See how bringing the output to the + input creates positive feedback and causes oscillation? You need to avoid this condition with your circuit. It looks like it can't happen, but all wires and traces have resistance. "Ground" is not necessarily at zero volts if current is flowing. If the speaker return or the output compensation network (be sure you've got one) comes back to the + input, and then a trace or wire goes to ground, you can get feedback and oscillation because the + input isn't being held at zero volts. No "daisy chaining"! Do a proper single point ground where all the traces or wires physically meet at a small point. You can run a wire back to the power supply from that point. Remember, I'm guessing about the oscillation, but your symptoms seem to suggest it. It's also a very small "power amp". With only 5V to play with, you won't get much output. If all you've got is 5V, and if you can float the speaker, a bridge design will give you more "ooomph". For other chips, I like any of the newer National parts. Their web site has selector guides and app notes. For small power amps, you might search their headphone amp chips.

CH
 
If you make the LM386 amplifier as I show and as shown I its datasheet then it will work very well if the pcb design is correct. It might not work on a breadboard.
 
The LM386 seemed to did its job when I connected according to the datasheet. However, when mixing two channels, (both square waves, enveloped with decay) the other channel is distorted.

I could have did something wrong during the mixing. Is there any extra procedures I should follow when mixing two different channels?
 
You forgot to attach the schematic of your mixer circuit and the impedances of the signals.
 
Sorry for the inconvenience. Here's the schematic in the attachment. Pins 1,7,8 are not connected, and from the microprocessor, two enveloped square waves are outputted to the non-inverting input of the LM386.

Edit: Again, I borrowed the design from the site - this time it wasn't about the envelope filter, but apparently they did mix the signals well in the amplifier: **broken link removed**

and here is the LM386 connection in the site:
**broken link removed**
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    19.9 KB · Views: 771
Last edited:
The LM386 amplifier has a voltage gain of 20. Its output at clipping is 3V peak-to-peak when its supply is only 5V. Then its max input is only 3V/20= 0.15V peak-to-peak at clipping.

The input resistance of the LM386 is typically 50k ohms so the two 100k mixing resistors feed it as an attenuator. Then the max combined input is 0.3V peak-to-peak before clipping distortion. Maybe your input signal is higher.

I am glad to see that you added the important resistor and capacitor at the output of the LM386. It also needs a supply bypass capacitor, 10uF to 100uF.
 
that bypass cap should be DIRECTLY from pin 6 to pin 4, with the cap leads as short as possible.

i have used LM386 chips on a breadboard before, and it will work, but on a breadboard, the bypassing, andthe zobel network (the resistor and cap on the output to ground) must have as short wiring as you can manage. and keep the speaker wiring far away from the input wiring.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top