User Tools

Site Tools


esp:esp32:esp-idf:rotery-encoder

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
esp:esp32:esp-idf:rotery-encoder [2024/10/09 16:59] oscaresp: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. 
- 
-{{ :esp:esp32:rotery-encoder.jpg?400 |}} 
- 
-===== 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. 
- 
-{{ :esp:esp32:rotery-encoder-filter.jpg?400 |}} 
- 
-{{ :esp:esp32:rotery-encoder-wave.jpg?400 |}} 
- 
-===== Hardware Modifications ===== 
- 
- 
-===== Method 1 ===== 
- 
- 
-===== Method 2 ===== 
- 
- 
-===== Links ===== 
-  * Unordered List Item[[https://www.allaboutcircuits.com/projects/how-to-use-a-rotary-encoder-in-a-mcu-based-project/|www.allaboutcircuits.com]] 
  
esp/esp32/esp-idf/rotery-encoder.1728493145.txt.gz · Last modified: by oscar