{"product_id":"ky-040-360-degree-infinite-rotary-encoder-module-20-pulse-5v-with-knob-for-arduino-raspberry-pi-esp32-stm32-brick-sensor-diy","title":"KY-040 360 Degree Infinite Rotary Encoder Module 20 Pulse 5V with Knob for Arduino Raspberry Pi ESP32 STM32 Brick Sensor DIY","description":"\u003ch1\u003eSPECIFICATIONS\u003c\/h1\u003e\u003cp\u003e\u003cspan\u003eBrand Name\u003c\/span\u003e: \u003cspan style=\"color:#333\"\u003eNONE\u003c\/span\u003e\u003c\/p\u003e\u003cp\u003e\u003cspan\u003eChoice\u003c\/span\u003e: \u003cspan style=\"color:#333\"\u003eyes\u003c\/span\u003e\u003c\/p\u003e\u003cp\u003e\u003cspan\u003eCondition\u003c\/span\u003e: \u003cspan style=\"color:#333\"\u003eNew\u003c\/span\u003e\u003c\/p\u003e\u003cp\u003e\u003cspan\u003eHigh-concerned chemical\u003c\/span\u003e: \u003cspan style=\"color:#333\"\u003enone\u003c\/span\u003e\u003c\/p\u003e\u003cp\u003e\u003cspan\u003eOrigin\u003c\/span\u003e: \u003cspan style=\"color:#333\"\u003eMainland China\u003c\/span\u003e\u003c\/p\u003e\u003cp\u003e\u003cspan\u003eType\u003c\/span\u003e: \u003cspan style=\"color:#333\"\u003eVoltage Regulator\u003c\/span\u003e\u003c\/p\u003e\u003cdiv class=\"detailmodule_html\"\u003e\u003cdiv class=\"detail-desc-decorate-richtext\"\u003e\n\u003cdiv\u003ep{margin-block-start: 0; margin-block-end: 0}\u003c\/div\u003e\n\u003cp style=\"font-size:16px;font-weight:bold;text-align:left;color:rgb(67, 70, 73)\" class=\"word-break white-space mt-10\" align=\"left\"\u003eInfinite Rotation, Precise Control! KY-040 360 Degree Rotary Encoder Module, 20 Pulse\/Rev, with Knob \u0026amp; Push Button, 5V for Arduino\/Raspberry Pi Menu, Speed \u0026amp; Position Control.\u003c\/p\u003e\n\u003cp style=\"font-size:16px;font-weight:bold;text-align:left;color:rgb(67, 70, 73)\" class=\"word-break white-space mt-10\" align=\"left\"\u003eKey Features \u0026amp; Benefits:\u003c\/p\u003e\n\u003cp style=\"font-size:13px;font-weight:normal;text-align:left;color:rgb(67, 70, 73)\" class=\"word-break white-space mt-10\" align=\"left\"\u003e🔄 360° Infinite Rotation, No Stops: Unlike potentiometers, it rotates clockwise\/counter-clockwise indefinitely with no mechanical wear limit. Perfect for multi-turn adjustment or circular menus.\u003cbr\u003e\u003cbr\u003e🎛️ High Precision \u0026amp; Bidirectional Counting: 20 pulses per revolution. Using two-phase output (CLK\/DT), it precisely detects rotation direction and angle change for accurate digital control.\u003cbr\u003e\u003cbr\u003e⏺️ Integrated Push Button, 2-in-1 Function: The shaft has a press button (SW) for \"select\", \"confirm\", or \"reset\", saving I\/O pins and enhancing interaction.\u003cbr\u003e\u003cbr\u003e🔌 Plug \u0026amp; Play, Wide Compatibility: Standard 5V operation, digital output. Clear pins (CLK, DT, SW, +, GND) for direct connection to Arduino, Raspberry Pi, ESP32, STM32, etc.\u003cbr\u003e\u003cbr\u003e🛠️ Includes Knob, Easy Installation: Comes with a practical knob cap. Ready to use out of the box, no extra parts needed. Comfortable feel, easy adjustment.\u003c\/p\u003e\n\u003cp style=\"font-size:16px;font-weight:bold;text-align:left;color:rgb(67, 70, 73)\" class=\"word-break white-space mt-10\" align=\"left\"\u003eProduct Description:\u003c\/p\u003e\n\u003cp style=\"font-size:13px;font-weight:normal;text-align:left;color:rgb(67, 70, 73)\" class=\"word-break white-space mt-10\" align=\"left\"\u003eThe KY-040 rotary encoder module is ideal for adding precise rotational input to your projects. It converts mechanical rotation into digital pulses readable by microcontrollers, perfect for smart menu systems, parameter adjustment (volume, brightness, speed), robotic joint control, or any application requiring infinite rotation feedback.\u003c\/p\u003e\n\u003cp style=\"font-size:24px;font-weight:bold;text-align:left;color:rgb(67, 70, 73)\" class=\"word-break white-space mt-10\" align=\"left\"\u003e🚨 Critical Notes Before Use:\u003c\/p\u003e\n\u003cp style=\"font-size:16px;font-weight:bold;text-align:left;color:rgb(67, 70, 73)\" class=\"word-break white-space mt-10\" align=\"left\"\u003e❌ 【What This IS \u0026amp; IS NOT】:\u003c\/p\u003e\n\u003cp style=\"font-size:13px;font-weight:normal;text-align:left;color:rgb(67, 70, 73)\" class=\"word-break white-space mt-10\" align=\"left\"\u003eThis is an incremental rotary encoder, NOT a potentiometer (analog output) or absolute encoder. It outputs directional pulse signals. It cannot read absolute angle directly. You need microcontroller programming to count pulses for relative position.\u003c\/p\u003e\n\u003cp style=\"font-size:16px;font-weight:bold;text-align:left;color:rgb(67, 70, 73)\" class=\"word-break white-space mt-10\" align=\"left\"\u003e⚠️ 【Wiring \u0026amp; Usage Tips】:\u003c\/p\u003e\n\u003cp style=\"font-size:13px;font-weight:normal;text-align:left;color:rgb(67, 70, 73)\" class=\"word-break white-space mt-10\" align=\"left\"\u003ePull-Up Resistors ARE REQUIRED! The CLK and DT signal lines MUST be pulled HIGH (e.g., to 5V) with pull-up resistors (internal or external) on the microcontroller side, otherwise signals will be unstable. Most Arduino tutorials use internal pull-ups.\u003cbr\u003e\u003cbr\u003eDebouncing is a MUST: Mechanical encoders have contact bounce. You MUST implement software debouncing (e.g., check state change with delay) for accurate counting.\u003cbr\u003e\u003cbr\u003eVoltage Match: Operating voltage is 5V. Do not apply higher voltage.\u003c\/p\u003e\n\u003cp style=\"font-size:16px;font-weight:bold;text-align:left;color:rgb(67, 70, 73)\" class=\"word-break white-space mt-10\" align=\"left\"\u003e✅ 【Required Programming Knowledge】:\u003c\/p\u003e\n\u003cp style=\"font-size:13px;font-weight:normal;text-align:left;color:rgb(67, 70, 73)\" class=\"word-break white-space mt-10\" align=\"left\"\u003eBasic microcontroller programming skills (e.g., Arduino C) are required.\u003cbr\u003e\u003cbr\u003eYou need to understand how to read the sequence of level changes on CLK and DT pins (via interrupts or polling) to determine direction and increment\/decrement a counter.\u003cbr\u003e\u003cbr\u003eMany ready-to-use KY-040 libraries and example codes are available online.\u003c\/p\u003e\n\u003cp style=\"font-size:16px;font-weight:bold;text-align:left;color:rgb(67, 70, 73)\" class=\"word-break white-space mt-10\" align=\"left\"\u003e🔧 【Typical Connection】:\u003c\/p\u003e\n\u003cp style=\"font-size:13px;font-weight:normal;text-align:left;color:rgb(67, 70, 73)\" class=\"word-break white-space mt-10\" align=\"left\"\u003e1. Connect module + and GND to the dev board's 5V and GND.\u003cbr\u003e\u003cbr\u003e2. Connect CLK, DT, SW to three digital I\/O pins.\u003cbr\u003e\u003cbr\u003e3. In code, set these pins as INPUT, and enable internal pull-ups for CLK and DT.\u003cbr\u003e\u003cbr\u003e4. Write an interrupt service routine or polling logic to handle rotation and button press events.\u003c\/p\u003e\n\u003cp style=\"font-size:16px;font-weight:bold;text-align:left;color:rgb(67, 70, 73)\" class=\"word-break white-space mt-10\" align=\"left\"\u003eSpecifications:\u003c\/p\u003e\n\u003cp style=\"font-size:13px;font-weight:normal;text-align:left;color:rgb(67, 70, 73)\" class=\"word-break white-space mt-10\" align=\"left\"\u003eModel: KY-040\u003cbr\u003e\u003cbr\u003eOperating Voltage: 5V DC\u003cbr\u003e\u003cbr\u003ePulse Count: 20 Pulses Per Revolution (20 PPR)\u003cbr\u003e\u003cbr\u003eRotation Type: 360° Infinite\u003cbr\u003e\u003cbr\u003eSwitch Type: Push Button (Normally Open)\u003cbr\u003e\u003cbr\u003eOutput Signal: Digital Pulses (CLK, DT), Button Signal (SW)\u003cbr\u003e\u003cbr\u003eInterface: CLK, DT, SW, + (VCC), GND\u003cbr\u003e\u003cbr\u003eModule Size: Approx. 31mm × 19mm × 29mm (incl. knob)\u003cbr\u003e\u003cbr\u003eMounting: Standard fixing holes\u003c\/p\u003e\n\u003cp style=\"font-size:16px;font-weight:bold;text-align:left;color:rgb(67, 70, 73)\" class=\"word-break white-space mt-10\" align=\"left\"\u003ePackage Includes:\u003c\/p\u003e\n\u003cp style=\"font-size:13px;font-weight:normal;text-align:left;color:rgb(67, 70, 73)\" class=\"word-break white-space mt-10\" align=\"left\"\u003e1 x KY-040 Rotary Encoder Module\u003cbr\u003e\u003cbr\u003e1 x Knob Cap\u003c\/p\u003e\n\u003cdiv\u003e\n\u003cimg style=\"width:100%;height:auto\" width=\"100%\" height=\"auto\" src=\"https:\/\/ae01.alicdn.com\/kf\/S5949d67f891040439009203b4be2cd80X.jpg\" slate-data-type=\"image\"\u003e\u003cimg style=\"width:100%;height:auto\" width=\"100%\" height=\"auto\" src=\"https:\/\/ae01.alicdn.com\/kf\/S44a14237f4ec4a40bdb339a3f215ff02U.jpg\" slate-data-type=\"image\"\u003e\u003cimg style=\"width:100%;height:auto\" width=\"100%\" height=\"auto\" src=\"https:\/\/ae01.alicdn.com\/kf\/S31d42fd93d5e4e94b27225caf146a1a4i.jpg\" slate-data-type=\"image\"\u003e\u003cimg style=\"width:100%;height:auto\" width=\"100%\" height=\"auto\" src=\"https:\/\/ae01.alicdn.com\/kf\/Sbc42f3acba854af7b08d155ae8ca4395n.jpg\" slate-data-type=\"image\"\u003e\u003cimg style=\"width:100%;height:auto\" width=\"100%\" height=\"auto\" src=\"https:\/\/ae01.alicdn.com\/kf\/Sc714e16727b64d24a57e2553585a46f7v.jpg\" slate-data-type=\"image\"\u003e\u003cimg style=\"width:100%;height:auto\" width=\"100%\" height=\"auto\" src=\"https:\/\/ae01.alicdn.com\/kf\/S30eabc6fb4d04b64a6a6cad4f858129fo.jpg\" slate-data-type=\"image\"\u003e\u003cimg style=\"width:100%;height:auto\" width=\"100%\" height=\"auto\" src=\"https:\/\/ae01.alicdn.com\/kf\/S64ba99de294743b0b3b809daf0ed9cbaV.jpg\" slate-data-type=\"image\"\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e\u003c\/div\u003e\u003cp\u003e\u003cbr\u003e\u003c\/p\u003e","brand":"Yoeruyo","offers":[{"title":"1pcs KY-040","offer_id":55428159897899,"sku":"14:1202#1pcs KY-040","price":10.85,"currency_code":"USD","in_stock":true},{"title":"2pcs KY-040","offer_id":55428159930667,"sku":"14:350852#2pcs KY-040","price":15.66,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/1000\/5744\/8747\/files\/Sbc42f3acba854af7b08d155ae8ca4395n.webp?v=1788580673","url":"https:\/\/yoeruyo.com\/products\/ky-040-360-degree-infinite-rotary-encoder-module-20-pulse-5v-with-knob-for-arduino-raspberry-pi-esp32-stm32-brick-sensor-diy","provider":"Yoeruyo","version":"1.0","type":"link"}