This sketch defines two variables: lowerThreshold and upperThreshold. These variables characterize our thresholds. The principle driving magnetic, mechanical, cable, and also other float level sensors generally includes the opening or closing of the mechanical swap, possibly by way of immediate contact with the change, or magnetic operation of a reed. https://controltechme.com/ultrasonic-level-sensor/