9
\$\begingroup\$

for my current project I'm planning to use an input "device" like this in the photo (don't know its real name):

alt text

It is used in a lot of musical instruments and it is like a potentiometer that can be rotated as many times as you want. I think it isn't read like an analog value. Can someone give me some hints?

Thank you very much.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ It's also used in measurement equipment like scopes and logic analyzers, for instance. \$\endgroup\$
    – stevenvh
    Commented Dec 25, 2010 at 16:56
  • 1
    \$\begingroup\$ I believe that in the A/V world, that's called a jog wheel. \$\endgroup\$
    – JustJeff
    Commented Sep 29, 2011 at 12:15
  • \$\begingroup\$ If your mouse has a scroll wheel, that's essentially the same thing, just turned on edge. \$\endgroup\$
    – markrages
    Commented Sep 29, 2011 at 15:24

1 Answer 1

22
\$\begingroup\$

It's a rotary encoder. It has two outputs giving pulses in quadrature (see image), as to determine the way it's rotated.

enter image description here

In the image you can see that the level of the B channel is low on the rising edge of the A channel if the knob is rotated clockwise, but high if rotated counterclockwise.
Differences in models are the number of pulses per rotation, often between 15 and 20, and the number of channels. More than 2 channels are used to obtain the absolute position of the knob. E.g. 10 channels give 1024 unique codes per rotation. Gray coding is used.
edit
Another parameter is the detent. Detents are click-positions, which require a certain momentum to overcome. Some models have 2 detents per pulse, others don't have detents and rotate rather smoothly, so that it feels like a potmeter without stops.


Further reading
"Control Shaft Encoders" \$-\$ Circuit Cellar issue 250, May 2011, p.28 ff

\$\endgroup\$
8
  • \$\begingroup\$ thank you! do you know if it is possible to buy it with the plastic part attached? \$\endgroup\$
    – 3mpty
    Commented Dec 25, 2010 at 15:05
  • 1
    \$\begingroup\$ The encoder as sold is like a potmeter, i.e. with a plastic or metal 6mm axis. You'll have to purchase the knob separately. In the past I've had trouble finding knobs with greater than 40mm diameter, esp. ones with an index like in your picture may be hard to find. \$\endgroup\$
    – stevenvh
    Commented Dec 25, 2010 at 15:11
  • 3
    \$\begingroup\$ great answer! sometime it seems like half the challenge is finding out the names of things. \$\endgroup\$ Commented Dec 25, 2010 at 23:13
  • 2
    \$\begingroup\$ Another note, they sell these type of encoders as quadrature (as shown above) and pulse. Pulse encoders pulse two lines every detent, with one trailing the other depending on direction. I like the pulse better because you don't need a state machine to implement, just a couple interrupt inputs. But it's important to know what you get or you could run into problems interfacing with them. I'd also check out CUI, they have good encoder prices. One other thing to look for, mechanical versus optical. Mechanical is cheap, optical have long life. \$\endgroup\$
    – bt2
    Commented Dec 26, 2010 at 15:57
  • 1
    \$\begingroup\$ @bt2 I'm pretty sure standard quadrature encoders don't require a state machine to implement -- just set an interrupt on one of the lines, and when it goes high, check the value on the other line. If it's high, it's going one way, if it's low, it's going the other. \$\endgroup\$
    – Evan Krall
    Commented Jan 21, 2012 at 10:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.