MEMS inertial sensors using underground azimuth measurement, with small size, high accuracy, low cost and good stability, the control and drive system is very important. This paper presents the autonomous underground azimuth measurement drive system based on MEMS gyroscope. Using MEMS gyroscope as a measuring element, driven by a brushless DC motor, using a combination of photoelectric encoder, according to the underground azimuth measurement principle, this paper proposed a autonomous measurement method, discussing the design principles of the program, the components of the system, and the communication problems between the gyroscope and other part. Overcoming the high cost of traditional logging tool and the complex control problem, experimental results verify that the system is able to achieve underground azimuth measurement purposes. Error in 1.5°or less, with outstanding engineering applications.