Volume knob from Arduino signal to LM386 amp circuit (too loud)

Hello,

I've been struggling with this for a bit.

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:

thanks!!

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.

This is the OP's circuit

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.

Or even 100k.

Hello,

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.

Source: Teensy2 USB WAV player – Part 2

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,

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

Explain wonky?

Can you get zero output volume with the pots you have tried?

Thanks.. Tom.. :slight_smile:

Thank you all for answering! I shouldn't have posted this before going out of town, now I'll have to wait to try changing it.

I'll try to find a logarithmic pot. And play with higher Ohm resistors.

Tom, I do remember getting zero volume with the pots I tried. If I visualise the pot sweep action as a timeline it went something like this:

000000000138!!000000

Where ! = Really loud and 0 = no sound

I'll report back soon.

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.. Tom... :slight_smile:

Missing dc-blocking capacitor?

Hi,

Tom... :slight_smile:

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.

Ty