i want build a digital volume control with Arduino using the x9c103p (digital potentiometer) and any audio amplifier (for example lm386....module i got from ebay ( http://www.ebay.com/itm/200-Times-gain-5V-12V-LM386-Audio-Amplifier-Module-10K-Adjustable-Resistance-/381374674361?hash=item58cbb3b5b9:g:clcAAOxySoJTV96e)

any suggestion how to do this?


Have you studied the [u]datasheet[/u]?

I assume you know how to wire an analog-mechanical pot?

There are 3 digital inputs, which you need to connect to 3 Arduino outputs -

Chip Select - Write a low to that pin first.

Up/Down - Write a high if you want to wiper to go up (toward RH) and write a low if you want it to go down.

Increment - Alternately write low & high and the pot will take one step (up or down) on every falling edge of this pin.

Write a high to Chip Select to lock-in the setting.

As you may know, volume controls are exponential ([u]audio taper[/u]) due to our logarithmic hearing. A linear pot will sound way too loud at the mid point.

Since digital pots are linear, sometimes you can compensate for that in software. But with up/down controls, your software may not know where the pot is set. In any case, don’t be surprised if the pot doesn’t sound like it’s operating linearly.

Working genial! library for Arduino

See my proyect Spanish Forum