KY-040 360°Rotary Encoder Module with Knob Cap for Arduino Raspberry pi

The rotary encoder can count the number of output pulses during the rotation in the positive and negative directions by rotation. There is no limit to this rotation count. With the button on the rotary encoder, it can be reset to the initial state, that is, counting from 0.

eBay