An automatic measurement device is designed to measure the length of product components on the conveyor in the factory, and count them. This system uses single chip microcomputer (SCM) STC89C52 as the core, which can control driver circuit to run the stepping motor driving the conveyor. The moving component length can be calculated by the rotating speed of stepping motor and the interval of infrared sensor blocked. The displaying screen LCD1602 can show the length data and counts, and voice chip ISD4003 can broadcast them. Software adopts C language with readability and good portability to write the program.