Software Encoder Debouncing Solution
Rotary encoders are input devices that use a series of two alternating pulses to tell which way they are turned and how far. While this…
Rotary encoders are input devices that use a series of two alternating pulses to tell which way they are turned and how far. While this works well in theory, one potential problem is that instead of the signals going on and off as planned, they experience a short on-off bounce pulse when switching, potentially skewing readings.
Johnson-Davies shares a simple routine to interface a rotary encoder with an ATtiny85 MCU. (📷: Technoblogy)
As demonstrated by David Johnson-Davies, one interesting solution involves using each alternating pulse to “silence” the bounce of the other signal. Since one signal is stable when the other experiences this effect, this can be a great way to keep readings in order.
Check it out implemented on an ATtiny85 here, with a 7-segment display used to output rotation information.