An off-the-shelf kit and about two hours are all you need.
What is a rotary encoder? A rotary encoder looks like a potentiometer, but it is fundamentally different. A rotary encoder can rotate freely unlike a potentiometer and instead of variating resistance, ...