

The Adafruit DS1841 (Part ID: 4570) is a digital potentiometer designed for precise control of resistance in electronic circuits. Unlike traditional mechanical potentiometers, the DS1841 allows users to adjust resistance values programmatically via an I2C interface. This makes it an excellent choice for applications requiring dynamic or automated resistance adjustments.








The Adafruit DS1841 is a versatile component with the following key specifications:
| Parameter | Value |
|---|---|
| Operating Voltage | 3.3V to 5V |
| Resistance Range | 10 kΩ (256 steps) |
| Communication Interface | I2C |
| I2C Address | 0x28 (default, configurable) |
| Operating Temperature | -40°C to +85°C |
| Wiper Memory | Non-volatile |
| Adjustment Method | Logarithmic |
The DS1841 comes with the following pinout:
| Pin | Name | Description |
|---|---|---|
| 1 | VIN | Power supply input (3.3V to 5V) |
| 2 | GND | Ground |
| 3 | SCL | I2C clock line |
| 4 | SDA | I2C data line |
| 5 | A0 | I2C address selection (connect to GND or VIN) |
| 6 | W | Wiper terminal (connect to the circuit requiring resistance adjustment) |
To use the Adafruit DS1841 in a circuit:
Below is an example of how to control the DS1841 using an Arduino UNO:
#include <Wire.h>
// I2C address of the DS1841 (default is 0x28)
#define DS1841_I2C_ADDRESS 0x28
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Initialize serial communication for debugging
// Set the wiper position to mid-range (128 out of 256)
setWiperPosition(128);
}
void loop() {
// Example: Gradually increase resistance
for (int position = 0; position <= 255; position++) {
setWiperPosition(position);
delay(100); // Wait 100ms between steps
}
}
// Function to set the wiper position
void setWiperPosition(uint8_t position) {
Wire.beginTransmission(DS1841_I2C_ADDRESS);
Wire.write(0x00); // Command to set wiper position
Wire.write(position); // Desired wiper position (0-255)
Wire.endTransmission();
Serial.print("Wiper position set to: ");
Serial.println(position);
}
The DS1841 is not responding to I2C commands.
The resistance does not change as expected.
The component overheats or behaves erratically.
Q: Can I use the DS1841 with a 3.3V microcontroller?
A: Yes, the DS1841 operates with both 3.3V and 5V logic levels, making it compatible with most microcontrollers.
Q: How many DS1841 devices can I connect to a single I2C bus?
A: You can connect up to two DS1841 devices by configuring the A0 pin to set unique I2C addresses.
Q: Does the DS1841 retain its wiper position after power is removed?
A: Yes, the DS1841 features non-volatile memory, so the wiper position is retained after power loss.
Q: Can I use the DS1841 for linear resistance adjustments?
A: The DS1841 uses a logarithmic adjustment curve, which is ideal for audio and other non-linear applications. For linear adjustments, consider a different digital potentiometer.
By following this documentation, you can effectively integrate the Adafruit DS1841 into your projects for precise and programmable resistance control.