I hope the first part of this question isn't too physics based for this forum but I am trying to use an optical rotary mask encoder such as this one (Optical Encoder Pair Kit) to determine the RPM of a brushless 1:50 geared DC motor. The website above mentions that the package comes with 3 or 5 teeth wheels which correspond to 12 and 20 counts per revolution respectively and that for a geared motor you should multiply by the gearing ratio. I want to use the 5 tooth wheel to get the maximum resolution but I do not understand why using a 5 tooth wheel will give 20 counts per revolution. Why not 5, does it have something to do with there being 2 channels on the output?
To determine the RPM I am thinking that I will have to setup an interrupt in my microcontroller to add 1 to a variable (call it pulse counter) everytime the photodiode on the encoder spikes, then increment a revolutions variable when the pulse counter and the calculated number of counts per revolution correspond and then have a timer on an interrupt which will check the number in the revolutions variable, divide by 60 and output the result as an RPM value.
Is this a valid approach or is there a better way to do this?