Industrial controls and variable-bias circuits sometimes require the services of voltage-to-resistance converters. But they can be difficult to implement. The simple approach shown in the figure builds such a converter with two identical digital potentiometers.
Digital potentiometer U1 and comparator U3 form a digital track-and-hold circuit, in which U1 adjusts its internal voltage divider to make VWIPER track VIN. Therefore, wiper resistance is proportional to VIN. Because the digital inputs of U1 and U2 are connected together, U2 and U1 have the same wiper positions and the same resistances between corresponding terminals. Thus, the output resistance is proportional to VIN, as required for voltage-to-resistance conversion.
Operation of the digital track-and-hold is as follows: To track VIN, the wiper (center tap) of digital potentiometer U1 moves up or down as each clock pulse arrives. Comparator U3 compares the analog input (VIN) with the wiper voltage (VWIPER).
If VIN > VWIPER, the comparator asserts logic high, causing the wiper position to move up and increase the value of VWIPER. VWIPER keeps increasing until it's greater than VIN. Then the comparator toggles and drives the wiper position downward. On each clock cycle, the wiper moves up or down as required to track VIN. Reference inputs for the voltage divider (VH and VL) set the input voltage range: If the VIN range is 0 to 5 V dc, set VL = GND and VH = 5 V dc.
Because U1 and U2 are identical and their digital inputs are connected together, their wiper positions are the same. Applying a logic Low to the LOCK input allows the output resistance to change with VIN, while applying a logic High holds the resistance value indefinitely.
LOCK may be connected permanently to ground. In that case, though, the output resistance toggles continually between two consecutive states, even if VIN is constant. For example, if the potentiometer is 10 kΩ and you set the wiper to 5 kΩ, the output resistance will toggle between 5.0 and 5.3125 kΩ on every clock cycle. If necessary, you can filter that effect by connecting a capacitor to the output wiper. A clock frequency between 100 Hz and 10 kHz is acceptable.
Output resistance doesn't change instantly with VIN, but it takes a number of clock cycles to reach its final value. The number of cycles (32 max) depends on the initial wiper position and the input voltage.
If higher resolution is needed, substitute a 6- or 8-bit digital potentiometer for the 5-bit model shown. Choose a digital pot that has a known state at power-up. Note that the MAX5160 has a power-up reset that sets the wiper position to mid-scale, enabling the two digital pots to synchronize to the same resistance.