To overcome the obstacle of ranging by using the same type of ultrasonic transducer in two medium such as water and air, whose sound wave transmission characteristics are of significantly different, this paper proposed a dual medium ultrasonic ranging scheme, with the application background of cast-in-place piles’ borehole diameter measurement. Based on the analysis of media’s influence mechanism on ultrasonic ranging performance, a high-sensitivity weak signals conditioning circuit is constructed, with front-end amplifier, bandpass filter, demodulator, back-end amplifier and lowpass filter, which enables the ultrasonic transducer dedicatedly designed for underwater ranging can work in the air. On this basis, by designing a dual channel signal conditioner and increasing the ultrasonic emission power, the problem of ultrasonic ranging in air and underwater using unique type of transducer is solved, and the media in which ranging is ongoing can be distinguished at the same time. To verify the scheme’s effectiveness, an experimental platform is built and ranging experiment is conducted in both air and water. The result proves that the expected ranging range and accuracy can be achieved under both media conditions, which lays theoretical foundation and provides engineering approach for similar scenarios.