(The characters in the picture are: light source, code wheel, photosensitive element, amplification and shaping, pulse output).
There are slits with equal angles (divided into transparent and opaque parts) at the edge of the code wheel, and the light source and photosensitive element are installed on both sides of the slit code wheel respectively. When the code wheel rotates with the working shaft, the light changes every gap, and then after shaping and amplification, the electric pulse output signal with a certain amplitude and power can be obtained, and the number of pulses is equal to the number of gaps. The pulse signal is sent to the counter for counting, and the rotation angle of the code wheel can be known from the measured numbers.
In order to judge the direction of rotation, two sets of photoelectric conversion devices can be used. Make their relative positions in space have a certain relationship, so as to ensure that the signals generated by them are 1/4 cycle apart in phase.