In recent years, the coal mine intelligent development process has constantly advanced, putting forward higher requirements for monitoring mining equipment data. Sensor technology suitable for the special underground environment has also been developing. Hydraulic support is a key piece of equipment in fully mechanized coal mining. Monitoring the hydraulic support position and attitude has been an important part of coal mine intelligent development. In the present paper, a new oil cylinder displacement sensor was proposed. The oil cylinder translational motion was transformed into the magnet rotary motion via the motion conversion mechanism. The magnet angle was calculated by utilizing the single-chip microcomputer, and the oil cylinder expansion and contraction were calculated via the filtering algorithm. Results showed that the sensor accuracy could reach 0.5 mm. In recent years, the coal mine intelligent development process has constantly advanced, putting forward higher requirements for monitoring mining equipment data. Sensor technology suitable for the special underground environment has also been developing. Hydraulic support is a key piece of equipment in fully mechanized coal mining. Monitoring the hydraulic support position and attitude has been an important part of coal mine intelligent development. In the present paper, a new oil cylinder displacement sensor was proposed. The oil cylinder translational motion was transformed into the magnet rotary motion via the motion conversion mechanism. The magnet angle was calculated by utilizing the single-chip microcomputer, and the oil cylinder expansion and contraction were calculated via the filtering algorithm. Results showed that the sensor accuracy could reach 0.5 mm.