A potentiometer changes the value of a resistor, but its range is limited.Ī rotary encoder can detect a specific number of “steps” for each revolution and sends a signal at each step. However, a potentiometer is an analog sensor while the rotary encoder is digital. Difference between rotary encoder and potentiometerĪt first, the rotary encoder KY-040 may look like a potentiometer. We can use this module to create a user interface for our program for example, to select options from a menu or change the value of a variable. This tutorial will explore utilizing a KY-040 rotary encoder module, a common component in DIY kits. The control button on 3D printers is usually a rotary encoder Getting started with a rotary encoder: the KY-040 Furthermore, many encoders used in DIY kits have a push button built-in. They’re mostly used in motors for PID control and user interfaces as an alternative to potentiometers. Rotary encoders are position sensors that measure an axis’s angular position (or rotation).
Using a rotary encoder with Arduino Code with an ESP32