Simple rotary encoder using a DC motor