I've got an lm386 amplifier, with the basic circuit giving 20 x gain to a speaker.
Now I want to implement a headphones / line out, non-amplified, bypassing the amplifier and turning the speaker off.
I've got me a 1/4" stereo jack, which has contacts across all three inputs which switch, meaning that when a jack is plugged in, there is no connection across the contacts.
So, I've wired it up so that:
- Audio Input (after dc blocking capacitor / resistor / gain pot)goes first to the headphones jack, then from the bridging contact there to the amplifier circuit.
- Ground to the whole circuit goes first to the headphones jack ground, then from the switched bridging contact to the amplifier circuit.
This almost works fine - if I don't plug in headphones, the speaker works fine. If I plug in headphones, I hear sound on the headphones fine. But, I still get noises on the speaker too - not the sound I am outputting, just interference and fuzz etc.
I don't understand why this is happening - surely if the whole amplifier circuit has no ground, then there is no circuit, hence it should be not powering the speaker at all?
If I want to dump the amplifier circuit completely, do I need to switch the positive also somehow? If so, how? Should I use a transistor somehow?
cheers,
Joe
The LM386 is probably being left in an open input condition when you plug in the headphones. It will pick up any type of signal. The most common for me is my desk lamp.
I would try a resistor from the coupling cap input to ground. You might need to play with the value to get the correct results in both conditions.
That sounds believable, as the input is certainly open, but I don't quite understand how it can be doing anything if it doesn't have a ground? There should be no ground connections at all to the amplifier, as I cut off the main ground line based on the headphone switch. It kind of seems like it should be basically an open circuit, ie. do nothing?
Joe
That sounds believable, as the input is certainly open, but I don't quite understand how it can be doing anything if it doesn't have a ground?
A radio antenna has no ground, and it works. When you disconnect the source, you are leaving the high impedance input to the amp floating. If you do not reduce the impedance with a resistor, then you have just figured out how to build a really low frequency radio receiver. 
More like EMF actually.
Yeah, I understand how having an open floating input to the amplifier would create a radio receiver.
What I don't quite understand, is how the amplifier is still putting out enough power to power a speaker with a completely floating ground?
It isn't really important, I'll stick in a resistor to ground to fix it, but I just wish I understood these things better!
cheers,
Joe
- Ground to the whole circuit goes first to the headphones jack ground, then from the switched bridging contact to the amplifier circuit.
That is ground. Isn't pin 4 on the LM386 connected to that circuit somehow?
Add: The noise is always greater if you are using a breadboard. Long wire jumpers will inject more noise than a short circuit board trace.
There should already be a resistor from the input to ground. The example schematic from the datasheet (national.com) shows the wiper of a 10k pot from the amp input to ground. Do you have that in your circuit?
That is ground. Isn't pin 4 on the LM386 connected to that circuit somehow?
Only when the headphone jack isn't plugged in - on the jack socket, each of the individual connectors has a bridging switch, which is open when something is plugged in, and closed when nothing is plugged in, so basically I'm only taking a ground from the arduino to pin 4 when the headphones aren't plugged in.
I've put the resistor in, from pin 3 to the whole circuit ground (ie. it is connected even when a headphones jack is plugged in), and it works, so you were totally right as to the fix, but I still don't 100% understand why it was still picking things up even with a completely floating ground! Possibly some kind of inductive connection on the breadboard itself?
anyway, thanks for the help,
Joe
Good to hear it is fixed.
Just something to think about...Is the LM386 still powered up? Or does the connector break the ground connection to the 386 power supply (pin 4) and turn off the amp?
If it is powered up, it is amplifying. Some things you want amplified, and some you don't.
It should break the ground connection - multimeter says that there is no continuity between the two grounds.
Weird. Don't quite understand why it didn't work, but at least now it is working with the resistor!
joemarshall:
It should break the ground connection - multimeter says that there is no continuity between the two grounds.
Weird. Don't quite understand why it didn't work, but at least now it is working with the resistor!
That is why. The LM386 amplifies the voltage difference between the input and the ground. Any voltage difference will be amplified. It matters not whether it is the input oscillating, or the ground.
input low-z and ground low-z = no noise
input hi-z and ground low-z = noise (input oscillates reference fixed ground)
input low-z and ground hi-z = noise (ground oscillates reference fixed input)
If I were you, I would think about leaving the grounds connected. Is there a reason you do not want to do that?
Aha, so ground and signal are both disconnected, but are essentially both at different arbitrary levels, which may not be the same. That makes sense now.
Reason I wanted to disconnect the whole circuit was to save battery when headphones were being used - to avoid the 4ma current draw of the lm386, which while small is not that small compared to the arduino board which is the only other thing live. Am I right in reading the lm386 datasheet that it wastes 4ma when input is silent?
I guess I could use a transistor to switch the positive also, although for now I'll just use the ground always I think.
Joe