It can be realized by a circuit with a mechanical float and a travel switch, as shown in the figure: the float can be made by itself, and the travel switch has normally closed contacts and is connected in series in the power supply circuit of the water pump motor. When the water tower is full of water, the float will push open the normally closed contact of the travel switch and the water pump will be cut off.
When the water level of the water tower drops below the floating ball, the power supply is automatically connected.