Pipe contaminant detection holds considerable importance within various industries, such as the aviation, maritime, medicine, and other pertinent fields. This capability is beneficial for forecasting equipment potential failures, ascertaining operational situations, timely maintenance, and lifespan prediction. However, the majority of existing methods operate offline, and the detectable parameters online are relatively singular. This constraint hampers real-time on-site detection and comprehensive assessments of equipment status. To address these challenges, this paper proposes a sensing method that integrates an ultrasonic unit and an electromagnetic inductive unit for the real-time detection of diverse contaminants and flow rates within a pipeline. The ultrasonic unit comprises a flexible transducer patch fabricated through micromachining technology, which can not only make installation easier but also focus the sound field. Moreover, the sensing unit incorporates three symmetrical solenoid coils. Through a comprehensive analysis of ultrasonic and induction signals, the proposed method can be used to effectively discriminate magnetic metal particles (e.g., iron), nonmagnetic metal particles (e.g., copper), nonmetallic particles (e.g., ceramics), and bubbles. This inclusive categorization encompasses nearly all types of contaminants that may be present in a pipeline. Furthermore, the fluid velocity can be determined through the ultrasonic Doppler frequency shift. The efficacy of the proposed detection principle has been validated by mathematical models and finite element simulations. Various contaminants with diverse velocities were systematically tested within a 14 mm diameter pipe. The experimental results demonstrate that the proposed sensor can effectively detect contaminants within the 0.5−3 mm range, accurately distinguish contaminant types, and measure flow velocity.