Description
The KY-040 Rotary Encoder Module allows you to detect rotational position and direction in your microcontroller projects. Ideal for Arduino, Raspberry Pi, and ESP32 builds where precise control or menu navigation is needed.
Unlike a potentiometer, the rotary encoder provides infinite rotation in both directions and outputs digital signals for each step, making it great for volume knobs, menu controls, or robotics.
- Module: KY-040
- Function: Rotary encoder for angular position and direction sensing
- Output Type: Digital (A/B pulses)
- Operating Voltage: 3.3V – 5V
- 5-Pin Interface: GND, + (VCC), SW (button), DT (data), CLK (clock)
- Push-Button Function: Built-in momentary switch
- Module Size: Approx. 26mm x 19mm x 32mm
Key Features:
- Module: KY-040
- Function: Measures rotational direction and step count
- Outputs: Digital pulses for clockwise/anticlockwise turns
- Voltage: 3.3V – 5V
- Interface: GND, VCC, DT, CLK, SW
- Built-in push-button for extra user input
- Compact design – ideal for breadboards and panels
- Fully compatible with Arduino and Raspberry Pi
What’s Included:
- 1x KY-040 Rotary Encoder Module
Great For:
- Menu navigation controls
- Digital volume or tuning knobs
- Robotics and CNC machinery input
- Game controllers and user interfaces
- STEM projects and prototyping
- DIY electronics requiring rotational input
Usage Tips:
- Use interrupts to accurately detect rotation direction and speed
- Push-button (SW pin) can be used for selecting menu items
- No end-stop — rotates 360° infinitely in both directions
- Use existing libraries like Encoder.h in Arduino IDE
- Debouncing logic or capacitors may help with signal clarity