Calculate depth based on value from Sensor