This sketch defines two variables: lowerThreshold and upperThreshold. These variables stand for our thresholds. The basic principle at the rear of magnetic, mechanical, cable, and also other float level sensors typically will involve the opening or closing of the mechanical switch, either by way of immediate connection with the switch, https://controltechme.com/ultrasonic-level-sensor/