If you just want to measure the water levels when the tank is almost empty and again when its full, to control a water tank fill valve then:
Use two floats with microswitches, one float will operate the valve to open the valve and the other float will operate a microswitch when the tank is full, to close the valve.
Wire the microswitches in series, so they switch in the correct sense, for full and empty.