Maker Pro
Maker Pro

Using a digital potentiometer

Balos69626

Nov 11, 2020
4
Joined
Nov 11, 2020
Messages
4
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
Nov 8, 2019
2,793
Joined
Nov 8, 2019
Messages
2,793
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
Nov 8, 2019
2,793
Joined
Nov 8, 2019
Messages
2,793
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
 

bertus

Moderator
Nov 8, 2019
2,793
Joined
Nov 8, 2019
Messages
2,793
Hello,

With the H connected to the + and L to the ground, you should be able to read a voltage from 0 to 5 Volts on the W.
Did you see this thread on the AAC forum:
digital potentiometer

Bertus
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
12,893
Joined
Nov 17, 2011
Messages
12,893
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