For an upcoming project I needed to get precise positions of the rotation of a washing line. Yes my life is never dull. Anyway after a lot of searching I found it was not such a simple task- well not as easy as I expected. After much research and a lot of bad examples floating around out there I found the one that worked best for me. I also went through a lot of difficulty finding the right encoder for this job.
Anyway here is a very simple device to collect endless rotation with a high degree of speed and accuracy and a pretty sturdy shaft encoder with solid mounting terminals for a reliable installation. The only part I left out was a rotation reset, this would work even better if there was a calibrated reset switch that was triggered at a known point once per revolution. I left this out of the final version as we were accurate enough for the show we were making and I could not find a simple solution for mounting it on the washing line assembly.
Here is the code I used
and here is a link to the shaft encoder I used.