As a result, for the data 00 to FF, the
load current varies linearly from 4 mA to
20 mA.
However, the digital potentiometer's
wiper resistance is significant even when
RV is low, which introduces an error. To
eliminate this error, the digital potentiometer
is connected as a voltage divider, with
the wiper resistance in series with the op
amp's non-inverting input.
If a 0.08-mA current source isn't readily
available, you can use a National Semiconductor
LM134 three-terminal adjustable
current source and a potentiometer (VR1)
to precisely set I at 0.08 mA (Fig. 2). Similarly,
if a precise 5000-Ω resistance is
unavailable for R2, a 10-kΩ multi-turn
potentiometer can be employed.
The advantage of this circuit is its
simplicity and the fact that it uses only
three of the microcontroller's port lines
(SPI), unlike a DAC, which requires
eight port lines for the 8-bit data. The
circuit uses only a positive supply rail
for operation. Digital potentiometers
also are available with I2C interfaces,
with integrated op amps, and with different
resistance values. Designers can
adapt this circuit for use with these digital
potentiometers.