Abstract:The broken pipe detection system adopts a PIC24F microcontroller(PIC24FJ64GA006) of the Microchip Technology Inc. as the main controller chip. In order to realize communication between the system and the Personal Computer, Modbus communication protocol is used on the basis of RS485 serial port. The implementation and design process of the Modbus communication protocol in the broken pipe detection system are analyzed, and the main flow chart of the software is given. The reading and writing register procedure of Modbus RTU(Remote Terminal Unit) communication protocol is explained, and the Modbus RTU protocol is simplified according to the actual situation so as to effectively improve data transmission and the efficiency of the code. The experimental result shows that the scheme can improve the stability and safety in the process of data transfer.