I built an amp circuit based on the LM386-1 I'm powering it with DC12V. It's conected to a small speaker of unknown characteristics because it's salvaged.
I have it connected to an arduino program outputting some synth sounds on digital pin 9. I can input audio signal from my smart phone and it sounds really good. I measured the voltage and it was about .6V coming out of the phone.
The Arduino however outputs about 2.4V when sound is playing (my multimeter is not very good though) and the volume pot only seems to work in an area around the middle of the sweep and it goes from nothing to way too loud in no time. I tried a voltage divider manually with resistors to bring it down to under .5V but it seems to sound just as loud? as if the amp was just adaptively increasing the volume. I used a 10KΩ and a 1KΩ which brought down the voltage but it still sounds too loud from the arduino as opposed to the phone.
So I have two related ( I think) problems:
1 What should I do to make it sound quieter like the phone?
2 Why is the volume potentiometer wonky (I've tried a few, from a slide pot, to a couple of shaft pots)
This is the schematic and components I'm using:
Are you using an audio taper pot? How is the pot wired up?
An Arduino is outputing a PWM signal, a square wave from 0 to 5V. On your meter, it will read the AC voltage as 1/2 of Vcc, because the signal is 5Vpp but it measures rms, however a 5Vpp square wave will read about 2.5Vrms because it is 2.5Vpp.
An LM386 has a gain designed to amplify a MUCH smaller signal. Do you have an isolating capacitor in between?
We really need a schematic, that would answer a LOT of questions.
It looks fine but as polymorph said you need an audio taper pot, sometimes called just a log pot to make the adjustment sound right. I guess you have been using linear pots so far.
If you want to cut it down further place a 10K resistor or so between the top end of the pot and the capacitor. Experement with the value of this resistor until you are suited.
I believe this problem is due to PWM, because the square wave generates many harmonics, maybe it is interesting to make a low pass filter before sending the signal to the potentiometer.
rtek1000:
I believe this problem is due to PWM, because the square wave generates many harmonics, maybe it is interesting to make a low pass filter before sending the signal to the potentiometer.
No nothing to do with it. Second post you have got wrong today, not having a good one are you.
If your theory was correct the OP would get a lot of distortion not excess volume.
Hi,
Something not right with those findings, even with the wrong taper pot, you should have no sound at one end and full sound at the other.
With full sound in the middle, is showing a wiring fault.
When you get back can you post a picture of one of the pots connected to you project, so we can see your component layout?
Thanks to all who replied! It ended up being the log pot. I was trying to use linear pots. Using a log pot fixed it. I did have to ad a voltage divider of fixed value (two resistors) to lower the overall volume a bit. In theory this didn't make sense to me because the pot should change the volume as a ratio? but in practice it helped. Perhaps I had the wrong amount of K ohms pot.