Because of the global labor shortage due to COVID-19, the increasing labor cost, and the demand for management of high quality and efficient production, intelligent manufacturing and digital transformation becomes a trend for developing contemporary production chain. Introduction of sensing layer and digital intelligent analysis technology to acquire machine status is indispensable to make appropriate machining compensation or release a warning in time, so that the production quality and processing capability of the equipment can be enhanced. The CNC machine tool aims at achieving high speed and high precision. There are many factors that affect machining accuracy, and the effect of the thermal displacement accounts for more than 50% of overall errors. Axial thermal expansion of spindle is the major direction error in particular. In order to develop intelligent CNC machining equipment, this article will introduce the development of gap sensing module for measuring thermal expansion of spindle axis.