Instructables

need help with lm386 amp?

Hello , i making a little amp.This is the layout:
I use a AC to DC adapter (output DC 9V 200mA) as the power source, 8ohm speaker( the sharp 939 speaker).My stratocaster or mp3 player as the input.

I have some problem with it :

1.I want to add a volume control , but i don't know what volume control should i use (resistor value) and where to put it (before the cap 220uF or after the cap)?
2.I want to add a gain control(for distortion effect), but some people use capacitor, some people use resistor.What should i use ?
3.When i plug in my Guitar, the speaker starting to noise, but when i touch the guitar string,a metallic or  the GND line, the noise disappear.How can i slove this problem ??
4.What the pin7(bypass) of the LM386 use for and how can i use it ??

Thank for advance!

Sorry for my bad English. :(


Picture of need help with  lm386 amp?
img134.jpg
gmoon3 years ago
Typical for bug-filled Instructables, I now cannot "reply" to any part of my comment, or the other comments above it...

So:
Hello , I just find out that i can make a high pass filter by but a capacitor at the output. in my case : 8ohms 26w speaker.
What value of the capacitor should i use ? ( i just try to calc it but i not sure that my caculation is correct or not 300nF or 400nF ??)


The large coupling capacitor on the output of the 386 already forms a high-pass filter, together with the 8 ohm resistance of the speaker. That's why that cap has to be so large--due to the low impedance of the speaker.

So a 220uF with the 8 ohm load creates a cutoff freq of approx 90Hz. If you want to lower the freq, increase the capacitance (330uF and 8 = 60Hz). Lower the cap value to raise the freq-- 150uF and 8 ohm = 132Hz.

If you have the 25 ohm rheostat too, it will alter the frequency response, lowering the cutoff frequency as more resistance is added.

The other cap/resistor on the output (10ohm, 0.047uF) is a low pass filter, probably to prevent hi freq oscillation.

RE: noise

Yes, putting the amp in a shielded box should help. Using a good guitar cable will too.

Also, have you tried powering your mini amp with a 9V battery, just to see if the power supply is injecting ripple into the signal? Some wallwarts are REALLY noisy, and guitar F/X projects are often less tolerant of that...
gmoon gmoon3 years ago
Oh, one more thing--from your question, you're not mixing up uF and nF are you?

They aren't the same--an nF (nanoFarad) is 1/1000 of a uF (microFarad). You'll have serious problems if you confuse the two...
login721 (author)  gmoon3 years ago
yes, thank , i understand the diffirent between nF and uF
gmoon login7213 years ago
Oh, thanks, didn't realize. It doesn't show up on my profile and I can't see a "best" on this page. Oh, well, no matter.

Nope, it's probably not the cable if touching the strings silences the noise. But unfortunately it's the norm with single-coil pickups (you said you had a strat) to be noisy when you're not touching the strings. Just how noisy depends on the guitar and the amp/effect. Single-coil pickups are notorious for the problem.

There are few ways to deal with this--one is to turn down the volume control on the guitar when you're not playing.

Another is to use the "noise cancelling" pickup combinations on a Stratocaster--usually the combinations of the neck and middle pickups, or the bridge and middle pickups together have a noise cancelling effect (the 2nd and 4th switch positions). That's because the middle pickup is reverse-wound to create the cancelling effect.

Some players resort to a "noise gate" to control the single-coil hum. Other players modify their guitars to provide additional shielding in the the guitar itself (here's a good article that discusses the cause and some helpful fixes).

Sometimes the electronic noise comes from noisy appliances in your house/apartment, like refrigerators or florescent lighting.

If you can, try a different guitar. I would still shield the mini amp, and maybe try it with battery power to see if the power supply is the root cause.
login721 (author)  gmoon3 years ago
i still think its because the poor cable ( i made it with normal wire witch use for normal electronic device like lamp,fan )

http://i247.photobucket.com/albums/gg132/chipmapple/amp.png
http://i247.photobucket.com/albums/gg132/chipmapple/img140.jpg
http://i247.photobucket.com/albums/gg132/chipmapple/img139.jpg
gmoon login7213 years ago
OK, I missed that. Yeah, you should use shielded cable for the guitar.

There are bugs here on ibles ;-). The way my replies are ordered now is different from how I answered..

Good luck.
login721 (author)  gmoon3 years ago
I just try another cable, and its work great.
Thanks so much!
gmoon login7213 years ago
I don't know why, but now there's a second copy of my last reply below this one... Cool, I'm glad there's no confusion about the caps.
login721 (author)  gmoon3 years ago
It's not the instructable bug, i choose your answer as the feature answer so u cant direct reply the post.

Thanks for your help.

I just find out the reason of noise..
When i turn on the amp without anything plug , i have no noise.But when i plug one end of the guiar jack into the amp (other end not connect to the guitar yet),i have huge noise , when i plug other end to the guitar, the noise decrease but not disppear.When i touch the string, the noise totally disappear.
So , the problem is the cable???? This cable i made with normal wire , how stupid i am :))

I roing to make an other cable.But in my location only have 2 types of wire i can find.first is th wire use in AV cable ,second is the wire use in antenna cable, what type of cable should i use ??
iceng3 years ago

I think you ignored the simple solution I drew for you on your last question
the switch to ground on pin two of your LM386.

This time please look at the picture and page 5 of the LM386 PDF
gainvol386.bmp
I used the datasheet circuit also and it seems to work very well. My project was a small guitar amp with headphone output.

The only changes I made were (1) to add a 4.7 uF non-polarized capaacitor between Vin and the 10K pot [to block out any DC if I ever plug in a poorly-designed active-pickup guitar] (2) to add a 10 uF electrolytic capacitor between pins 8 and 1, with the "+" side of the capacitor tied to pin 1 on the IC. I also incorporated a bypass jumper so that I could change the amplifier gain from 20 (10 uF cap bypassed) to 200 (10 uF capacitor in circuit). This modification was described in my datasheet.

I've seen other LM386 circuits which incorporate components to make the gain variable between 20 and 200, but on/off was sufficient for my purpose.

Either 6 volts DC (4 x AA cells) or a 9 volt battery work well for power.

An SPST switch is used for power on/off. A "Power On" LED was added between the output of the switch and ground, with a 1K current-limiting resistor in series.

An alternate power on/off method is to use a stereo 1/4" jack on the mono input. Using this method for power switching does not interfere with the audio input, since the connections to the amp are from the "tip" (+) and "sleeve" (Gnd) on the jack.

Connect the "-ve" power wire from the amp to the "ring" terminal on the jack. Run a wire from the "sleeve" terminal (Gnd) to the battery "-ve" terminal. DC power is turned on only when the guitar is plugged into the input jack. If this method is used, the LED/resistor "on" indicator is run from the battery "+ve" to the "ring" tab on the 1/4" stereo input jack.

No speaker was used, but two stereo headphone jacks, 1/4" and 1/8" were paralleled on the output, with L & R channels tied to the amplifier output.

This is a very low-noise amp, with a clean, satisfactory output even when turned up quite loud. Battery life is good, and it's much easier to tuck in my guitar case than a Marshall or a Vox, LOL.


Attached below is a schematic for an LM386 pocket amp incorporating switchable distortion - I have not tried building this circuit. I am ashamed to admit I don't know where I found it, and haven't been able to locate it again :-( Apologies to the author.
Headphone Amp with Distortion Schematic.jpg
login721 (author)  iceng3 years ago
Sorry, the last time i dont have the 10k volume control.I just bought it and follow your instruction .Thanks!
sshuggi3 years ago
I'm not entirely used to this programs symbols. I take it the circles are electrolytic capacitors, the bar is resistor, and ovals are film capacitors? Here's the datasheet for your amp. Under gain control, it says: "If a resistor is placed in series with the capacitor, the gain can be set to any value from 20 to 200." (talking about from pins 1 to 8) So, putting your variable resistor in series with a capacitor will give you your gain control. This is essentially your volume knob. However it wont go below the gain of 20. To get below 20, you have your output connected to pin one of the trimpot, pin three connected to GND, and pin 2 is the new output. (This is a voltage divider.) I believe that's parts one and two.

Part 3: The noise is where you amp is, well, amplifying what it picks up... The thing is, there is electromagnetic radiation all around us, and anything conductive will pick it up. (A stray wire, guitar string, even you.) Much of the noise is the 60Hz power wires that are running all around your house. What you're going to want is a high pass filter set to cut out anything lower than about 70Hz. (Since guitars low e is 82Hz, this gives you breathing room on both sides.) Meaning the low 60 Hz doesn't make it through. Sadly, this method wont work if you try and use a bass, it'll cut out it's lower notes.

Finally, Here's a rather complicated bit about pin 7.
login721 (author)  sshuggi3 years ago
Hello , I just find out that i can make a high pass filter by but a capacitor at the output.
in my case : 8ohms 26w speaker.
What value of the capacitor should i use ? ( i just try to calc it but i not sure that my caculation is correct or not 300nF or 400nF ??)
gmoon3 years ago
Several ways to tackle this. One classic approach is to use a POT on the input as a volume control--this would be wired as a voltage divider. The "normal" value for the 386 is a 10K audio taper POT. But anything from 10K to 100K would work fine (look up the 386 datasheet to see how that's wired).

Other ways are:
--Gain control
--Attenuator

Look to the classic Little Gem schematic, it details both of these options.

The Gain control is a 5K linear POT between pins 1 and 8.

The attenuator is a rheostat. You CANNOT use a normal potentiometer because they usually can handle 1/4 watt. Attenuators are for power amplifiers.

Notice also that an power amp control like a rheostat has a low resistance--the rheostat recommended for the Little Gem is only 25 ohms. That's because power amps have very low impedance, as they need power (wattage) to drive the voice coil of a speaker. This is very different than a volume control on a high-impedance preamp.

Why use an attenuator on the "backend" of the amp, rather than an upfront volume control? Because with an attenuator you can crank the 386 up to high gain so it sound good with guitar (YAAAA distortion!), but still control the overall loudness.

It's normal for a single coil guitar to hum with a high-gain amp or effect. The strings are connected to the signal ground, so when you touch them your body acts as additional shielding--it's supposed to quiet the hum, that's why they are grounded in the first place.

Is your 386 amp housed in a metal box? Shielding the amp (or stompbox) is really important...
login721 (author)  gmoon3 years ago
Thanks, i tried to connect the GND to the screw in my wall,but it's no use.I will try to use a metel box.
Let's see if we can clarify some of the points you are asking about.

Volume control: As Iceng showed you, the volume control is at the input, not the output. This controls how much of the signal gets through to the amp. The schematic is directly from the LM386 datasheet.

Gain control: This is what sets the available amount of amplification for any level of input signal, which is what Gain stands for. This means that for a 1 mV signal at gain=20, the output will be 20 mV, but the same input of 1 mV at gain=200 will result in a 200 mV signal (just trying to explain in simple math terms). For an explanation on how to make a variable gain for the LM386, see my answer to this question, dated 10/12/2011. It walks you through the process. Also, use the potentiometer/capacitor combo. The capacitor sets the lower frequency limit that the LM386 will amplify - in this case it is approximately 20 Hz. Since you have 2 wildly varying input levels (guitar and MP3 player), you might want to leave the gain pot accessible (via a knob) so you can adjust each one to your liking. I'd put a mark for each one on the case to get me to the proper spots quickly.

Noise: Grounding/shielding needs to be better. First, start by using either twisted pair wire or coaxial wire for the inputs and outputs. You can make twisted pair wire just by taking 2 wires and twisting them together so they look like the ones in the WIKI article. Then you should try to put the amp in a metal box with the grounds of the input, power and output all going to the box. Also, is your (-) input, pin 2, connected to ground? For some reason, I cannot see the picture you included (right now), so I cannot tell if you did.

Pin 7, bypass: This pin is used if there is a problem with oscillation when in use. All you need to do is put a capacitor from that pin to ground. For an example, scroll down to page 6 of the LM386 datasheet to see it in use for the AM Radio Amplifier. It is a 10 uF capacitor, with the positive (+) connected to pin 7 and the negative (-) connected to ground. You can leave it unused if there are no problems, or you can connect it as shown if you want to. It's up to you and your observations.

Qa
pjmock3 years ago
As others have noted, with a simple power amp like this your gain control is your volume control. To get a controlled distortion effect, you're gonna need some sort of preamp circuit.

If you're looking for a classic "tube overdrive" type of sound, this link: http://www.geofex.com/article_folders/tstech/tsxtech.htm provides a good explanation of the classic (and simple) TS-808 circuit. This is essentially what verence is talking about by putting diodes in a feedback path to the input. Inexpensive kits are available from a number of places online if you don't feel up to tackling it from scratch, too.


verence3 years ago
You don't regulate the power at the output, you regulate the level at the input. The poti in the second picture was a good guess - see here how to use it:

http://www.instructables.com/id/Pocket-Protest-a-LM386-amp-in-a-9v-battery-casing/step2/Amp-Circuit/

For the distortion effect? You could try to clamp the input signal with a diode after the poti. Your sources may or may not like their output to be treted that way. So you may need a pre-stage with an op-amp.

For the noise? Seems like your input still works like a little antenna picking up ambient electromagnetic fields - if you touch a part of it, you kind of ground the thing. Maybe the poti at the input will help a bit.

For questions about the IC, just google for a datasheet. Enter e.g. "LM386 datasheet".  In the datasheet, you will find whatever you need to know about the chip. Also a good source: google for 'reference designs' and/or 'application notes'. (The are like a 'tips and tricks' for a special chip)