Electronic – Does EC11 Incremental Encoder need hardware debouncing and VCC for encoder

circuit-designdebounceencoder

I'm implementing an EC11E rotary encoder which has 3 pins + 2 pins for a switch. It seems like most of the projects I've seen online wire A/B and GND to the microcontroller, which to me, makes sense.

However, at the same time, I've seen a few references to schematics which include debouncing capacitors and resistors like below.

enter image description here

However, I don't understand why this is actually necessary. From what I understand, since the quadrature encoding effectively presents itself as a square wave, it shouldn't need debouncing, given the contacts either touch or don't touch.

Do I actually need these debouncing capacitors and resistors in my circuit?

As well, it seems like most breakout boards for encoders include a VCC line for pull-up. However, the MCU I'm using [AT90USB646] already includes internal pull-ups on all its GPIO pins. WIll I still need a pull up line then?

Best Answer

Those rotary switches are nothing more than mechanical switches. And like all mechanical switches, these will have contact bounce. The contacts either touch, or don't, and they do that many times rapidly during the transition, and due to oxidation there always a state where the contacts have a bad connection so it can be indeterminate if the signal is high or low.

Some other rotary encoder manufacturers (Bourns) clearly state a default application circuit which includes pull-up resistor, a capacitor, and a series resistor, and also include default values for them.

The pull-up resistance is selected to provide at least the minimum specified wetting current to keep the contacts clean. The series resistor will limit the current below maximum rating so that the contacts do not just short the fully charged capacitor directly. And then the capacitor is there to act as a low pass filter for the contact bounce.

The pull-up resistance must be low enough value to make sharp enough rising edges. Internal pull-ups in MCUs are quite high in value and thus can result in slow edges, especially if you have the capacitor there.

As the capacitor makes the edge rate slower, in some applications a Schmitt trigger buffer is useful to add hysteresis and square up the signal again to have sharp edges as in some applications the slow edges can be a problem.

So, the parts are not necessary, and you may not need any of these external components. The software just needs to cope with whatever garbage happens on the encoder lines, which means more complex software debouncing, dead time between detecting interrupts etc. And if the pull-ups don't provide enough current, the encoder contacts may oxidize and bounce even more over time.