M5Stack Unit Encoder Pinout

The Unit Encoder lets an I²C host read a rotary encoder and its pushbutton and control two RGB LEDs. The red PORT.A socket supplies power and connects the I²C bus.

Main pinout

100%Drag to pan · Ctrl/⌘ + wheel to zoomSwipe up/down to scroll the page · Swipe sideways to pan · Use two fingers to pan and zoom
Show signal routes

Pin index

Pin index

Quickly scan every header pin, port name, supported function and usage note.

4 visible
PinMCU pinTypesNotes
GNDCommon ground and I²C reference.
PowerNominal 5 V power input from the host.
I2CBidirectional open-drain I²C data.
I2COpen-drain I²C clock from the host.

Specifications

Model
Unit Encoder · U135
Microcontroller
STM32F030F4P6 · Arm Cortex-M0
Controls
30-position rotary encoder with pushbutton
Indicators
Two individually addressable SK6812 RGB LEDs
Power input
5 V nominal on PORT.A. M5Stack lists 17 mA during encoder operation.
Signal levels
SDA and SCL each have a 10 kΩ pull-up to the onboard 3.3 V rail.
Interface
HY2.0-4P (Grove) · I²C target at 7-bit address 0x40
Size
32.0 × 24.0 × 25.4 mm assembled

References

Datasheets

Manufacturer references and technical documentation.

ChipRoleManufacturerNotesLink
U135Product documentationM5StackPinMap, photographs and specifications.Datasheet
Unit EncoderReference schematicM5StackJ1 numbering, power rails, I²C pull-ups, encoder and SWD.Datasheet
Unit EncoderI²C protocolM5StackEncoder mode and count, button state and RGB controls.Datasheet
STM32F030F4P6Microcontroller datasheetSTMicroelectronicsTSSOP20 pin assignment and alternate functions.Datasheet
M5Unit-EncoderArduino libraryM5StackLibrary and examples for using the I²C interface.Datasheet

Board notes

PORT.A orientation
With the encoder facing you and the red socket at the bottom, read GND, 5V, SDA and SCL from left to right. SCL is J1 pin 1 on the right. The rear label shows the order from the opposite face.
Power and I²C levels
Supply 5 V at J1 pin 3 and use 3.3 V open-drain I²C signaling. The schematic shows a 10 kΩ pull-up on each line and a direct connection to the STM32. The 3.3 V rail is internal.
Controls and address
At 7-bit address 0x40 the host can read the encoder count and button state, select the encoder mode and set the RGB LEDs. Encoder A and B, the pushbutton, and LED data are internal signals.
PCB revision and SWD
The photograph and reference schematic identify U135. The exact PCB revision and the physical location and population of the internal P1 SWD connection remain unconfirmed.