Digital Potentiometers (Digipots)

Clarus Goldsmith, June 2024

What is a digital potentiometer?

Digital potentiometers function using a "ladder" of resistors with floating wires at each junction. By setting the wiper register, the user can select which junction is connected to the wiper, and thus how many resistors in the ladder comprise the connection from A-to-W or from W-to-B.

Block diagram of a digipot's resistor network from the MCP4531T manual

The total number of resistors in a digipot is referred to as its number of taps or steps. In the above example from the manual of the MCP453X/455X/463X/465X family of digipots, the digipots can have 129 taps (i.e., 128 resistor ladder with 129 possible wiper positions) or 257 taps (i.e., 256 resistor ladder with 257 possible wiper positions). The resistance change at each step is then calculated as:

Step resistance equations from the MCP4531T manual

Digipot Hardware Limitations

Digipots are very low current devices.

The max allowable current across a digipot wiper is around 1-2.5 mA.

The wiper itself has resistance.

This resistance affects the functional range of the digipot, and can be quite high. For example, the DS3502 digipot has a resistance of 10kΩ between A and B, but has a 5kΩ wiper resistance. That means the functional range of resistance of the DS3502 between AW or WB is actually 0kΩ-15kΩ.

As a further example, here is the equation for calculating the WB resistance of the MCP453X/455X/463X/465X family of digipots:

How to calculate the WB resistance from the MCP4531T manual

Controlling a digipot with Arduino

Most digipots are controlled across the I2C bus. For more information on I2C, go here:

I2C Communication with Arduino

Here is example code for getting a MCP4531T digipot to increment its wiper value over time, and print the voltage at the wiper over Serial. The wiring diagram necessary for this code is also included below.

#include <Wire.h>
byte val = 0;
int errorPot;
byte a;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  // Wait until serial port is opened
  while (!Serial) { delay(1); }
  Wire.begin();
  Wire.beginTransmission(46);
  Wire.write(byte(0x00));
  Wire.write(byte(10));
  errorPot = Wire.endTransmission();
}

void loop() {
  // put your main code here, to run repeatedly:

  Serial.print("Wiper set to ");
  Serial.println(val);
  Wire.beginTransmission(46);
  Wire.write(byte(0x00));
  Wire.write(val);
  errorPot = Wire.endTransmission();

  float wiper_value = analogRead(A0);
  wiper_value *= 5.0;
  wiper_value /= 1024;

  Serial.print("Error message: ");
  Serial.print(errorPot);
  Serial.print("\t");
  Serial.print("Wiper Voltage: ");
  Serial.println(wiper_value);
  delay(1000);

  val++;                       // Increment value

  // if reached 128th position (max)
  if(val == 128) {
      val = 0;                   // Start over from lowest value
    }  
}
The necessary wiring of the MCP4531 digipot for the above code.

Last updated

Was this helpful?