There are many different technologies used in rotary encoders on the market today. Optical encoders are the most common type of encoder available, generating output code using infrared light and phototransistors. Magnetic encoders generate code by detecting changes in magnetic flux fields. These are usually used in environments that encounter adverse conditions.