Pages: [1] 2   Go Down
Author Topic: LM386 speaker hum  (Read 4953 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 42
Posts: 5612
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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)...
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
http://www.hobby-hour.com/electronics/lm386-power-audio.php (the one with the 200 gain), with the bypass (pin 7) grounded directly, not through a cap.


* noice scope shot.png (66.12 KB, 1025x660 - viewed 59 times.)

* noice fft shot.png (72.42 KB, 1034x671 - viewed 50 times.)
« Last Edit: July 24, 2011, 11:54:58 am by jgalak » Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: July 24, 2011, 02:34:10 pm by jgalak » Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Quote
2) 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.
Quote
3) Did you use the recommended snubber circuit, 0.05uF and 10 ohms from output/pin5 to ground?
Yes.
Quote
4) Are you using the recommended output capacitor, 250uF?
Yes.
Quote
5) Are you using a capacitor across the gain-setting pins (pin 1 and pin smiley-cool?
Yes, 10uF.

As I said above, I'm using exactly the circuit from http://www.hobby-hour.com/electronics/lm386-power-audio.php (which is from the datasheet IIRC).  The second one (200 gain).

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

Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 152
Posts: 6194
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 362
Posts: 17308
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1] 2   Go Up
Jump to: