Urban water environment pollution is a global concern, in developing countries, sewage infiltration resulting from urban drainage pipelines breakage is an essential element in the urban groundwater pollution and the recurrence of black odor water bodies, it is crucial to accurately and efficiently detection and localisation of urban drainage pipelines breakage to protect the urban water resources. In this paper, a device for detecting defects in drainage pipelines was developed and assembled using microelectromechanical systems (MEMS) inertial sensors as the core components, and the improved cumulative sum (CUSUM) model was used for anomalous detection of the pitch angle of the device's movement along the course of the pipeline as a method of detecting pipeline breakage. In the laboratory simulation of drainage pipeline tests, the CUSUM peaks (0.709, 1.102, 3.038, 7.990) for the case of external water infiltration rates into the pipeline at the point of pipe breakage (2.9%, 4.6%, 5.8%, 9.2%), and for the cases of sewer exfiltration rates in the pipeline of 4.2% and 6.4% (0.760, 1.382). CFD simulations of the water flow in the laboratory pipeline show a high degree of overlap between the trend of the water surface near the point of breakage and the anomalous fluctuations in the pitch angle of the device motion in the laboratory tests. Finally, the authors tested the device on municipal drains in the city of A. The results demonstrated the reliability and high accuracy of the device. The device enables to improve the ecological quality of urban water environment by accelerating the rate of defect detection in urban drainage pipelines and reducing the detection expenses.