[sdiy] Selecting a rotary encoder, transistions per detent?

rsdio at audiobanshee.com rsdio at audiobanshee.com
Mon Feb 10 01:27:08 CET 2020


On Feb 7, 2020, at 5:00 AM, Spiros Makris <spirosmakris92 at gmail.com> wrote:
> I am putting together a teensy application that uses rotary encoders. I picked up two different ones from my local shops, but they seem to have a different output waveform scheme.
> One is an EC11e15204a3 alps (according to the guy selling it) and on each detent, the outputs switch between high and low. So, 00->11->00 and each transition from 00 to 11 and vice versa happens when you hit a detent.
> The other is a bourns by the looks of it, and works differently: When resting, it defaults to 00. When turned, it briefly becomes 1, then returns to 00. 
> (obviously, the turn direction is detected during the transitions).
> The second type detects two increments instead of one, as a result.

All quadrature encoders go through all four bit pattern (00-01-11-10 or 00-10-11-01) when turning. If you don’t see all four stages, then your code is not reading fast enough. I think you’re perhaps seeing all the stages, but are just listing the codes that are present when the encoder is aligned in the center of a detent.

Not all encoders have detents. Those that have detents usually allow you to select part number variations depending upon how many detents you want, and how many pulses per rotation.


> Where in the datasheet is this specified? Both are sold as "2 channel quadrature outputs" but the detection code is slightly different (unless I'm missing something?). Is there code that can work with both? I am using polling and shift registers and don't need any significant accuracy- the delay so far feels great.
> Is there a cheaper alternative to the 5pin arrangement of the EC11? It seems that those without switches only have 3 pins- they will be going on a prefboard and the extra support would be welcome (I'm not compelled to drill 64 holes for the side supports :P ).

Looking at the Bourns PEC12R (that I have been using in designs a lot recently), the part number has a Detent Option and a Resolution. The Resolution is available in 12 Pulses per 360° Rotation or 24 Pulses per 360° Rotation. The Detent Option is available with No Detent, 12 Detents, or 24 Detents, with the caveat that 12 Detents is available with 12 pulses only. All of this is in the Bourns data sheet under the “How To Order” heading.

I recommend going directly to the Bourns and ALPS web sites, then browse through all of their encoders. Download a catalog or just download several data sheets for encoders. Once you find exactly what you want from the data sheets, you will have a specific part number to search for. The one you want may not be filed correctly at Mouser or Digi-Key, or it might not be something they normally stock. If the latter is true, then you can decide whether to give up some of the features that you want in order to get parts without placing an order for 10,000 of them directly from the manufacturer. Sometimes, if nobody stocks them, then it’s because nobody really wants to use them. Other times, the resellers are just clueless.

Brian





More information about the Synth-diy mailing list