Photoelectric encoders, with their advantages of non-contact operation, high speed, high resolution, and high reliability, are increasingly widely used in automatic control and automatic detection technologies. This system uses an 8031 microcontroller as its core and a 9-bit absolute photoelectric encoder as its sensor to form a speed and angle testing system. It can simultaneously output control signals for speed, angle, and number of rotations.