In order to explore the influencing factors and laws of ultrasonic sensor detecting wheat canopy height, designed an ultrasonic sensor detection height test platform with speed adjustable function. Taking step surface, bare soil and wheat canopy as the research objects, a canopy height calculation method based on K-mean clustering is proposed, and the response characteristics of ultrasonic detection to three media under different operating speeds are explored. Firstly, the step detection test results show that the average detection error of ultrasonic sensor is 1.35%. When the sensor detection distance is switched at the step, with the increase of detection distance, the actual offset at the step increases first and then tends to be stable, and the maximum offset is 10.4cm. The test results of bare soil slope show that the relative error between the detection distance and the manual measurement distance is 1.4% under quasi-static conditions. The leading or lagging of detection under moving conditions is affected by multiple factors such as terrain undulation, speed and detection range. The detection test results of wheat canopy showed that the detection distance was larger than the manual measurement distance, and the smaller the canopy density, the greater the detection error and error variance. When the moving speed is 0.3m/s-1.2m/s, the average detection deviation of the ultrasonic sensor for five kinds of wheat canopy density is 0.14m, and the maximum variance of the detection deviation is 0.07cm2. In this paper, the research on the response characteristics of ultrasonic to the detection of bare soil and sparse canopy in wheat field can provide technical support for the detection of crop canopy in the field.