Waveshare Rotation Sensor Rotary Encoder with Push Button The Waveshare Rotation Sensor is an incremental rotary encoder module with a push button, designed for menu navigation, parameter adjustment, pulse counting, and compact user interfaces. Unlike a potentiometer, it can rotate continuously without a fixed end stop. The encoder outputs two phase signals for direction detection and step counting, while the integrated button adds a select or confirm input. It works with Arduino, Raspberry Pi Pico, STM32, ESP32, and similar boards; see the Waveshare Rotation Sensor wiki for vendor documentation. Use it when a project needs a durable knob interface for displays, smart hardware panels, volume controls, brightness controls, and embedded menus. Technical Specifications Parameter Value Brand / SKU Waveshare 9533 Sensor type Incremental rotary encoder with push button Operating voltage 3.3 V to 5.3 V Output Two-phase digital pulse plus button signal Rotation behavior Continuous rotation Button function Momentary push switch Compatible controllers Raspberry Pi Pico, Arduino, STM32, ESP32 Signal reading Polling or interrupt-based GPIO Typical use Menu input, direction detection, pulse counting Development support Arduino digital input examples and encoder libraries Board Layout & Label Guide Rotary shaft: Turn clockwise or counterclockwise to generate quadrature pulses. Push button: Press the shaft for select, enter, or mode control. CLK output: One encoder phase signal for step detection. DT output: Second phase signal used to determine direction. SW output: Button signal, commonly read with a pull-up. VCC/GND: Power the module from a supported 3.3 V or 5 V rail. Debounce note: Mechanical contacts should be debounced in firmware. Application Scenarios 1. Rotary Menu Counter Count encoder steps and print a menu index whenever the knob rotates. const int CLK_PIN = 2; const int DT_PIN = 3; int lastClk = HIGH; int menuIndex = 0; void setup() { pinMode(CLK_PIN, INPUT_PULLUP); pinMode(DT_PIN, INPUT_PULLUP); Serial.begin(115200); } void loop() { int clk = digitalRead(CLK_PIN); if (clk != lastClk && clk == LOW) { if (digitalRead(DT_PIN) != clk) menuIndex++; else menuIndex--; Serial.println(menuIndex); } lastClk = clk; } 2. Encoder With Push Button Use rotation for value changes and the shaft button as a select command. const int BUTTON_PIN = 4; void setup() { pinMode(BUTTON_PIN, INPUT_PULLUP); Serial.begin(115200); } void loop() { if (digitalRead(BUTTON_PIN) == LOW) { Serial.println("selected"); delay(250); } } 3. Brightness Knob Use encoder movement to adjust PWM brightness without the limited travel of a potentiometer. const int CLK_PIN = 2; const int DT_PIN = 3; const int LED_PIN = 9; int lastClk = HIGH; int brightness = 120; void setup() { pinMode(CLK_PIN, INPUT_PULLUP); pinMode(DT_PIN, INPUT_PULLUP); pinMode(LED_PIN, OUTPUT); } void loop() { int clk = digitalRead(CLK_PIN); if (clk != lastClk && clk == LOW) { brightness += (digitalRead(DT_PIN) != clk) ? 10 : -10; brightness = constrain(brightness, 0, 255); analogWrite(LED_PIN, brightness); } lastClk = clk; } Packing List 1 x Waveshare Rotation Sensor Module FAQ Q: Is it a potentiometer?A: No. It is a digital incremental encoder with continuous rotation. Q: Can it detect direction?A: Yes. Compare the CLK and DT phase relationship. Q: Does it need interrupts?A: Interrupts help with fast rotation, but polling is fine for slower menu input. Q: Can it work at 3.3 V?A: Yes, it supports 3.3 V systems when wired correctly. Q: Why does the count jump?A: Mechanical bounce can cause extra edges; use debounce logic or an encoder library. Q: What is the push button for?A: It can be used as select, confirm, reset, or mode input. Q: Can it set absolute position?A: No. It reports relative steps unless your firmware stores a position value. Q: Is it good for display menus?A: Yes. One knob can scroll values and the push button can confirm choices.