esp:esp32:esp-idf:rotery-encoder
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| esp:esp32:esp-idf:rotery-encoder [2024/10/09 16:59] – oscar | esp:esp32:esp-idf:rotery-encoder [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== ESP32 - Rotary Encoder ====== | ||
| - | |||
| - | ---- | ||
| - | //How to reliably read rotary encoder on ESP32?// | ||
| - | ===== Background ===== | ||
| - | For usage on my ESP32 projects, I ordered several rotary encoders from Ali Express. It appeared that all of these gave many erratic and unreliable readings. Indicating CW when turning CWW and visa versa. Approximately out out the 20-30 readings was erroneous. | ||
| - | Initially I assumed contact bouncing, but the problem persisted after implementing an anti-bounce filter in the software. On a Raspberry this problem does not exist, so it seems that the ESP32 does not work well with this type of rotary encoders. | ||
| - | This page describes both cause and solution for this problem. | ||
| - | |||
| - | {{ : | ||
| - | |||
| - | ===== Problem cause ===== | ||
| - | It appears that the encoders I bought have RC filters on their output connections. Apparently, with the intention to eliminate contact bounce. However, side effect of this is that the rise and decay times of the rotary pulses do not have sharp edges, but curved edges. | ||
| - | |||
| - | {{ : | ||
| - | |||
| - | {{ : | ||
| - | |||
| - | ===== Hardware Modifications ===== | ||
| - | |||
| - | |||
| - | ===== Method 1 ===== | ||
| - | |||
| - | |||
| - | ===== Method 2 ===== | ||
| - | |||
| - | |||
| - | ===== Links ===== | ||
| - | * Unordered List Item[[https:// | ||
esp/esp32/esp-idf/rotery-encoder.1728493145.txt.gz · Last modified: by oscar
