# Digital Potentiometer - Volume Control

I am trying to use a digital potentiometer for volume control with my Arduino Uno. I am using the LM386 amplifier with the above setup. The mechanical 10K pot has been replaced with a 10K AD5245 Digital pot.

Here is how the pot is wired up:
A = Pin for of Arduino Uno
B = GND
W = Pin 3 of the Amplifier
SDA = A4
SCL = A5
Vdd = 5V (Arduino)
GND = GND

I tested out a simple program to check the adjustments of volume and here is the code:

``````  tone(4, 261); //Output tone on pin 4 and 261Hz
Wire.beginTransmission(44); // transmit to device #44 (0x2c)
Wire.write(byte(0x00));            // sends instruction byte
Wire.write(val);             // sends potentiometer value byte
Wire.endTransmission();     // stop transmitting

val++;        // increment value
if(val == 255)
{
val = 0;    // start over from lowest value
}
delay(1000);
``````

It increases resistance until the value 255 is reached. After testing the code out, the 4th or 5th value is equal to max volume. When using a mechanical linear pot, the volume can be adjust in the first half a turn before reaching maximum volume. Am I doing anything wrong here? Any advice much appreciated!

When using a mechanical linear pot, the volume can be adjust in the first half a turn before reaching maximum volume.

Linear pot, or audio/logarithmic pot?

Audio taper example

Your hearing and your brain are proportional or logarithmic. .

For example, if you go from 1* to 2, that's in increase of +1, or +100% (or +6dB), which is a big obvious change.

If you go from 9 to 10, that also an increase of +1, but it's only about +10% (about +1dB) which is barely noticeable.

Or, you can think about 1 singer or guitar player vs 2 singers or guitar players. If you have a group of 9 or 10 signers or guitar players, you might not notice if you add or subtract one.

You could do the thing with a length of rope... A 20-foot (or meter) length of rope is a LOT longer than a 10-foot length of rope. But, if your rope is 1000 feet long, a 10-foot difference doesn't seem like much.

• These numbers could represent signal voltage, or any other linear amplitude.