Has anyone tried to put an HC-SR04 in a tube.

Maybe you could use a float with quadrature gradations (or turn a rotary encoder) and count pulses.