How to wire up LM386 amp for audio?

NO

The signal line must be fed through the capacitor

Source (PIC output)-------------II-----------Amplifier (pot) -
10uF I
I
I<-------Amplifier (pin 3)
I
I
Sounrce (Gnd)----------------------------------------I--------Amplifier (pins 2&4) Gnd

ok..so just add the cap 'in-line' of the green trace (sound pin from PIC) is that what you've been saying?

I still dont understand about the GND then.. isnt what Im already doing?

the PIC is grounded to the same board/rails as everything else?

I can understand your ascii diagram.. (sorry)

is your first line supposed to tell me to:

PIC (SND) pin >>> 10uF cap >>> (what? (Amplifier/pot)??) after the 10uF cap.. is it supposed to go to the lm386 amp?..or the pot?

can someone post a diagram or edit my diagram? visually show me what the heck Im supposed to do?

does the polarity of the cap matter? I dont see it mentioned in your ascii diagram

I'm not certain about the dc-blocking cap in the input line as mentioned, but I re-worked your dwg --

The 5V is marginal, V_in may be better (provided it isn't > v_max, and doesn't drag down your supply during loud/hi-volume periods -- something to "worry" about later.)
Make sure that it's the pot's "wiper" going to the amp_in.
The gain programming cap (pin 1 & pin8) is probably a good idea (won't hurt.)

hi-

thanks for replying! =)

Can you explain what it is you are doing different?

I have little experience with electronics/hardware.. but 'to me'.. I dont see any change?

I see that you have connected all the GND traces.. 'before'... terminating on the GND rail?

Is that the only difference?

and can you explain how this changes things?

I have GND on the outside rails of the breadboard..

this GND rail is from my vReg GND output..

I have all GND traces terminating on the GND rail around my breadboard.. isnt this the same thing?

according to pin-out.. the 'center pin; is the wiper.. so I believe that to be correct

ok I just tried to connect all GNDs in-line before terinating to the GND rail.. still 'no change'.

I can hear a HUM like the speaker has power.. and if I adjust the pot.. the 'hum' (static..not sure how to explain it) goes up or down a bit.. but no audio is playing...

I plug in the RadioShack crap pre-amp speaker..and it 'works'.. (although the sound is KAKA) LOL

Not sure what Im doing wrong?

I'l try the 1 & 8 pins..

what cap should I use? 10uF? 22uF?

Thanks

10uF for X200

(Before there was just the black wire running off the pot with no label "to GND". Wanted to make that clear if it was as oversight.)

hi-

thanks again for keeping with the thread! (its hard being new and waiting DAYS to trouble shoot a simple LM386 circuit!) haha

I'l add in the 10uF cap and see what happens..

oops..sorry yes that trace SHOULD have have the label to GND like the others..

knowing that now.. is my original wiring diagram correct then? if not.. Im still missing how what you did is electronically different?
if it is ok.... then thanks for clarifying for me. =)

I think the PIC project must be using some PWM to emulate sound? (not sure as the firmware is closed/isnt mine).... and there is no DAC or anything.. (but I dont need/want super quality sound.. average FX type sounds are fine enough)

adding cap now!

update:
adding the GAIN cap.. 'made it work'.. must have not been enough signal to play/hear anything?

Well Im glad that part is at least tackled. =)

Thanks everyone for sticking with me/this.

Now.. Id like to learn how to make it better sounding? Is there where all the resistors/caps and stuff used to make 'filters' come into play?

I understand the general idea.. using resistors/compoenents to filter out bad freq. in the signal..things we dont hear or ranges we dont want to?

etc.

Thanks

You're on-the-air, now, good.

Filters are a course of study unto themselves. You can look up/around for "scratch and rumble" filters (to attenuate clicks and pops, high-freq noise and turntable motor rumble, low-freq noise). I don't have any quick-and-dirty suggestions for colouring sound, beyond that.

thanks!

ok.. so my next/last step in this 'project' is to search for:

"scratch and rumble" filters

and then see what I see eh?

Hopefully it will be easy for me to understand and implement! lol

Thanks for the help!

Here is a great site for audio electronics fundamentals and projects. It's Hi-Fi orientated but has great articles on fundamentals and his projects are well explained and are a great learning experience even if you don't build any of his circuits. Take your time looking around as there are lots of different sections and topics covered and can take quite awhile to see it all.

http://sound.westhost.com/index.html

Lefty

retrolefty:
Here is a great site for audio electronics fundamentals and projects. It's Hi-Fi orientated but has great articles on fundamentals and his projects are well explained and are a great learning experience even if you don't build any of his circuits. Take your time looking around as there are lots of different sections and topics covered and can take quite awhile to see it all.

http://sound.westhost.com/index.html

Lefty

Not all have been built and verified, but with those that have not this is not an issue, since they cannot help but work.

Heh. Reminds me of Donald Knuth.

Also, bookmarked for educational purposes, and because a headphone amp is on my list.

I think good results can be obtained by wiring the part per the Applicatin Hints on the datasheet as well.

Having a picture of the chip with no indication of what the pins are is not helpful.

Your next step is to ensure the signal you feed into the amplifier is a good signal.
Amplifiers are a bit like software programmes - rubbish in = rubbish out.
There's no point in playing with filters until you establish that you are feeding a clean signal into the unit.

Thanks for the replies guys! =)

however.. if I knew how to do the quick term suggestions you are giving.. I wouldnt need to be here on an help forum (looking for help/guidance)

@Crossroads-

I guess I dont understand your post?

in my diagram.. all pins 'are' labled.... can you not see them? everything is labeled.. (except a missing 'to GND' lable)

**now if you are saying I should wire it up DIFFERENTLY.. please say so or point out how.. just implying so doesnt offer my much 'real direction to solve/fix anything. but Im unclear as to what it is you are proposing? (except post a schematic?)

@jackrae -

I understand what your saying.. but wouldnt have any clue on HOW to go about what it is you are suggesting?

So if trying to play with filters to fine tune the noise/sound is jumping the gun.. how do I go about doing as you suggest? (making sure its a good signal?) or if its not.. making it a 'better' signal!??

Thanks =)

I think that all you can really do is minimise distortion, you should avoid "overdriving" (clipping.) You may have a portable radio and with fresh batteries at low and medium volumes it's OK, but when you really turn it up it starts sounding crummy - some of that's distortion, over-amplification, and some of it is just exposing certain limitations of the amplifier.

This sort of electronic sound, derived from a noise generator or noise generation techniques, isn't instrument-quality. It sounds pretty nifty at low volumes, but there's a threshold whereat all of the faults can be appreciated.

Anyway, the LM386 datasheet shows a X50 example. It still uses the 10uF but with a 1200Ω resistor between it and pin1. There is also a "bypass" capacitor that can be connected between pin7 and GND. They don't give much guidance, text and example values from 0.1 - 10uF.
"When using the LM386 with higher gains (bypassing the 1.35 kΩ resistor between pins 1 and 8 ) it is necessary to bypass the unused input, preventing degradation of gain and possible instabilities. This is done with a 0.1 µF capacitor or a short to ground depending on the dc source resistance on the driven input."

Post Edit -- bonk inadvertent smiley

xl97:
in my diagram.. all pins 'are' labled.... can you not see them? everything is labeled.. (except a missing 'to GND' lable)

He means functional labels, such as GND, SIGNAL, GAIN, etc.

@justjed-

ahh..thanks. I suppose that WOULD help people follow the diagram easier. (I can make changes...np)

here is updated diagram...

showing a legend for PIN-OUT on the lm386 and the 10uF cap added for GAIN

@runaway_pancake-

some of it makes sense.. like over-driving.. makes the audio go 'crap' (clipping/distortion)

Im trying tp understand what it is I shoudl do from your comments..

1.) add a 1.2k resistor to the 10uF cap I added to the GAIN... yes? (does it matter what side I put it on? + or - side of the cap?)

2.) add a 0.1uF cap to pin 7 (bypass pin) to GND...

correct?

anyone care to help educate me about how to define or figure out anything about the signal BEFORE it goes to the amp/LM386?
was a comment about signal integrity BEFORE it goes there.. but I wouldnt have any clue on that.

a quick background on the sound INPUT (SND out from the PIC chip)..

I am using a PIC24FJ chip.. flashed with an API of some sorts to let noobs write generic code based on the API/instruction set.. (this 'code goes on .txt file on SD card..which is then loaded into the PIC chip upon powering it up)..

this is not mine.. I have no control over it..

however it has an EASY API to use..for doing simple things like PWM and playing audio..etc.. ( a very simple and generic platform)..

the PIC chip itself.. (somehow) outputs Audio on its set pin(s)... this is what I am trying to use/tap so I can output to a speaker..etc..

anyways.. thanks you guys for the replies so far.. and understanding that not everyone has the skill sets you may have become accustomed to! =)

I was thinking more of posting a schematic. This is much easier to see what is happening electrically.

1.) add a 1.2k resistor to the 10uF cap I added to the GAIN... yes? (does it matter what side I put it on? + or - side of the cap?)
I don't think it matters, but they show it between pin1 and Cap+, Cap- going to pin8.

2.) add a 0.1uF cap to pin 7 (bypass pin) to GND...
"Experiment for value", try various cap values, one lead to pin7 and the other to GND. If it has a good effect then use it, if it makes things worse or has no effect then lose it.

hi guys--

@crossroads-

I understand.. but schematics like that take some people time to understand or learn. (especially symbols, and how wiring can be followed/traced)..etc

which is why I asked/posted for an image/diagram.. vs schematic.

I understand 'better get used to reading schematics if you want to be in this hobby'...(yadda yadda).. (those kinda statements dont do much in HELPING one learn or be better) the OP can usually only give the resources knowledge he has. =)

for me thats a image/diagram of how I have things wired.

@runaway_pancake-

That I will try that, test different values and see what I 'see' (hear) =)

Anyone care to tackle the comment made previously about the signal out of/from the PIC chip? since it was mentioned that all this other stuff means nothing if that source signal is no good?

thanks!

Anyone care to tackle the comment made previously about the signal out of/from the PIC chip? since it was mentioned that all this other stuff means nothing if that source signal is no good?
Well, I did. It's not that it's "no good", just that it is what it is. If it's clipped/over-amplified that's a matter you can take steps to address, but beyond that, you cannot transform square waves and pulses into pure sine waves.
What is the sound quality compared to your other amp (better/same/worse)? (If it's like the one I'm thinking it is, that's LM386-based, too.)
Maybe give that input capacitor (ac-coupling cap), the one between the source and the pot, a go.