float switch is a device used to detect the level of liquid within a tank. The switch may be used in a pump, an indicator, an alarm, or other devices.
A very common application is in surface and submersible pumps where the switch detects the rising level of liquid in the tank and energizes the electrical pump which then pumps liquid out until the level of the liquid has been substantially reduced, at which point the pump is switched off again.
Float switches are often adjustable and can include substantial hysteresis. That is, the switch's "turn on" point may be much higher than the "shut off" point, i.e emptying and filling operations