Counting number of motor rotations?
If you are simply after counting rotations then one simple solution is a slotted OPTO and a disk with a single slot. This will produce a pulse every rotation &amp; this can be used to increment a register/variable.

I have done something similar using a scraped CD &amp; a black permanent pen more as absolute reference when comparing other parameters. 


suitable image found via google.