# Implementing a programmable variable resistor

The R-2R network can provide digital-to-analogue conversion of arbitrary precision using resistances of only two values. Is there a corresponding circuit architecture that switches resistance values to provide a variable resistance?

I want to implement a digitally programmable resistance. The dream solution would be something that could produce all of the E24 series over 5 decades, i.e. 100, 110, 120, ... 82M, 91M, 100M, but I would settle for a proof of concept - a design (scalable) that could accept say, a 4-bit digital input and give 16 exponentially or linearly increasing resistance values. The unit needs to be a two-terminal fully isolated unit and would probably use reed relay switches to provide isolation and minimize switch resistance losses.

A trivial solution to this would use a resistor of every required value, a corresponding reed relay switch, and a whole heap of logic to turn on the appropriate switch. I'm hoping there is a circuit that uses one switch per bit and fewer resistors.

• This is called a digital potentiometer. – Hearth May 19 '17 at 21:05
• To add on to that, it should be noted that digital potentiometers are very sensitive to overvoltage and excessive power, not at all like the robust resistors you'd probably be familiar with. If you want a high-power device, you might be able to do something with a power MOSFET (or MOSFET module) in linear mode with a control system measuring the source-drain voltage and adjusting the gate-source voltage to keep the current proportional to the voltage. – Hearth May 19 '17 at 21:09
• Thanks for commenting. It's not really a digital potentiometer as that would be a three-terminal device. While a digital potentiometer would work if I only used two of the terminals, I'm not sure that they are available with full isolation between the control and signal. I won't necessarily have any more access to the system under test than the two termination points of the resistor I'm wanting to emulate, so an active solution using FETs is probably out of the question. – rossmcm May 19 '17 at 22:14
• Well, as you mentioned, you could just use two of the terminals! Really, though, Spehro's answer below is much better than what I said. I don't know why I didn't think of a decade box with relays..! – Hearth May 19 '17 at 22:17

So 20 resistor values will give you from 1 ohm to 1.048575 Megohm in steps of 1 ohm (however it will surely not be monotonic!). The n'th resistor from 0 to 19 would be $2^n\Omega$, so 1$\Omega$, 2$\Omega$, 4$\Omega$, 8$\Omega$, 16$\Omega$,.., 524288$\Omega$