Maker Pro
Maker Pro

Using a digital potentiometer

Hello
I'm trying to set the resistance of a digital potentiometer DS1804-10, and I'm not sure how to programme it on the Arduino software. I'm using an Arduino Uno.

Pin 1 (INC) on the potentiometer goes to pin 12 on the Arduino.
Pin 2 (U/D) on the potentiometer goes to pin 13 on the Arduino.
Pin 4 (GND) on the potentiometer goes to ground (-)
Pin 5 (W) goes into a comparator.
Pin 7 (CS) on the potentiometer goes to ground (-)
Pin 8 (Vcc) has 5V coming in (+)

Now I'm confused about how I know the resistance of the potentiometer and how I can programme the correct resistance.
 

bertus

Moderator
Hello,

What did you do with the pins 3 and 6?
Those are the ends of the potmeter:

DS1804-features.png

Bertus
 

Attachments

  • DS1804-1389127.pdf
    174.1 KB · Views: 2

bertus

Moderator
Hello,

This is given in the datasheet:

H - High-Terminal Potentiometer. This is the high terminal of the potentiometer.
It is not required that this terminal be connected to a potential greater than the L-terminal. Voltage applied to the H-terminal cannot exceed the power-supply voltage, VCC, or go below ground.
L - Low-Terminal Potentiometer. This is the low terminal of the potentiometer.
It is not required that this terminal be connected to a potential less than the H-terminal. Voltage applied to the L-terminal cannot exceed the power-supply voltage, VCC, or go below ground.

There must be a connection to them.
If they are not connected the W (wiper) will float.

Bertus
 

Harald Kapp

Moderator
Moderator
There is a library for Arduino to control the DS1804.

Now I'm still not sure why I can't control the resistance
How do you know you can't control resistance? How do you measure resistance?

By the way: The resistance of a potentiometer is fixed, it can't be changed. What you change is the position of the wiper (on a mechanically operated potentiometer) or equivalently the resistance ratio between high-input (H) and wiper vs. low input (L) and wiper (W) on a digitally controlled potentiometer as exemplified in this diagram:

upload_2020-11-12_11-37-57.png
Note that the total resistance is 10 kΩ in each case. only the resistance ratio varies with the setting of the potetiometer. So in order to measure a correct setting of the potentiometer follow the advice given in post #7 by @bertus .
 
Top