200hz hum - Page 1
Forum section: electronics / beginners

author: msknight
author_rank: Regular Contributor
timestamp: August 16, 2021, 07:48:03 am
content: This is really going to be a newbie question.I built a simple LM386 amplifier (I want an amp I can power from 5V USB) -https://www.instructables.com/Tales-From-the-Chip-LM386-Audio-Amplifier/- and I needed stereo, so I built two in line.With nothing connected, there is a hum at 200hz. With a battery powered audio player connected, there is no hum. With a mains TV connected, there's hum.I'm convinced that this is a hum across the common ground of the input, but as it's the ground and I want to see what's happening at the common input ground point, I'm not sure where I put the earth lead of the oscilloscope probe without blowing something up. I suspect I should connect the probe ground to the negative of the power input going in to the board, but the audio ground is connected directly to it, so I'm wary.Any advice would be much appreciated.

author: Saimoun
author_rank: Frequent Contributor
timestamp: August 16, 2021, 08:25:12 am
content: Do you have the schematics?What is the amp designed for, i.e. what input (line, mic, high-Z?) and what output (line, headphones, speaker?).My guess is you have a high impedance input somewhere, which disappears when you connect something to it.Can you hear the hum, though? -80dB is pretty low.

author: msknight
author_rank: Regular Contributor
timestamp: August 16, 2021, 08:31:14 am
content: Yes, the schematic is on the link in the post. Except I've doubled it and the two circuits have a common power and negative on input and output ground.I can hear it... yes.The intention is to take the output from a headphone outlet on the TV and amplify it to a pair of passive loudspeakers ... but this hum is present with nothing but the speakers connected... no input connected.

author: mikerj
author_rank: Super Contributor
timestamp: August 16, 2021, 08:31:31 am
content: What are you powering the amp with e.g. a USB power bank, PC USB port or USB mains adapter?

author: msknight
author_rank: Regular Contributor
timestamp: August 16, 2021, 08:32:43 am
content: It's being powered by a USB wall power adaptor currently.

author: Saimoun
author_rank: Frequent Contributor
timestamp: August 16, 2021, 11:01:28 am
content: So you are saying that when nothing is connected you can hear the hum?Just to be sure - are you sure the hum you are hearing is the 200Hz and not something else? 60Hz hum is very common, on tiny speakers you probably will barely hear it, and on large speakers it will sound very bassy. An idea: check how 200 and 60Hz sound like with a sound generator so you can be sure you are indeed hearing the 200Hz.Otherwise, when nothing is connected, can you probe the Vcc pin, to see if you get the same peak at 200Hz? And same for the input pin.If it is indeed 200Hz, there is a chance your USB power adapter is generating it.

author: Zero999
author_rank: Super Contributor
timestamp: August 16, 2021, 11:29:15 am
content: Quote from: simonlasnier on August 16, 2021, 11:01:28 amThe original poster is in the UK, where the mains frequency is 50Hz, making 60Hz hum extremely unlikely.Thespectogramattached to the original post, shows a sharp spike at 200Hz, which is the fourth harmonic of the UK mains frequency.Quote from: msknight on August 16, 2021, 08:32:43 amMy guess is it's the Y capacitor, inside the USB power adaptor, coupling the mains to the secondary side.Is there still hum, if you connect the 0V side to a definite earth connection?

author: msknight
author_rank: Regular Contributor
timestamp: August 16, 2021, 11:53:23 am
content: I didn't have the guts to connect 0v to ground, but I did try...a) connecting to a bench power supply .... same humb) connecting to a 9v battery .... no hum

author: Zero999
author_rank: Super Contributor
timestamp: August 16, 2021, 12:19:47 pm
content: Quote from: msknight on August 16, 2021, 11:53:23 amThe thing both of those power sources have in common is, they come from the mains.If they're floating, there won't be in any harm in connecting the 0V to earth. If you're really paranoid, you could try connecting it to earth, via a 100nF capacitor, which will block any DC and prevent a short circuit.

author: msknight
author_rank: Regular Contributor
timestamp: August 16, 2021, 12:30:05 pm
content: The 9v battery showed no hum... so the conclusion is that it is coming from the mains.How do I tackle that?

author: Saimoun
author_rank: Frequent Contributor
timestamp: August 16, 2021, 12:36:04 pm
content: @Zero: yes my bad I meant 50 or 60.@mkknight: then I would still say a high impedance input, but since you have a 10k load on your input it should not be so sensitive. You could try to change that to a 1k, just to see if it makes a difference.

author: msknight
author_rank: Regular Contributor
timestamp: August 16, 2021, 01:33:50 pm
content: Quote from: simonlasnier on August 16, 2021, 12:36:04 pmThat did it. Many thanksI don't understand why reducing that resistor, made that difference.

author: Saimoun
author_rank: Frequent Contributor
timestamp: August 16, 2021, 02:32:02 pm
content: Reducing that resistor to 1k means the input impedance is now 1k instead of 10k.I am sure that more experienced engineers can explain in a more "proper" way, but with my words, I would say that means it requires more effort (current) to make the voltage move on the input, and is therefore less sensitive to ambient (fx electromagnetic) noise.Problem is with a low impedance input you will get less sound from a high impedance source. For example a 1k ohm source will create a voltage divider with your input impedance:source -> 1k (source's output impedance) -> cable -> 1k (your circuit's input impedance) -> GNDThat divides your voltage by 2, i.e. you get 50% of your source voltage. With a 10k input impedance you would get 91% of the source voltage.But since your TV output is made for headphones (which can have as low as 32ohm input impedance), it probably means your TV's output impedance is only a few ohms, so with 1k you should be fine.Hope that makes senseEDIT: actually if you have ever heard a massive low frequency noise coming out of a guitar amplifier when no guitar is connected to it for example, that's typically the 50-60Hz, and it's because of the way guitar microphones are made the input of a guitar amp has a very high impedance (usually 1M), so is very sensitive to noise.

author: msknight
author_rank: Regular Contributor
timestamp: August 16, 2021, 03:20:06 pm
content: There is a gain setting on pins 1 and 8 but there's nothing connected to them. I'm assuming this is automatically maximum gain? Or could I get a little more out of it?

author: msknight
author_rank: Regular Contributor
timestamp: August 16, 2021, 03:23:04 pm
content: If I try 9.2.3 here -https://www.ti.com/lit/ds/symlink/lm386.pdf?ts=1629118788552&ref_url=https%253A%252F%252Fwww.bing.com%252Fsearch%253Fq%253DLM386%2526src%253DIE-SearchBox%2526FORM%253DIENAE1- then what will I potentially lose? Or what could happen to the signal?And what would happen if I used a 1K instead of 1.2? Louder? How could I calculate how much?Also, could I use an electrolytic instead of ceramic and if I did, would the positive be to pin 8?

author: msknight
author_rank: Regular Contributor
timestamp: August 16, 2021, 03:49:22 pm
content: Just because I like to live dangerously, I did a 10uF cap, positive to pin 8, and a 1K resistor. It worked, but there was a bit of hum returned on the line.So... should I reduce the 1K resistor between signal in and ground further?

author: msknight
author_rank: Regular Contributor
timestamp: August 16, 2021, 03:52:25 pm
content: Here's the trick...I have an old amplifier which I've cut all the components out of and I want to mount a stereo amp in here. (it was 9V AC and I got fed up of tracking the amp, so I wanted to convert it to 5V DC which I can power off USB)I'm thinking of putting a 10uf cap between pins 8 and 1, to get 200x amplification and then use the 40K pot to control the output.My brain thinks I'm most of the way there... except this hum that appeared when I put the 10uF and 1K resistor in.Part of my brain doesn't think I want to just do the 10uF cap and then test without some form of resistance between that and the speakers. And something else makes me wonder whether I should be changing some of the other caps to match the greater amplified output? The 1000uf caps I'm using are 10v.

author: Zero999
author_rank: Super Contributor
timestamp: August 16, 2021, 03:59:53 pm
content: Quote from: msknight on August 16, 2021, 03:20:06 pmLeaving pins 1 & 8 unconnected defaults to the minimum gain of 20.Quote from: msknight on August 16, 2021, 03:49:22 pmYou could try reducing the 1k resistor further, but it will lower the input impedance. You could also look at using a connector, which shorts its contacts, when the cable is unplugged.By the way, where did you connect the 10µF capacitor?

author: msknight
author_rank: Regular Contributor
timestamp: August 16, 2021, 04:02:16 pm
content: I connected the 10uF cap positive to pin 8, negative to 1K resistor. That resistor is then connected to pin 1, to hopefully give maybe either 40x or 60x amplification... I'm assuming that lower resistor means more amplification? But I could be reading this wrong.

author: msknight
author_rank: Regular Contributor
timestamp: August 16, 2021, 04:03:12 pm
content: I have also tried connecting a multimeter across the outputs, but I can't see much. I'm getting readings in the 0.01v range. I'm assuming I'm going to need to hook up an oscilloscope.

author: msknight
author_rank: Regular Contributor
timestamp: August 16, 2021, 04:17:09 pm
content: During gunfire and explosions I saw this peak at the full screen... so that's four divisions... 2v?

author: Vovk_Z
author_rank: Super Contributor
timestamp: August 16, 2021, 07:20:32 pm
content: Quote from: msknight on August 16, 2021, 07:48:03 amI guess this noise is intrinsic for a USB-powered amp and it is almost impossible to get rid of it totally. At least you'll have this common-mode noise when you power the amp from the same PC you have a signal.One of the simple solutions is to use low-power 5V isolated DC-DC (2W, 3W rated, they are quite cheap).

author: msknight
author_rank: Regular Contributor
timestamp: August 17, 2021, 06:43:45 am
content: OK - so here's the diagram with the capacitor and resistor. I currently have 800 ohms so I'm presuming I'm at about 60 gain or maybe a little more.The picture showing the variable resistor between Vin, pin 3 and ground helps it make sense to me. It's adjusting the strength of the signal that goes in. The penny has dropped.As a result of using the gain, the hum is now audible again, so I guess there's nothing much I can do on the input side now, I've just got to get a DC-DC isolated transformer and use that.Although I do notice they have different value capacitors and resistors in this circuit. Instead of 1000uF they've got 250uF.Many thanks for all the help. It's been another valuable learning experience.