LM386 speaker hum

I'm working on my talking doorbell, and want to use a LM386 to amplify the speech. Circuit works fine, but there's a very slight speaker hum coming from the speaker when no signal is being sent to the amp. Is there a way to eliminate this? Or should I just cut power to the amp when no signal is present (not too hard to do)?

If the latter, can I use a transistor to turn the amp on or off? Or should I just use a relay? If transistor, how do I compute the power requirements for the transistor? It'd be easier to use a BJT than a FET, but not sure if a BJT would handle the power...

Power to the LM386 is from a 9v battery, but the ground is common with the speech chip that gets 5v from a regulated supply off a wall blister. Will try to ground the input and check the hum. The hum was much worse till I grounded the bypass pin (pin 7), now it's very faint, but still there.

KE7GKP:
If this is a fixed installation (a door-bell) then why are you running it from a battery?

Because right now I'm still testing various components, and it was easier to hook up a 9V battery to the breadboard. I'm testing things modularily - got the ISD1932 working on one breadboard, the xBee on another, now trying to get the amp to work on a third... This project is a long way from done.

Tried grounding the input to the LM386, no noticeable difference - the hum is still there, exactly the same.

jgalak:

KE7GKP:
If this is a fixed installation (a door-bell) then why are you running it from a battery?

Because right now I'm still testing various components, and it was easier to hook up a 9V battery to the breadboard. I'm testing things modularily - got the ISD1932 working on one breadboard, the xBee on another, now trying to get the amp to work on a third... This project is a long way from done.

Tried grounding the input to the LM386, no noticeable difference - the hum is still there, exactly the same.

Do you know what the frequency of the hum is? If you knew that, then you could (potentially) design a filter for it; I suspect that likely it is a 50/60 Hz AC from home wiring (or maybe the wall wart you're using, feeding back thru "ground"). Do you have an o-scope? Alternatively, you could try recording the output using your computer then analyzing the recording to determine the frequency (unfortunately, though, you don't know what the signal level is, and you don't just want to feed anything into your sound card, or you could blow it; without an o-scope, this might be tricky to figure out, without a lot of trial and error)...

I have a scope (dpscope), will try that later today. Didn't even occur to me - I'm ok with digital electronics, but a complete tyro with analog, especially audio...

The noise doesn't seem to be at any one frequency, but rather across the spectrum, with more low than high freq component. Scope and FFT shots below. Turning the wall-blister on and off doesn't seem to affect the noise - it seems to come entirely from the amp side of things.

I'm basically using the second circuit from here:
LM386 Schematic diagrams (the one with the 200 gain), with the bypass (pin 7) grounded directly, not through a cap.

Ok fair enough, I don't know the difference between noise and hum. I'll try to record it, but not sure my pc mike is sensitive enough to pick it up, it's very quiet.

Ok, I can put in a cap on 7, what type/value? The data sheet doesn't say...

When I put a 10uF cap (electrolytic, if that matters) between pin 7 and ground, instead of a very faint noise/hum, I get a loud squeal, with a large peak at about 4.7kHz and a smaller peak around 14kHz. Taking pin 7 back to ground makes it go away again. Changing to a 1uF cap, returns the same squeal, at the same/similar frequency (sounds the same to my hearing, and the FFT on the scope jumps around too much to be able to tell if there are different peaks, but there are still 2 peaks around the same frequencies).

I've tried recording the sound, but my pc mike couldn't get it. Best way I can describe it is if you have a theatre stereo system, and turn the amp volume way up with no input to the amp. As the volume goes high enough, you start to get a noise from the speakers, that's what this sounds like.

KE7GKP:
Then you have an unstable LM386 circuit.

  1. Test with the inputs shorted to ground. i.e. pins 2 and 3 connected to pin 4. Does it still oscillate?

Will check tonight for the oscillation. Earlier, when I was just dealing with the noise/hum, I tried grounding pin 3, with no appreciable results. Haven't tried that since adding the bypass cap and getting oscillation. Pin 2 has been grounded all along.

  1. Did you use a filter/bypass capacitor across the power (pin 6 to pin 4)?

No. Since I'm using a battery power supply, would a filter on the power leads accomplish anything? I will try that tonight in any event.

  1. Did you use the recommended snubber circuit, 0.05uF and 10 ohms from output/pin5 to ground?

Yes.

  1. Are you using the recommended output capacitor, 250uF?

Yes.

  1. Are you using a capacitor across the gain-setting pins (pin 1 and pin 8)?

Yes, 10uF.

As I said above, I'm using exactly the circuit from LM386 Schematic diagrams (which is from the datasheet IIRC). The second one (200 gain).

Thanks for the help, I'll continue poking at it.

Ok, I rebuilt the amp circuit, and the siren-like oscillation went away. Obviously a short or open connection on the breadboard caused it.

However, even with a clean assembled circuit, the hum/noise is still there, though very faint. I've grounded the input, and tried a filter cap at the LM386's Vcc input. I completely disconnected the other circuit (both the signal source and the other power supply).

Could this be an issue of overdriving the speaker? The noise is very faint, but definitely there if you hold the speaker by your ear.

I'm thinking more and more that the solution is to cut power to the LM386 when not in use. Would a transistor work for this? I'm going to put an ammeter in series with the lm386 when I get the chance, to see how much current it pulls in use, so as to size a transistor properly. I'm hoping a normal BJT will be enough to handle the power load.

Gain of 200 is a lot. What input range is this device getting?

You know a LM386 is not very loud, even at full volume. For a doorbell, I might have chosen a more powerful amp, like the LM384.
http://www.national.com/mpf/LM/LM384.html#Overview

KE7GKP: Yes, at the moment, for testing purposes, I have it completely standalone from anything else. LM386 chip and the associated resistors and capacitors, that's all that's on the breadboard. Power is from a 9V battery. Pins 2 and 3 are both grounded. I have not tried taking it outside, I will look try that and see if there's any difference.

SurferTim: When I feed a signal to the LM386, it's plenty loud (at the 200gain) for my application. My concern is this noise I get out of the speaker when there is no signal at all (even when I disconnect the signal source and ground the LM386 input).

Generally, when there is a system such as this (signal source and amplifier) that is only used occasionally, does the amplifier remain on all the time? Or does one switch off the amp between uses? I keep thinking back to the PA system in my high school (15+ years ago) - when they were going to do an announcement, they'd switch it on, you'd hear a speaker noise (very similar to this if significantly louder), then the person would start speaking, then they'd turn it back off. Now obviously, that was turned on and off manually, but is there any reason not to set this up to switch off automatically? My signal source has a digital output pin that goes high whenever there's output, so I can pretty easily use that to control power to the amp. I'm wondering if this is appropriate design practice though...

Maybe a gain of 200 is higher then you actually need for your intended input signal. Have you tried changing to a lower value?

Lefty

Lefty: I'll play with that. 20 was definitely not enough, perhaps I can get away with less than 200.

Did you ever manage to solve this humming?

I'm using the SpeakJet chip to generate speech through the LM386 and I've also got a lot of noise. My noise is definitely being generated by a very active digital circuit nearby flicking on and off a bunch of LEDs. I'm very interested to see if I can switch the amp off completely when not in use by using a digital high/low, but I don't know what's the best way of doing this.

Try connecting a small value capacitor between the inverting and non-inverting inputs on the amp. Start with .001uF, and if that's not enough, work up to a value of .1uF, then stop.

This has worked for me in the past.