From experience you will also want to add an hysteresis type of algorithm of else as you add liquid in the tank it will create turbulence that will make the level detecter go into a series of true/false/true states.
From experience you will also want to add an hysteresis type of algorithm of else as you add liquid in the tank it will create turbulence that will make the level detecter go into a series of true/false/true states.