A digital potentiometer probably can’t be considered the most glamorous of electronic components. But it is easy to use and versatile. In this article, Stuart digs into the uses, advantages and disadvantages of digital potentiometers, including how they contrast to mechanical potentiometers.
By Stuart Ball
One good entry point into the understanding of digital potentiometers is to contrast them alongside mechanical potentiometers. So, let’s start there. If you wanted a volume control on a headphone amplifier, you might use a circuit similar to the one shown in Figure 1. A mechanical potentiometer connects to the audio input from some signal source, such as a radio or computer. The other end of the potentiometer connects to ground. The wiper connects to the input of the audio amplifier.
The potentiometer has a knob, and as you turn the knob, the wiper moves across a resistive element between the audio input and ground. When the wiper is at the ground end of the resistive element, the amplifier gets almost no signal, and the volume is off. When the wiper is at the other end of the resistive element, the amplifier gets the full signal amplitude, and the volume is at maximum. Between the two endpoints, the volume is attenuated. A stereo system would typically have two potentiometers on the same shaft, so the volume in both channels is the same.
The mechanical potentiometer has some drawbacks. The most obvious one is the need for one knob for every function to be controlled. If you have volume plus tone controls for high, midrange and bass, then you need three more knobs. If you have volume plus an eight-band stereo graphic equalizer, then you need a total of 17 knobs, one for volume and eight equalizer knobs for each stereo channel.
Another issue with mechanical potentiometers is that the wiper must maintain contact with the resistive element. As the knob is turned, the wiper slowly wears away the material on the resistive element, leaving dead spots where no contact is made. If you’ve ever heard a scratchy sound as you turn a volume knob, that is usually the result of the potentiometer material wearing away in spots.
The issue of a worn potentiometer element also causes the wiper to be momentarily open or disconnected as the knob is turned. In an audio circuit, this causes undesirable noise. In other circuits, such as those involving motor control, this can cause more serious consequences.
Figure 2 is a block diagram of a digital potentiometer, or “digipot,” connected to a microcontroller (MCU). Like a mechanical potentiometer, the digital potentiometer has two ends (A1 and B1) and a “wiper” (W1).
But the digital potentiometer doesn’t have a single resistance element with a moveable wiper. Instead, it is a series string of resistors with electronic switches that select taps in the string (Figure 3). For an 8-bit, 256-position device, there are 256 internal switches and 256 taps in the resistor string. The position of the “wiper” is defined by a digital word, controlling which switch is turned on and which tap is selected. It is controlled electronically by the MCU. In Figure 2 the potentiometer uses the standard SPI interface, though other interfaces such as I2C are available.
Showing an example circuit, Figure 4 is a schematic of a Texas Instruments (TI) TM4C1233H6 MCU  connected to an Analog Devices AD8400 digital potentiometer . In the schematic, the wiper output of the potentiometer drives (through op-amp U4) the base of a transistor that acts as a constant current driver for an LED. The digital potentiometer is an 8-bit device, meaning that the wiper moves between the B1 and A1 values as the control byte ranges from 0 to 255.
The upper terminal of the potentiometer is connected to 3.3 V, and the lower terminal is connected to ground. As a result, the wiper varies between these two voltages as the control value varies from 0 to 255. That voltage drives the transistor base through U4. …
Read the full article in the October 351 issue of Circuit Cellar
(Full article word count: 3057 words; Figure count: 7 Figures).