{"product_id":"m5stack-rotary-encoder-unit","title":"M5Stack Rotary Encoder Unit","description":"\u003cp\u003e\u003cvideo controls muted playsinline style=\"width:100%;height:auto;border-radius:8px;\"\u003e\u003csource src=\"https:\/\/m5stack.oss-cn-shenzhen.aliyuncs.com\/video\/Product_example_video\/Unit\/UNIT_ENCODER_VIDEO.mp4\" type=\"video\/mp4\"\u003e\u003c\/video\u003e\u003c\/p\u003e\n\u003cp\u003eThe M5Stack Rotary Encoder Unit adds a tactile knob, push action, and two programmable RGB indicators to control panels, instruments, audio interfaces, and menu-driven embedded projects. An onboard STM32 collects the encoder pulses and exposes the value over I2C, reducing the host's GPIO and interrupt workload. Users can rotate to adjust a setpoint, press to confirm it, and receive immediate color feedback for edit, saved, warning, or fault states.\u003c\/p\u003e\n\u003ch2\u003eAdd a Rotary HMI Control to M5Stack\u003c\/h2\u003e\n\u003cp\u003eThe encoder reports relative movement, making it practical for bounded values such as volume, speed, menu position, brightness, or calibration offsets. The push input adds a second interaction without another module, while the RGB LEDs can show the active mode or whether a value has been accepted.\u003c\/p\u003e\n\u003ch3\u003eSetpoint, Menu and Volume Adjustment\u003c\/h3\u003e\n\u003cp\u003eA benchtop controller can use slow rotation for fine changes and faster rotation for accelerated adjustment. Pressing the knob can commit the value, enter a submenu, or restore a default. In an audio or lighting interface, the LEDs can change color to identify which parameter is currently being edited.\u003c\/p\u003e\n\u003ch2\u003eConnect and Read the M5Stack Unit Encoder\u003c\/h2\u003e\n\u003ch3\u003eI2C Count, Push Button and RGB Feedback\u003c\/h3\u003e\n\u003col\u003e\n\u003cli\u003eConnect the Grove cable to a compatible I2C port and confirm that address 0x40 is available.\u003c\/li\u003e\n\u003cli\u003eInitialize the encoder count, button state, and both RGB LEDs before enabling the controlled equipment.\u003c\/li\u003e\n\u003cli\u003eVerify which direction increases and decreases the value, then add button debounce.\u003c\/li\u003e\n\u003cli\u003eMap the relative count to a bounded application value and apply optional acceleration for fast rotation.\u003c\/li\u003e\n\u003cli\u003eDefine a stale-data or I2C-fault state that leaves the controlled output safe.\u003c\/li\u003e\n\u003c\/ol\u003e\n\u003ch2\u003eExample Setpoint Editing Workflow\u003c\/h2\u003e\n\u003col\u003e\n\u003cli\u003eRead the encoder delta and push state at a fixed interval.\u003c\/li\u003e\n\u003cli\u003eApply direction, acceleration, and minimum\/maximum limits before changing the pending setpoint.\u003c\/li\u003e\n\u003cli\u003eUse one LED state while editing and another after the value is committed.\u003c\/li\u003e\n\u003cli\u003eAccept the change only after a debounced press, then store or apply the confirmed value.\u003c\/li\u003e\n\u003cli\u003eRestore a defined state after a host restart or communication timeout.\u003c\/li\u003e\n\u003c\/ol\u003e\n\u003ch2\u003eRelative Position and Input Handling Notes\u003c\/h2\u003e\n\u003cul\u003e\n\u003cli\u003eThe encoder reports relative movement rather than an absolute shaft position.\u003c\/li\u003e\n\u003cli\u003eRapid rotation can exceed a slow polling loop; read consistently and test at the fastest expected user input.\u003c\/li\u003e\n\u003cli\u003eThe mechanical push input requires debounce and protection against unintended repeat actions.\u003c\/li\u003e\n\u003cli\u003eLong I2C wiring, bus capacitance, or an address conflict can cause inconsistent input.\u003c\/li\u003e\n\u003cli\u003eThis control is not a safety-rated selector, emergency input, or absolute position sensor.\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003ch2\u003eM5Stack Rotary Encoder Resources\u003c\/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https:\/\/docs.m5stack.com\/en\/products\/sku\/U135\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"\u003eM5Stack Unit Encoder documentation\u003c\/a\u003e\u003c\/li\u003e\n\u003cli\u003e\u003ca href=\"https:\/\/uiflow2.m5stack.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"\u003eUiFlow2 development environment\u003c\/a\u003e\u003c\/li\u003e\n\u003cli\u003e\u003ca href=\"https:\/\/docs.arduino.cc\/software\/ide\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"\u003eArduino IDE\u003c\/a\u003e\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"LogicBoundless","offers":[{"title":"Default Title","offer_id":49240388141271,"sku":"LB-M5-U135","price":9.9,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0801\/8952\/2135\/files\/1_96df0d7b-e936-44e3-b9c8-a98efe7d26ea.jpg?v=1783243293","url":"https:\/\/logicboundless.com\/products\/m5stack-rotary-encoder-unit","provider":"LogicBoundless","version":"1.0","type":"link"}