The Fundamentals of Digital Potentiometers and How to Use Them
Contributed By Digi-Key's North American Editors
Mechanical potentiometers have been used by designers for decades in applications ranging from circuit trimming to volume control. However, they have their limitations: their wipers can wear out, they are susceptible to moisture ingress, and they can accidentally be moved off their set position. Further, as the world turns digital, designers need an alternative to meet requirements for more precise control and high reliability, along with flexibility to adjust values remotely via firmware.
Digital potentiometer ICs—often called digipots—solve these issues by bridging the digital domain and the analog resistor world. As an all-electronic, microcontroller-compatible component, digipots allow a processor and software to control, set, and vary their resistance value or voltage divider ratio.
They offer features and functions which mechanical devices cannot provide and are more rugged and reliable as they have no moving wiper. They cannot be deliberately tweaked or inadvertently adjusted, avoiding inexplicable performance changes. Applications include LED thermal stabilization, LED dimming, closed-loop gain control, audio volume adjustment, calibration, and Wheatstone bridge trims for sensors, controlling current sources, and tuning programmable analog filters, to cite just a few.
This article will provide a brief introduction to potentiometers and their evolution toward digipots. It will then use components from Analog Devices, Maxim Integrated, Microchip Technology, and Texas Instruments to explain digipot operation, basic and advanced configurations, and how they address circuit adjustment requirements. It will show how their functions, features, capabilities, and options can be used to simplify circuits, make circuits processor compatible, and reduce or even eliminate the need for bulky, less-reliable mechanical potentiometers.
Begin with potentiometer basics
The potentiometer has been an essential, passive circuit component from the earliest days of electricity and electronics. It is a three-terminal device with an accessible resistor element, providing a voltage divider function via its user-settable wiper on a rotating shaft. It is used in countless analog and mixed-signal circuits to fulfill a wide variety of application requirements (Figure 1).
Figure 1: The standard potentiometer is a user-settable variable resistor with a rotating shaft. (Image source: etechnog.com)
The resistance seen by the circuit between either end contact and the adjustable wiper varies from zero ohms (nominal) to the full rating of the wire or film resistance as the wiper rotates and slides along the resistive element. Most potentiometers have a rotation range of about 270 to 300 degrees, with a typical mechanical resolution and repeatability of around 0.5% and 1% of full-scale value (between one part in 200 and 100, respectively).
Note that there is a slight but distinct and important difference between a potentiometer and its junior sibling, the rheostat. A potentiometer is a three-terminal device acting as a voltage divider (Figure 2, left), while the rheostat is a two-terminal adjustable resistance which controls current flow. The potentiometer is often wired to create a rheostat which can be done in one of three similar ways, by leaving an end terminal uncorrected or connected directly to the wiper (Figure 2, right).
Figure 2: The potentiometer with end terminals A and B and wiper W (left) can easily be used as a rheostat with any one of three connection approaches (right). (Image source: Analog Devices)
Digipots: Potentiometers in IC form
The all-electronic digital potentiometer emulates the functionality of the electromechanical potentiometer but does so using an IC without moving parts. It accepts a digital code in one of several formats and establishes a corresponding resistance value. As such, it is sometimes referred to as a resistive digital-to-analog converter (RDAC).
In a traditional potentiometer, a hand (or sometimes even a small motor) sets the wiper position and thus the voltage divider ratio. In a digipot, however, computer controls connect to the digipot IC over a digital interface and establish an equivalent value to the wiper position (Figure 3).
Figure 3: The digipot IC replaces manual setting of the potentiometer wiper with a digitally set electronic switch which emulates a mechanical wiper. (Image source: Circuits101, modified)
The digipot uses standard CMOS IC technology and does not require special fabrication or handling. The size of a surface-mount digipot IC, typically 3 x 3 millimeters (mm) or less, is far smaller than a knob-adjusted potentiometer or even a small screwdriver-adjusted trimmer potentiometer (trimpot) and is handled just like any other surface mount technology (SMT) IC with respect to pc board production.
In principle, the digipot’s internal topology consists of a simple serial string of resistors with digitally addressable electronic switches between the wiper and these resistors. Using a digital command, the appropriate switch is turned on while others are turned off, thus establishing the desired wiper position. In practice, this topology has some drawbacks including a large number of resistors and switches required and a larger die size.
To minimize these concerns, vendors have devised clever alternative resistor and switch arrangements which reduce their numbers but produce the same effect. Each of these topologies results in small differences in how the digipot is ranged and its second-tier characteristics, but much of this is transparent to the user. For the remainder of this article, we’ll use the term potentiometer for the electromechanical device and digipot for the all-electronic one.
Digipots offered range of specifications, features
As with any component, there are top-tier parameters as well as secondary ones to consider when selecting a digipot. The top rank issues are nominal resistance value, resolution, and the type of digital interface, while considerations include tolerance and error sources, voltage range, bandwidth, and distortion.
• The required resistance value, often called end-to-end resistance, is determined by the design considerations of the circuit. Vendors offer resistances between 5 kilohms (kΩ) and 100 kΩ in a 1/2/5 sequence with some other intermediate values. Additionally, there are extended range units which go as low as 1 kΩ and as high as 1 megaohm (MΩ).
• Resolution defines how many discrete step or tap settings the digipot offers, ranging from 32 to 1024 steps to allow the designer to match the needs of the application. Keep in mind that even a mid-range 256 step (8-bit) digipot has higher resolution than a potentiometer.
• The digital interface between the microcontroller and the digipot is available in standard serial SPI and I2C formats, along with address pins so that multiple devices can be connected via a single bus. The microcontroller uses a simple data encoding scheme to indicate the desired resistance setting. A minimalist digipot such as the Texas Instruments TPL0501, a 256-tap digipot with SPI interface is a good fit where power dissipation and size are critical (Figure 4). It is available in space-saving 8 pin SOT-23 (1.50 mm × 1.50 mm) and 8 pin UQFN (1.63 mm × 2.90 mm) packages.
Figure 4: A basic digipot such as the TPL0501 from Texas Instruments with an SPI interface is an effective component for space and power-constrained applications that do not need additional features. (Image source: Texas Instruments)
One application example is its use in clinical-grade, wearable medical devices such as oximeters and sensor patches, where it is paired with TI’s OPA320 op-amp (Figure 5). The combination creates a voltage divider to control the gain of the amplifier which provides the digital-to-analog converter (DAC) output. The obvious question is why not simply use a standard complete DAC? The reason here is that this clinical application requires a precision, rail-to-rail analog output with high a common-mode rejection ratio (CMRR) and low noise, for which the OPA320 is specified at 114 decibels (dB) and 7 nanovolts per root hertz (nV/√Hz) at 10 kilohertz (kHz), respectively.
Figure 5: A digipot can be paired with a precision op-amp such as TI’s OPA320 to create a DAC with superior output op-amp performance. (Image source: Texas Instruments)
In addition, there are digipot interface variations that simplify their use in applications such as user-operated volume controls. Two other options are the pushbutton and the up/down (U/D) interface. With the pushbutton interface, the user pushes one of two available buttons: one to increment the resistance count and the other to decrement it. Note that there is no processor involved in this action (Figure 6).
Figure 6: The pushbutton interface allows for a processor-free connection between two user-operated pushbuttons, leading to direct incrementing/decrementing of the digipot setting. (Image source: Analog Devices)
The U/D interface can be implemented with minimal software overhead and is triggered via a simple rotary encoder or pushbutton connected to a processor, and implemented using a digipot such as Microchip Technology’s MCP4011, a basic 64 step (6-bit) device that is available with resistance values of 2.1 kW, 5 kW, 10 kW, and 50 kW (Figure 7).
Figure 7: A digipot such as the MCP4011 from Microchip Technology with an edge-driven U/D control line and chip select requires minimal I/O and software resources from the host microcontroller. (Image source: Microchip Technology, modified)
It uses a single high or low-going edge-trigger, plus chip select to increase or decrease the resistance increment (Figure 8). This allows simple implementation of a knob which looks and feels like a traditional volume control, without the issues associated with potentiometers, yet with the benefits of digipots.
Figure 8: The U/D interface of a digipot supports edge-triggered incrementing and decrementing of the resistance value using a trigger from a low-resolution encoder. (Image source: Microchip Technology)
Tolerance for digipots may be an issue as it is typically between ±10 and ±20% of nominal value, which is acceptable in many ratiometric or closed-loop cases. However, it can be a critical parameter if the digipot is being matched to an external discrete resistor or a sensor in an open-loop application. For this reason, there are standard digipots with much tighter tolerance, as low as ±1%. Of course, as with all ICs, the temperature coefficient of resistance and associated temperature-related drift can also be a factor. Vendors specify this number in their datasheet so designers can assess its impact it via circuit models such as Spice. Other tight tolerance options are available and are discussed below.
Although not a concern in static applications such as calibration or bias-point setting, bandwidth, and distortion are issues in audio and related applications. The resistance path of a particular code, combined with the switch parasitics, pin, and board capacitances, creates a resistor-capacitor (RC) low-pass filter. Lower end-to-end resistor values yield a higher bandwidth, with bandwidths up to about 5 megahertz (MHz) for a 1 kΩ digipot, down to 5 kHz for a 1 MΩ unit.
In contrast, total harmonic distortion (THD) is largely due to nonlinearities in the resistances at different applied signal levels. Digipots with higher end-to-end resistance reduce the contribution of the internal switch resistance versus the total resistance, resulting in lower THD. Thus, bandwidth versus THD is a tradeoff designers must prioritize and weigh when choosing the nominal digipot value. Typical values range from -93 dB for a 20 kΩ digipot, down to -105 dB for a 100 kΩ units.
Dual, quad, and linear vs logarithmic digipot variations
In addition to their “hands-off” controllability, digipots offer additional simplicity, design-in ease, and much lower cost than potentiometers. Among their other capabilities:
• Dual digipots are useful where two resistances must be adjusted independently but are especially useful when they must be at the same value. While two separate digipot ICs could be used, the dual device adds the benefit of tracking resistance values despite tolerance and drift; quad devices are also available.
• Linear versus logarithmic (log) settings: while trim and calibration applications usually need a linear relationship between the digital code and resultant resistance, many audio applications benefit from a logarithmic relationship to better fit the decibel scaling required in audio situations.
To meet this need, designers can use logarithmic digipots such as the DS1881E-050+ from Maxim Integrated Products. This dual-channel device operates from a single 5 volt supply, has a resistance of 45 kΩ end-to-end, and features an I2C interface with address pins to allow up to eight devices on the bus. The resistance value of each of the two channels can be set independently, and it features several user-selectable configuration settings; the basic configuration has 63 steps with 1 dB attenuation per step, from 0 dB to -62 dB, plus mute (Figure 9).
The DS1881E-050+ is designed to minimize crosstalk, and the two channels offer 0.5 dB channel-to-channel matching to minimize any volume difference between them. The device also implements zero-crossing resistor switching to prevent audible clicks and includes nonvolatile memory; the general utility of which is discussed below.
The maximum voltage which the digipot can handle is also a consideration. Low-voltage digipots are available for operation with rails as low as +2.5 volts (or ±2.5 volts with a bipolar supply), while higher voltage ones such as the Microchip Technology MCP41HV31—a 50 kΩ, 128 tap, SPI interface device—can work with rails up to 36 volts (±18 volts).
Nonvolatile memory assists with power resets
Basic digipots have many virtues but have one inescapable weakness compared to potentiometers: they lose their setting after power is removed, and their power-on reset (POR) position is set by their design, usually at mid-range. Unfortunately, for many applications, that POR setting is unacceptable. Consider a calibration setting: once established, it should be retained until deliberately adjusted, despite removal of line power or battery replacement; further, in many applications, the “correct” setting was the one which was last used when power was removed.
Therefore, one of the remaining reasons for staying with potentiometers was that they do not lose their setting on power reset, but digipots have addressed this shortcoming. It was initially common design practice to have the system processor read back the digipot setting during operation, then reload that setting on power up. However, this created power-on glitches and was often unacceptable for system integrity and performance.
To address this concern, vendors added EEPROM-based nonvolatile memory (NVM) technology to digipots. With NVM, the digipots can retain their last programmed wiper position when the power supply is switched off, while one-time programmable (OTP) versions allow the designer to set the wiper's power-on reset (POR) position to a pre-defined value.
NVM enables other enhancements. For example, the Analog Devices AD5141BCPZ10 has its resistor tolerance error stored in its EEPROM memory (Figure 10). The device is a single-channel, 128/256 position, rewriteable nonvolatile digital potentiometer that supports both I2C and SPI interfaces. Using the stored tolerance values, designers can calculate the actual end-to-end resistance to an accuracy of 0.01% to define the ratio of the “above wiper” and “below wiper” digipot segments. This accuracy is one-hundred times better than the 1% accuracy of even higher accuracy digipots without NVM.
Figure 10: The AD5141BCPZ10 digipot from Analog Devices incorporates re-writeable non-volatile memory (EEPROM) that can be used to store the desired power on reset settings, as well as calibration factors for its own resistor array. (Image source: Analog Devices)
This linear gain-setting mode allows independent programming of the resistance between the digital potentiometer terminals through the RAW and RWB string resistors, allowing for highly accurate resistor matching (Figure 11). Such accuracy is often needed for inverting amplifier topologies, for example, where the gain is determined by the ratio of two resistors.
Figure 11: The NVM in a digipot can also be used to store calibrated resistances above and below the wiper for circuits that use precise resistance ratios to set amplifier gain. (Image source: Analog Devices)
Be alert to digipot idiosyncrasies
While digipots are widely used to replace potentiometers where the traditional device is less desirable or impractical, they do have some characteristics designers need to factor in. For example, the metal wiper of a potentiometer contacts the resistive element with a near-zero contact resistance and usually has a negligible temperature coefficient. In the case of a digipot, however, the wiper is a CMOS element with a modest, but still meaningful resistance on the order of tens of ohms to 1 kΩ. If 1 milliampere (mA) of current goes through a 1 kΩ wiper, the resulting 1-volt drop across the wiper may limit the dynamic range of the output signal.
Further, this wiper resistance is a function of both applied voltage and temperature, so it introduces nonlinearity and thus distortion of AC signals in the signal path. The wiper typical temperature coefficient of about 300 parts per million per degree Celsius (ppm/⁰C) may be significant and should be factored into the error budget for high precision designs. Digipot models are also offered with a much lower coefficient.
The digipot is a digitally set IC that replaces the classic electromechanical potentiometer in many system architectures and circuit designs. Not only does it reduce product size and the likelihood of errors due to accidental movement, but it also adds compatibly with processors and thus software, while offering greater accuracy and higher resolution (if needed), along with other useful features.
As shown, digipots are available in a wide range of nominal resistance values, step sizes, and accuracies, while the addition of nonvolatile memory extends their capability and overcomes an important barrier to their use in many applications.
Disclaimer: The opinions, beliefs, and viewpoints expressed by the various authors and/or forum participants on this website do not necessarily reflect the opinions, beliefs, and viewpoints of Digi-Key Electronics or official policies of Digi-Key Electronics.