Virtual potentiometers with arduino

Hi everyone…i’m new in this forum…not native speaker so i’ll try to do my best!

I’m in a trouble with arduino and a variable resistor. i need to make a variable resistor from 0 to 100kohm controlled by arduino, i need a resistor with several intermediate steps between those two values and a fast response because i’m planning to use it with an audio effect so i need a very quick response as i said. i was thinking then in optocoupler like VTLs, i tried controlling one with PWM but the range of values is so small (from 0 to 6kohm) after that the curve of response vs PWM is not useful. i think there’s and standard procedure to achieve with i’m trying but i haven’t read any reference to it yet. Another idea i had is to use the optocoupler to make a variable resistor between 0 and 6kohm in a voltage regulator (like LM317) and use the output to control the LED of a second optocoupler and try to achieve a wide range of resistance values. What’s best? is there another suggested procedure?

Thank you for reading :slight_smile:

You can solve your problem easily with a digital pot.

a fast response

How fast? Can you accept a step at a time to go from one value to another, or do you need to 'jump' from one setting to another? Linear response, or audio taper response? Mono or stereo? Check these "audio taper digital pot" with whatever supplier you have access to for your country (and add that country to your profile)

thank so much! (i’ll add my country to my profile)

fast i mean about a few ms from one value to another, because i will emulate a wah-wah response, for example VTL5C3’s response is 3.5ms i think a similar amount is fine for me. i think the response is linear and i don’t need to jump from start to end value but if i can , i could use it to other functions. Didn’t know about digital pots…i’ll read more info, thank you again

i think this one will work for me:

or maybe 2x50k for more steps between 0 and 100kohm…i only need it for mono applications


You can use digital potentiometer. Here is List from Maxim Web site: . This are dual channel potentiometer. 50k ohm /channel, you can connect wiper in series if you need 100k.


you are all so kind :) i'll read more info about digital pots

A digital pot has a fixed number of set points, rapidly switching the value will lead to audible artifacts - a Wah-wah probably needs a VGA driven from a DAC via a LPF (voltage controlled amplifier, digital-to-analog-converter, low-pass-filter)

That means that the gain changes smoothly with time rather than in discrete steps.

Failing that go for a digital pot with as many steps as possible - 10 bit (1024 steps) seems to be the maximum.

ill try but i think 128 steps for me are fine, after all, you barely can move a mechanical potentiometer 1 degree per step or you mean noise FROM the IC? Wah-Wah is basically a variable filter with an inductor and a capacitor but you use a resistor to vary the cutoff frequency. I know there are digital Wah-Wah based on MIDI (128 steps) so i think they should use digital pots to perform the change...i'll do some test and i'll tell how they work :)

The problem is that the resistance steps modulate the signal, producing a signal at the step-change frequency, which if its not in the middle of an existing signal will likely be an audible buzz, even if its 40dB down it will be annoying...

All depends on how the filter is setup - if the resistance affects the gain it will modulate the signal.

i think ill try with the IC in my hand...but...if i have a fixed value of digital resistor there will be no modulation noise ? or it will be there every time i use them?? i'm still researching about wah technologies

"Audio" is not particularly fast, in electronics terms.