Best Rotary Encoders for ESP32: 7 SparkFun Qwiic Twist, M5Stack Dial, Adafruit, KY-040, AS5600 and Optical Picks Compared (Buying Guide)

⚠️ Affiliate Disclosure: This post contains Amazon affiliate links. If you purchase through our links, we may earn a small commission at no extra cost to you. Every product below was checked against its live Amazon listing before publishing. Prices change often, so we don’t list them here. Tap any Buy Here button to see the current price on Amazon.
ESP32 User Input Guide

πŸŽ›οΈ Best Rotary Encoders for ESP32

From cheap KY-040 knobs to I2C encoders, a smart ESP32-S3 dial, magnetic AS5600 sensors and 600-pulse optical encoders: 7 picks for menus, volume knobs and motor feedback.

βœ… 7 Encoders Compared βœ… Verified Amazon ASINs βœ… 3.3V Wiring Notes βœ… Honest Pros & Cons

A rotary encoder is the knob that makes an ESP32 project feel finished. Unlike a potentiometer, it turns forever, reports direction in clean steps, and usually adds a push button, which is exactly what you need to scroll an OLED menu, set a thermostat, adjust a WLED brightness level or tune a stepper speed. Mounted on a shaft, the same idea measures how far a wheel or motor has turned.

Encoders come in three families: mechanical (cheap, with satisfying detents), optical (hundreds of pulses per turn for speed and position) and magnetic (contactless, absolute angle over I2C). This guide compares 7 picks across all three, plus I2C encoders that save GPIO pins and the M5Stack Dial, an ESP32-S3 built into a knob.

πŸ’‘ Before you buy: Decide whether you need a human knob or a measurement sensor. For menus and settings, a 20 to 24 detent mechanical encoder with a push button is ideal, and mechanical contacts bounce, so plan on the ESP32’s PCNT glitch filter or a small debounce. For motor speed or wheel position, use an optical or magnetic encoder instead. Also check which chip you have: the original ESP32 has hardware pulse counters (PCNT), but some newer chips such as the ESP32-C3 do not, which makes an I2C encoder the easier choice there.

⚑ Quick Comparison: All 7 Rotary Encoders

EncoderTypeInterfaceResolutionBest ForBuy
πŸ₯‡ SparkFun Qwiic TwistMechanical, RGB litI2C (Qwiic)24 ticks per turnBest OverallBuy Here β†’
πŸ–₯️ M5Stack Dial v1.1ESP32-S3 smart knobBuilt in (GPIO)64 pulses, 16 positionsBest All-in-One KnobBuy Here β†’
🎚️ Adafruit Rotary Encoder + ExtrasMechanical, detentedQuadrature (GPIO)24 pulses per turnBest Panel-Mount KnobBuy Here β†’
πŸ“˜ DIYables Rotary Encoder (5 pack)Mechanical moduleCLK, DT, SW (GPIO)Continuous, with buttonBest for BeginnersBuy Here β†’
πŸ“¦ WayinTop KY-040 (5 pack)Mechanical moduleCLK, DT, SW (GPIO)Continuous, with buttonBest Budget Multi-PackBuy Here β†’
🧲 HiLetgo AS5600 (2 pack)Magnetic, contactlessI2C, analog or PWM12-bit absolute angleBest Absolute AngleBuy Here β†’
πŸ”¦ 600 P/R Optical EncoderOptical, 6mm shaftAB quadrature, 5 to 24V600 pulses per turnBest for Speed and PositionBuy Here β†’

Specs come from the manufacturers and the live Amazon listings. Star scores below are our ratings.

πŸ” What Matters in a Rotary Encoder

βš™οΈ

Mechanical, Optical or Magnetic

Mechanical is cheap and tactile, optical gives high pulse counts for motors, and magnetic reads an absolute angle with no contacts to wear out.

🎯

Pulses and Detents

Menu knobs want 20 to 24 clicks per turn. Motor feedback wants hundreds of pulses, multiplied by four with quadrature decoding.

πŸ”Œ

GPIO or I2C

Quadrature encoders use two or three GPIOs each. I2C encoders share two wires with your display and sensors, and count steps for you.

πŸ”˜

Push Button

A press-to-select switch turns one knob into a full menu controller: rotate to scroll, press to confirm.

⚑

3.3V Signal Levels

Power module pull-ups from 3.3V, not 5V. Industrial encoders running at 12 or 24V need open-collector outputs pulled up to 3.3V.

πŸ† Detailed Reviews: The Top Two

πŸ₯‡ BEST OVERALL ROTARY ENCODER FOR ESP32

SparkFun Qwiic Twist RGB Rotary Encoder Breakout

⭐ 4.7/5 · Our Rating · The No-Debounce Knob
I2C
QWIIC, 0x3F
24
TICKS PER TURN
RGB
LIT SHAFT
3.3V
NATIVE LOGIC
Buy on Amazon β†’
SparkFun Qwiic Twist RGB rotary encoder breakout for ESP32

The Qwiic Twist takes away everything annoying about encoders. An on-board microcontroller reads the knob, debounces it and keeps count, so your ESP32 simply asks over I2C how far it moved, which direction, and whether the button was pressed. It reports 24 ticks per full turn, includes a built-in push button, and lights the shaft with a PWM-controlled RGB LED that can show up to 16 million colours, handy for showing a mode or a warning state. Two Qwiic connectors let you daisy-chain it with an OLED or sensors on the same two wires, it runs at 3.3V, an interrupt pin can wake your code only when something changes, and a solder jumper moves the address from 0x3F to 0x3E for a second knob. SparkFun provides Arduino and Python libraries; in ESP-IDF it’s a handful of simple register reads. Add a clear knob to let the colour glow through.

βœ… Pros
  • Zero debouncing code
  • Only two I2C wires
  • RGB status light
  • Works on chips without PCNT
❌ Cons
  • Costs more than bare encoders
  • Knob not part of the board
  • Polling adds slight latency
🎯 Verdict: The easiest, most reliable menu knob for any ESP32, especially the PCNT-less C3.

πŸ‘‰ Check Price on Amazon β†’

πŸ–₯️ BEST ALL-IN-ONE ESP32 SMART KNOB

M5Stack Dial v1.1 ESP32-S3 Smart Rotary Knob

⭐ 4.6/5 · Our Rating · A Finished Product in Your Hand
ESP32-S3
8MB FLASH
1.28″
ROUND TOUCH TFT
64 P/R
16 DETENTS
RFID
13.56 MHz
Buy on Amazon β†’
M5Stack Dial v1.1 ESP32-S3 smart rotary knob with round touch screen

The M5Stack Dial isn’t a part you wire to an ESP32: it is an ESP32, built into a palm-sized knob. Inside is a StampS3A (ESP32-S3FN8, 8MB flash), surrounded by a 1.28-inch 240×240 round touch screen, a rotating bezel encoder with 16 positions and 64 pulses per revolution, a 13.56 MHz RFID reader, an 80dB buzzer and a BM8563 real-time clock. It powers from USB-C, a 6 to 36V DC terminal or a small battery, and two Grove-style ports (PORT.A and PORT.B) add I2C sensors or relays. That makes it a ready-made smart thermostat, Home Assistant controller, RFID door panel or LVGL dashboard, programmable in ESP-IDF, Arduino, PlatformIO or UiFlow2. The trade-off is flexibility: you get the encoder M5Stack chose, and the case is part of the deal.

βœ… Pros
  • ESP32-S3, screen and knob in one
  • RFID, buzzer and RTC included
  • 6 to 36V wide input
  • Finished, enclosed design
❌ Cons
  • Not a standalone encoder part
  • Limited free GPIO
  • USB-C cable not included
🎯 Verdict: The fastest way to a polished knob-based controller, with no soldering or enclosure work.

πŸ‘‰ Check Price on Amazon β†’

πŸ”§ Detailed Reviews: Classic Quadrature Encoders

🎚️ BEST PANEL-MOUNT KNOB · ⭐ 4.6/5

3. Adafruit Rotary Encoder + Extras

24 pulses with detents Β· push button Β· panel mount or breadboard Β· soft-touch knob included
Buy Here β†’
Adafruit 24-pulse rotary encoder with push button and knob for ESP32

When the knob will sit on the front panel of a finished enclosure, use a proper bare encoder rather than a module. Adafruit’s is a high-quality 24-pulse encoder with detents (its datasheet is the Bourns PEC11 series), with a three-pin quadrature connector (A, B and ground) plus a separate normally-open push button. It can be panel mounted with its threaded bushing or plugged straight into a breadboard, and it ships with a soft-touch knob with an arrow. Because there are no resistors on it, enable the ESP32’s internal pull-ups on the A, B and button pins (or add 10k resistors) and feed A and B to a PCNT unit with the glitch filter on.

βœ… Pros: Quality detents; panel mountable; knob included; breadboard friendly.
❌ Cons: Needs pull-ups and debouncing; single unit.
🎯 Verdict: The knob to mount on a finished ESP32 project box.
πŸ“˜ BEST FOR BEGINNERS Β· ⭐ 4.4/5

4. DIYables Rotary Encoder Module (5 Pack)

3.3 to 5V Β· CLK, DT, SW, +, GND Β· continuous rotation Β· push button Β· online tutorials
Buy Here β†’
DIYables KY-040 style rotary encoder module with push button for ESP32

If you just want a knob working on a breadboard tonight, this 5 pack of KY-040 style modules is the friendliest start. Each board carries the encoder, its push button and pull-up resistors, with a labelled 5-pin header (CLK, DT, SW, + and GND), and it’s rated for 3.3 to 5V, so you can power it straight from the ESP32’s 3.3V pin and connect the outputs directly. It turns continuously in both directions, and DIYables publishes step-by-step ESP32, Arduino and Raspberry Pi tutorials for it, which is a real help the first time you meet quadrature signals. Five pieces means spares for several projects.

βœ… Pros: 3.3V rated; pull-ups on board; labelled pins; tutorials provided.
❌ Cons: Hobby-grade detents; not panel friendly.
🎯 Verdict: The easiest first encoder for ESP32 breadboard projects.

βž• Also Worth Considering

πŸ“¦ BEST BUDGET MULTI-PACK Β· ⭐ 4.2/5

5. WayinTop KY-040 Rotary Encoder Module (5 Pack)

Five classic KY-040 360 degree encoder modules with push buttons, the board used in countless tutorials. Same CLK, DT, SW pinout as the DIYables pack, and the same rule applies: power the + pin from 3.3V so the on-board pull-ups never send 5V into an ESP32 pin. A cheap way to stock your parts drawer.

Buy Here β†’
🧲 BEST ABSOLUTE ANGLE · ⭐ 4.3/5

6. HiLetgo AS5600 Magnetic Encoder Module (2 Pack, with Magnets)

The AS5600 reads a spinning magnet without touching it and reports a 12-bit absolute angle over I2C (address 0x36), or as an analog or PWM output. That means no wear, no bounce, and the ESP32 knows the exact position at power-up. It’s the go-to sensor for FOC gimbal motors, smooth volume knobs and robot joints. On these clone boards, tie the DIR pin to GND or VCC rather than leaving it floating.

Buy Here β†’
πŸ”¦ BEST FOR SPEED AND POSITION Β· ⭐ 4.2/5

7. 600 P/R AB 2-Phase Incremental Optical Rotary Encoder

A metal-bodied optical encoder with a 6mm shaft, 600 pulses per revolution on A and B channels, a 5 to 24V supply and a listed top speed of 5000 RPM. Decoded in all four edges by the ESP32’s PCNT, that’s 2400 counts per turn, enough for wheel odometry, a DIY CNC handwheel or measuring motor RPM. Check the listing’s output type: open-collector (NPN) versions need pull-up resistors to 3.3V.

Buy Here β†’

πŸ€– Which Encoder for Which ESP32 Project?

ProjectWhat You NeedRecommended Encoder
OLED or TFT menu systemClicky knob, button, few pinsSparkFun Qwiic Twist
Smart thermostat or Home Assistant controllerScreen, knob and enclosure in oneM5Stack Dial v1.1
Front panel of a finished boxPanel-mount encoder and knobAdafruit Rotary Encoder + Extras
Learning PCNT and interruptsCheap breadboard modulesDIYables or WayinTop KY-040
FOC gimbal motor or robot jointAbsolute angle, no wearHiLetgo AS5600
Wheel odometry, RPM, CNC handwheelHigh pulse count on a shaft600 P/R Optical Encoder
ESP32-C3 project (no PCNT)Encoder that counts for youSparkFun Qwiic Twist or AS5600

πŸ›’ Which One Should You Buy?

πŸŽ›οΈ

You want it to just work

The SparkFun Qwiic Twist: no debouncing, two wires, RGB feedback.

πŸ–₯️

You want a finished device

The M5Stack Dial v1.1, an ESP32-S3 with screen, knob and RFID.

πŸ“˜

You’re learning

The DIYables 5 pack, 3.3V rated with tutorials, or the WayinTop KY-040 pack.

πŸ“

You’re measuring motion

The AS5600 for absolute angle, the 600 P/R optical for speed and distance.

❓ Frequently Asked Questions

How should I read a rotary encoder on the ESP32?

Use the hardware pulse counter (PCNT) where your chip has one: it decodes quadrature in hardware, filters glitches and never misses steps, even while Wi-Fi is busy. Our ESP32 PCNT rotary encoder tutorial with ESP-IDF walks through it. GPIO interrupts also work for slow hand-turned knobs.

Why does my encoder skip or count twice?

Mechanical contacts bounce. Enable the PCNT glitch filter, add pull-ups if the encoder has none, and consider a small capacitor (around 10nF to 100nF) from each signal to ground. Also remember most detented encoders produce several counts per click, so divide the raw count to get one step per detent.

Can I use a KY-040 module with 3.3V?

Yes. The encoder itself is just switches, and the pull-up resistors connect to the module’s + pin. Power + from the ESP32’s 3.3V pin and the CLK, DT and SW outputs will stay at safe 3.3V levels.

What’s the difference between an incremental and an absolute encoder?

An incremental encoder (KY-040, Adafruit, optical) only reports movement, so the ESP32 must count from a known start point. An absolute sensor like the AS5600 reports the actual angle at any moment, including right after power-up, which is ideal for joints and motor control.

How many encoders can one ESP32 handle?

It depends on the chip’s PCNT units: the original ESP32 has 8, the ESP32-S3 has 4, and the ESP32-C3 has none. Beyond that, use GPIO interrupts or put several I2C encoders on one bus (the Qwiic Twist offers two addresses).

🏁 Final Verdict: Best Rotary Encoders for ESP32

The right encoder for each job:

πŸ₯‡ Best Overall: SparkFun Qwiic Twist
Buy Here β†’
πŸ–₯️ Best All-in-One Knob: M5Stack Dial v1.1
Buy Here β†’
🎚️ Best Panel-Mount Knob: Adafruit Rotary Encoder + Extras
Buy Here β†’
πŸ“˜ Best for Beginners: DIYables Rotary Encoder (5 Pack)
Buy Here β†’
πŸ“¦ Best Budget Multi-Pack: WayinTop KY-040 (5 Pack)
Buy Here β†’
🧲 Best Absolute Angle: HiLetgo AS5600 (2 Pack)
Buy Here β†’
πŸ”¦ Best for Speed and Position: 600 P/R Optical Encoder
Buy Here β†’

For most ESP32 builds, the SparkFun Qwiic Twist is the encoder to buy: it handles debouncing and counting for you and shares the I2C bus with your display. Choose the M5Stack Dial when you want a finished knob controller, the Adafruit encoder for a panel-mounted front end, a KY-040 pack for learning, and the AS5600 or 600 P/R optical encoder when the job is measuring motion. To read encoders the right way, start with our ESP32 PCNT rotary encoder tutorial, pair your knob with a screen from our ESP32 displays guide, put encoders on your motors with our DC motor drivers guide, and stock up on wires and breadboards from our prototyping supplies guide.

πŸ’¬ Building a knob-controlled ESP32 project? Tell us what it controls in the comments below, and we’ll help you pick the right encoder.

All Amazon links above use our affiliate tag (esp32tutorials-20). Purchasing through them supports esp32tutorials.com at no extra cost to you. Prices and availability change frequently, so always confirm the current price on Amazon before buying.

Leave a Comment