I've always needed to add debouncing code, when handling switch inputs on microcontrollers. While I've only used three different types of switch, they all needed debouncing.

My (two) rotary encoders appear to have no "bouncing" on their P and Q outputs.

I've looked at the logic-analyser captures of phase and quadrature and they're absolutely clean. Not a single spike, over dozens of turns.

Is there something about the design of rotary encoders which make this true?

Or is this just a coincidence?

  • 2
    \$\begingroup\$ Can you edit your question with links to the datasheets for your encoders? If not, do you know the operating principle? (Mechanical/conductive? magnetic? optical?) And do you know if they have on-board signal conditioning circuits? \$\endgroup\$ – Jack B Nov 25 '20 at 11:43
  • 1
    \$\begingroup\$ Which encode you have? Link to product page or preferably to datasheet please? No, you cannot assume that encoders have no bounce in general. \$\endgroup\$ – Justme Nov 25 '20 at 11:45
  • \$\begingroup\$ Some will some won't. \$\endgroup\$ – Andy aka Nov 25 '20 at 11:45
  • 3
    \$\begingroup\$ I have a min-hifi in my kitchen. In the first few years, the volume control, based on an optical rotary encoder, performed flawlessly. Now, after a couple of decades of absorbing cooking fumes and other grot, it's about 70% likely to count up rather than down when rotated clockwise, and vice versa, which is a bit tedious, but can be lived with. I would guess it's deposits on the encoder disk which are corrupting the 'a before b' logic that decodes the direction. Just 'cos your disk works now doesn't mean it won't 'bounce' in the future. \$\endgroup\$ – Neil_UK Nov 25 '20 at 12:43
  • \$\begingroup\$ I used a rotary encoder for a project recently and it was noisy AF. Threw two low pass filters at it and worked perf. \$\endgroup\$ – ezra_vdj Nov 26 '20 at 12:15

Your Answer

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

Browse other questions tagged or ask your own question.