Go Down

Topic: How to wire up LM386 amp for audio? (Read 10759 times) previous topic - next topic

xl97

Hi-

I need some help on figuring out how to wire up am LM386 amp for simple audio.

I have searched and found many different approaches/methods..

and I 'thought' I had it working.. but unfortunately.. I get no sound. =(   (not sure if I have something wrong? (or if I need some resistors or whatever to create what I read is called a low filter pass for freq.)

I am very new to this, so please understand if you use phrases or terminology that someone with experience in this field would understand,.... I wont be able to use your advice/help! =)


I did give it a shot..and made a diagram on how I have things wired up..



thanks for any help provided. =)


jackrae

you need a 10uF between pins 1 and 8

What are you using as your audio input signal - if it's a condensor mike then it too needs a power supply

xl97

Thanks for the reply..


are you 'sure' anything is needed between pins 1 & 8?  I have seen many, including the layout Im trying to copy/mimic, that have NOTHING on the pins 1 & 8



my SOUND INPUT is actually coming from a PIC chip...  that has a pre-define/flashed firmware on it.. and that specific pin is the SND output pin.

I tested my 'code'.. with a RadioShack, mini amplified speaker.. and the sound 'does' play..  albeit a bit poorly..  (if volume its way up it sounds like crap!. if volume is mid-way it low/soft..but sound ok/better as far as clarity).. by bypassing the AMP all together.. and plugging the RS mini amp speaker to GNS rail and the SND pin on the pic directly..




jackrae

Can you confirm you have connected a second (ground) connection between your sound source and the amplifier circuit ground.

The capacitor between 1 and 8 increases the gain by a factor of 10 (ref the datasheet)

5 volts supply rail is the absolute minimum, have you tried a higher supply.

Forget about low pass / high pass filters - at this stage you only need to consider getting any sound, not quality.

And finally, are you sure that it is wired correctly.

I'd suggest fitting a test meter in the battery supply line to see if it's actually drawing current.

xl97

hi-

thanks for the reply! =)



this I dont understand:
"Can you confirm you have connected a second (ground) connection between your sound source and the amplifier circuit ground."

**on my diagram.. you mean the green trace needs to have a 'branch' off to GND?


Also.. should be default GAIN of 20 without anything on pins 1 & 8..right?  is that not enough to 'do' anything?  The board/pcb I have in my hand doesnt have anything on the 1 & 8 pins..

I 'can' add that if you are telling me that is the error/problem?  (but that should only have to do with volume......correct?  not working or not working at all?

I have NOT tried a higher supply voltage than 5v...  I can try to jump/use my V++ input rail.. (before my 5v vRegulator)..  which is controlled by my PSU..  (usually at like 7.4v..to mimic a li-ion pack I'll eventually be using)



No.. . I am NOT sure things are wired correctly...  I 'am' sure (however) that it is wired as I have re-created in my diagram above.  =)


I do have a digital multi-meter, but am not sure where/what pins I would meter to check things out..   

I know my code and PIC is wired up correctly.. as my LEDs and 'animation'  (etc..etc)  is working fine..  just no 'audio' when I hook my speaker up to the 'amp'..

(again bypassing that and going directly with a pre-amp speaker... using the sound input/green trace and GND works fine.. although a bit 'soft'..)

jackrae

Signals from a source to an amplifier are fed via 2 wires, usually a coaxial cable, one (the core) carries the variable signal and the other (the outer shield) is the reference point - usually ground.  However for experimental purposes a pair of separate wires will be good enough.

So from your PIC circuit you should have 2 wires, one feeding the signal to the amplifier input and the other, the ground reference connected to your amplifier ground.

Your circuit doesn't show how you connect the signal from the PIC circuit to the potentiometer.  This circuit must be connected via an isolation capacitor. The value is determined by the input impedance of your amplifier, which in this case is the value of the potentiometer.  I'd suggest a 10uF as a starting point.  The capacitor is a DC blocker which permits only the AC signal tyo get through to the OPamp.  Without this blocker the DC level of the PIC circuit may be biasing the OPamp into a ground or VCC saturated state and so prevent it reacting to the AC signal.

I take it you have also tried adjusting the pot to ensure it isn't set to feed 0% into the amplifier input.

xl97

sorry for being dense.. (Im trying though!)  lol

ok..

well the green wire/trace in the pic IS the trace that goes to the PIC chip.. (pin 15 to be exact)

and from the pic.. that green line IS going to the 10k pot?   

everything on the breadboard has the same GND rails?   


I dont know what this means: "This circuit must be connected via an isolation capacitor."

So Im still not clear on what I need to do to fix it?

I need to put a 10uF cap on the same line/trace (green) in the diagram and connect it to GND?

is that what your saying?


thanks


jackrae

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


xl97

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







Runaway Pancake

#9
Oct 22, 2011, 10:02 pm Last Edit: Oct 22, 2011, 10:06 pm by runaway_pancake Reason: 1
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.)
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

xl97

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





Runaway Pancake

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.)
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

xl97

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

Runaway Pancake

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.
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

xl97

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!

Go Up