Trigger the HC-SR04, measure echo time, and calculate distance with a timeout, while accounting for target angle, surface and air temperature.