I apologize if this seems like a fundamental question, but I feel like I'm missing a fundamental understanding about digital rotary encoders, because none of my basic encoders are working as expected.

These are the encoders I'm working with. Link to Encoders

Based on my fundamental understanding of an encoder, it's basically like a double switch that are 1/4 cycle out of phase. At times, 1, 2, or 0 of the encoder pins will be connected to the base pin.

Given this, it seems like the resistance between pins should be either 0 or INF? Correct? Depending on the current position of the encoder?

If the multi-meter was showing 0 resistance (closed switch), and if I move the encoder two clicks, then it should show INF resistance from pin 1 and base, correct?

I'm losing my hair becuase I have several encoders all acting the same way....always showing INF resistance between pins ALL THE TIME.

Please show me what I'm doing wrong.

NOTE: I'm currently hooked up the the pins on the side with 3 pins. Pin 1 and 3 are encoder pins and Pin 2 is the base pin.

--- EDIT:

I got a response from another forum that mentioned that in a single click the pins complete the entire cycle (A HIGH, B HIGH, A LOW, B LOW). Is this true? Does anyone have a video or article that says this?

  • \$\begingroup\$ Perhaps they're optical and you need to power the LEDs and read the detectors. Or perhaps you just have the pinout wrong. The meter works when you touch its leads together, right? \$\endgroup\$ – Chris Stratton Jul 26 '17 at 0:17
  • \$\begingroup\$ Did you read the "Questions" section on the Amazon page to which you linked? One of the questions is about pinout. \$\endgroup\$ – Solomon Slow Jul 26 '17 at 0:26
  • \$\begingroup\$ Yes. I have the pins correct in my mind, but I still have the problem. \$\endgroup\$ – GrantG Jul 26 '17 at 2:26
  • \$\begingroup\$ The click is a separate mechanism from the switch, so different encoders may click once, twice or 4x per entire cycle, so your other response may be correct for your encoder. \$\endgroup\$ – Brian Drummond Jul 26 '17 at 11:25

I may have found a datasheet for a similar device. Not the same one. But perhaps similar enough that it gets the point across. See Alpha's 318-ENC130175F-12PS, for example. From this datasheet, you find the following diagram:

enter image description here

Note where the detent lines (dashed and vertical) appear. It's not difficult to see how just a tiny alignment difference might place the detent exactly where both A and B are "off." And both "off" at every detent. So, if you were twiddling the knobs and then doing a measurement, you might easily find that both A and B appear off every time you try. But the rotary encoder would still be just fine, regardless.

The Amazon link you provided has a question and answer which says that your encoders do have detents. Without an actual datasheet I can't say for sure, as it is possible that your rotary encoder has detents in between the locations shown in the picture above, but it would not surprise me that your rotary encoders operate much like the one I where I did find a datasheet. Especially considering how they are often used by Arduino software, with A as a clock and B as data (or visa-versa.) If so, your experiences may not be so surprising after all.

|improve this answer|||||
  • \$\begingroup\$ I think you're right. I didn't understand that an encoder most likely completes an entire cycle per detent. I expected only a 1/4 cycle shift per detent and therefore expect the switch to remain closed. If it was closed, I'd be able to read a ~0 resistance across the pins, but it wasn't so I couldn't. Here's a reference link to another forum that helped me arrive at the same answer. \$\endgroup\$ – GrantG Jul 26 '17 at 15:00
  • \$\begingroup\$ @GrantG Thanks for the added link to read. Yes, I think this is the issue, now. So I think you are fine. \$\endgroup\$ – jonk Jul 26 '17 at 16:58

Amazon, like eBay, isn't the best place to get parts with proper documentation, as you have noticed. However it does say "with push-button", which, if true, means there's at least 2 pins that connect if, and only if, the shaft is pushed in. Leaves 3 pins, so that means there's one centre pin, which connects to an A and a B pin in shifted phase when you rotate.

Centre connects to Pin A, then one step later the centre connects to pin B, then one step later the centre disconnects from pin A, then another step later it disconnects from B. Et cetera.

Most common layout I know of with that type is "centre pin" is the middle one in the row fo three and B and A are on the other side. The pins surrounding the mid-pin actually being the push button.

However, it may be entirely different. This would normally be listed in the Datasheet, which, as you have noticed when buying from "random sources" is a point of trouble more often than not.
Update: As it turns out from James' comment, the pins for the button are the two separate ones, but I was right on the middle pin.

When starting out with a new subject it's often wiser to buy only after you verify that there's an actual datasheet available, rather than save a dollar and then spend days not quite figuring it out. There's plenty sources in the places that Amazon caters to that make an attempt at supplying datasheets. While I'm not a super fan, sites like Sparkfun and Adafruit, for example, often have something of a datasheet for their parts. So do Digikey, Mouser and Farnell, of course, usually from the manufacturer, but you may need special accounts for those, depending on your location.

|improve this answer|||||
  • \$\begingroup\$ I have the pins right, they are pretty universal for all these encoders. I confirmed with the questions on Amazon, a few youTube videos, and I even tried other configurations of the pins to see if everything was lying to me. \$\endgroup\$ – GrantG Jul 26 '17 at 2:29
  • \$\begingroup\$ @GrantG Be aware that there's another possible answer: This is from Amazon. There's no Datasheet... These may well be rejected parts from the ALPS factory or whichever, because the detent to switch alignment was wrong, or the switches are bad. If the transition is misaligned to detents you don't know what should change between steps. Also, it's possible there's fewer detents than code pulses, which would be indicated in the... datasheet. Hence "2 clicks" may be a full code cycle, half of one, a quarter of one, two cycles, etc etc. \$\endgroup\$ – Asmyldof Jul 26 '17 at 9:47

the resistance between pins should be either 0 or INF?

or anywhere in between, depending on which pins you are talking about.

If the multi-meter was showing 0 resistance (closed switch), and if I move the encoder two clicks, then it should show INF resistance from pin 1 and base, correct?

yes/no, depending on how good your meter is in registering short closes and how fast you are rotating it. the contacts will close momentarily.

|improve this answer|||||
  • \$\begingroup\$ "The contacts will close momentarily." --- Please elaborate on this. --- So Pin A won't say closed if I rotate to a fixed position? \$\endgroup\$ – GrantG Jul 26 '17 at 2:29
  • \$\begingroup\$ @GrantG It has detents, from what I can read from the question/answer stuff on your amazon link. The detents are mechanically arranged, potentially independently of the quadrature switches. I think we need to see the datasheet for them to know one way or another. \$\endgroup\$ – jonk Jul 26 '17 at 6:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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