The transport of oil, natural gas, water, and other petrochemical substances is extensively supported by pipelines over long distances. However, long-term use without maintenance causes the residue in the pipeline to gradually settle in the pipeline due to physical or chemical action, and the pipeline becomes an accident. This leads to overpressure and leakages in the pipeline, which in turn affects the safety of the industry and people's lives. This study aims to develop a nondestructive inspection to measure defects in a water pipeline using an ultrasonic technique. An SCH80 carbon steel pipe with a standard thickness of about 11 mm was used for the experiments, and various sets of defects inside and outside of the pipe were simulated, such as holes and grooves. A submerged ultrasonic transducer was used to evaluate the simulated pipeline defects and then acquire the defect data in an imaging system using LabVIEW and origin software. In this way, the thickness and location of the defects were clearly located. In addition, the ultrasonic detection error was calculated to be less than 6.5%. It helps to use this technique and equipment for the inspection of underground fluid pipelines.