Skip to product information
1 of 7

M5Stack Rotary Encoder Unit

M5Stack Rotary Encoder Unit

LB-M5-U135

20 in stock
Regular price $9.90 USD
Sale price $9.90 USD Regular price $7.95 USD

Key Features

  • Rotary encoder produces 30 pulses per full rotation for relative value adjustment.
  • Integrated push input supports confirmation, mode selection, and menu actions.
  • Two SK6812 programmable RGB LEDs provide local status feedback.
  • Onboard STM32F030 acquires encoder pulses and exposes values over I2C.
  • Single Grove I2C connection at address 0x40 reduces host GPIO usage.

The 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.

Add a Rotary HMI Control to M5Stack

The 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.

Setpoint, Menu and Volume Adjustment

A 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.

Connect and Read the M5Stack Unit Encoder

I2C Count, Push Button and RGB Feedback

  1. Connect the Grove cable to a compatible I2C port and confirm that address 0x40 is available.
  2. Initialize the encoder count, button state, and both RGB LEDs before enabling the controlled equipment.
  3. Verify which direction increases and decreases the value, then add button debounce.
  4. Map the relative count to a bounded application value and apply optional acceleration for fast rotation.
  5. Define a stale-data or I2C-fault state that leaves the controlled output safe.

Example Setpoint Editing Workflow

  1. Read the encoder delta and push state at a fixed interval.
  2. Apply direction, acceleration, and minimum/maximum limits before changing the pending setpoint.
  3. Use one LED state while editing and another after the value is committed.
  4. Accept the change only after a debounced press, then store or apply the confirmed value.
  5. Restore a defined state after a host restart or communication timeout.

Relative Position and Input Handling Notes

  • The encoder reports relative movement rather than an absolute shaft position.
  • Rapid rotation can exceed a slow polling loop; read consistently and test at the fastest expected user input.
  • The mechanical push input requires debounce and protection against unintended repeat actions.
  • Long I2C wiring, bus capacitance, or an address conflict can cause inconsistent input.
  • This control is not a safety-rated selector, emergency input, or absolute position sensor.

M5Stack Rotary Encoder Resources

M5Stack Rotary Encoder Unit

$9.90 USD


Does it come with a warranty?

Add your collapsible row content here. If it's set to open one row at a time, consider keeping the content in each row about the same length.

What happens if I don't like it?

Add your collapsible row content here. If it's set to open one row at a time, consider keeping the content in each row about the same length.

How fast is shipping?

Add your collapsible row content here. If it's set to open one row at a time, consider keeping the content in each row about the same length.

What's the returns policy?

Add your collapsible row content here. If it's set to open one row at a time, consider keeping the content in each row about the same length.

Don’t Just Take Our Word for It

  • A Clearer Way to Get Started

    LogicBoundless made it much easier to understand which components worked together. The product information was clear, and I could move from an idea to a working prototype without wasting time on incompatible hardware.


    Verified Maker
    First-Time IoT Builder
  • Practical Support Beyond the Product

    What stood out was the practical guidance. The specifications, compatibility notes, and troubleshooting resources helped us choose the right hardware and solve development issues more efficiently.


    Verified Customer
    Embedded Systems Engineer
  • Making Hardware Easier to Learn

    The clear explanations and project-focused resources made complex hardware easier to understand. Instead of simply following instructions, learners could see how each component contributed to the complete system.


    Education Partner
    STEM Instructor
1 of 3