how do i use a 5pin potentiometer?

Hi all!
arduinofreaklol here!

I have a 2 potentiometers that are quite different:

Here is the first one:

The first one has three pins and a twisting limit (how many degrees I can twist it)
It also has an imprinted "WL" on thebottom of it.
I know how to use it, but how many ohms is this potentiometer?

Here is the other one:

The second one has five pins (labeled from left to right as follows: GND + SW DT CLK),
no twisting limit, and the twisting bar can be pushed like a pushbutton.
Unlike the first potentiometer, I do not know how to use this one :frowning: and what do "SW", "DT", and "CLK" mean?
How many ohms is this potentiometer?

Can you help me plz?
arduinofreaklol

Fist one:
The resistance is probably printed on it. It not, measure it (outer pins) the value with a multimeter.

Second one:
It's not a potentiometer, it's a rotary encoder. How to use it? Just google it :wink:

As a hint,
GND = GND connection

  • = supply voltage connection
    SW = switch output, probably connected to GND when pushed
    DT and CLK (probably for DaTa and CLocK but bad names for it) are the A and B connections of the rotary encoder.

The rotary encoder you describe is obviously mounted on a module. (The encoder itself has no such markings.)

Post a link to it. This is part of the kit you purchased, isn't it?

Yes, Paul__B.
It's part of a kit.

OK, one of these:

So does it have two resistors, or three?

septillion has pointed out the connections. You use three inputs, if the resistor for the "SW" function is not present, you will need to use INPUT_PULLUP on that pin, The two encoder terminals generate a Gray code that is used to determine each step in its rotation; including the direction of movement. (The annotations "CLK" and "DT" are indeed misleading).


Oh, and you need serious debounce code for these. :grinning: