Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use Adafruit DS3502: Examples, Pinouts, and Specs

Image of Adafruit DS3502Design with Adafruit DS3502 in Cirkit Designer

Introduction

The Adafruit DS3502 is a digital potentiometer, or "digipot," which provides a programmable resistance value across its two terminals. This component is ideal for applications requiring precise control of voltage, current, or signal amplitude. Common use cases include adjusting the brightness of LEDs, controlling the gain of an amplifier, or fine-tuning sensor inputs.

Explore Projects Built with Adafruit DS3502

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!

Technical Specifications

Key Features

Pin Configuration

Pin Number Name Description
1 SCL Serial Clock Line for I²C communication
2 SDA Serial Data Line for I²C communication
3 A0 Address pin for I²C address selection
4 W Wiper terminal, the variable end of the potentiometer
5 L Low terminal, the low end of the potentiometer
6 H High terminal, the high end of the potentiometer
7 VDD Power supply voltage (2.7V to 5.5V)
8 GND Ground

Usage Instructions

Connecting to a Circuit

  1. Connect VDD to your circuit's power supply (2.7V to 5.5V).
  2. Connect GND to the ground of your circuit.
  3. Connect SCL and SDA to the I²C clock and data lines, respectively.
  4. If multiple I²C devices are used, set the A0 pin to the appropriate logic level to determine the device's address.
  5. Connect the W, L, and H pins to your circuit where variable resistance is needed.

Best Practices

Example Code for Arduino UNO

#include <Wire.h>

// DS3502 I2C address (depends on A0 pin connection)
const int DS3502_Address = 0x28; 

// Command to set wiper position
const byte WIPER_REG = 0xA9;

void setup() {
  Wire.begin(); // Join I2C bus
  Serial.begin(9600); // Start serial communication for debugging
  setWiperPosition(128); // Set wiper to mid-scale position
}

void loop() {
  // Example: Cycle through all resistance positions
  for (int position = 0; position < 256; position++) {
    setWiperPosition(position);
    delay(10); // Short delay between changes
  }
}

void setWiperPosition(byte position) {
  Wire.beginTransmission(DS3502_Address); // Begin transmission to DS3502
  Wire.write(WIPER_REG); // Point to wiper register
  Wire.write(position); // Set new wiper position
  Wire.endTransmission(); // End transmission

  // Debug output to serial monitor
  Serial.print("Wiper position set to: ");
  Serial.println(position);
}

Troubleshooting and FAQs

Common Issues

FAQs

Q: Can the DS3502 be used with a microcontroller other than Arduino? A: Yes, the DS3502 can be interfaced with any microcontroller that supports I²C communication.

Q: How do I change the I²C address of the DS3502? A: The I²C address can be changed by connecting the A0 pin to either GND or VDD. This provides two possible addresses for the device.

Q: Is the DS3502 capable of handling power applications? A: The DS3502 is designed for low-power applications and should not be used in high-power circuits.

Q: How do I save the wiper position so it's retained after power cycling? A: The DS3502 automatically stores the last wiper position in its non-volatile memory when powered down.

For further assistance, consult the Adafruit DS3502 datasheet or contact technical support.