lm386 amplifier problems

I have built a simple 8 oscillator + resonant low pass filter synthesizer (see Joe Marshall - Human Computer Interaction Research for more details) on my arduino Duemilanove, using 8 bit direct digital synthesis on pin 11.

I've been testing using a piezo sounder, and now I need it to be louder.

So, I've got me an lm386 amplifier chip, and built the circuit 1 (amplify by 20 times) from the datasheet.

I stuck the output from the arduino directly into pin3, which makes sound, but it is clearly too big a signal on the input (gets some analog distortion).

So, I've put a DC blocking capacitor, followed by a 100k log pot on the input, which goes to pin 3 of the LM386.

Now basically, I appear to have a choice of very very quiet (at the bottom of the pot), and then suddenly some kind of very loud oscillation, like some kind of crazy feedback is going on, with nothing in between.

I've tried with and without the DC blocking capacitor, with similar results.

I've also tried with voltage dividing resistors before the pot to bring the voltage down to .2v before the pot, an extra 100k resistor before the pot, etc etc.

I've tried powering it off the 5v supply from the ardiuno USB, and also running everything off a 9v battery.

Does anyone have a built example of a simple arduino -> LM386 -> 8ohm speaker circuit that I could see, so I can try and fix up my circuit, or any ideas of what on earth I'm doing wrong.

cheers,

Joe

Does anyone have a built example of a simple arduino -> LM386 -> 8ohm speaker circuit that I could see,

I built 4 of these circuits in a box to act as headphone amplifiers for some of my audio projects for the Maker Fair. I built four such boxes and all worked without problem.
However I did have proper supply decoupling, I put a 1000uF on the 12V input. Attached is a photo of the layout I used.
I used the bass boost circuit.

Amp.JPG

However I did have proper supply decoupling, I put a 1000uF on the 12V input.

Aaargh, I wish I knew a little more about electronics! In one short sentence, you've come up with the fix for what I spent an hour and a half failing to get working - bunged a capacitor across the ground/power rails and as if by magic the distorted noise disappears. Sound-tastic, thanks ever so much!

I knew it must be something stupid - my knowledge of electronics is pretty limited to say the least - I'm happy writing assembler code for the microprocessor and all that, but once it comes to the hardware end of things I am all too often stumped and asking stupid questions on the internet.

Joe

Not to worry decoupling is one of those things that tends not to be taught. For more detail see my page:-
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

This works nicely. I'm using it.
http://www.ebay.com/itm/120809936867

joemarshall:
So, I've put a DC blocking capacitor, followed by a 100k log pot on the input, which goes to pin 3 of the LM386.

Dit you connect the Log pot the correct way. Try to change the two outer connections.

joemarshall:
So, I've got me an lm386 amplifier chip, and built the circuit 1 (amplify by 20 times) from the datasheet.

I stuck the output from the arduino directly into pin3, which makes sound, but it is clearly too big a signal on the input (gets some analog distortion).

So, I've put a DC blocking capacitor, followed by a 100k log pot on the input, which goes to pin 3 of the LM386.

Now basically, I appear to have a choice of very very quiet (at the bottom of the pot), and then suddenly some kind of very loud oscillation, like some kind of crazy feedback is going on, with nothing in between.

That is the LM386 doing what it does best, Motorboating :wink: This can easily be corrected by a large value suply decoupling capacitor as close to the IC GND and Positive voltage supply pins as possible.