A float switch is a type of level sensor, a device used to detect the level of liquid within a tank. The switch may be used to control a pump, as an indicator, an alarm, or to control other devices. One type of float switch uses a mercury switch inside a hinged float. This device will detect the level of liquid in a well or tank and either open or close an electrical circuit to control the functions of a pump, or depending on the designed nature of its work. The switch operates by the action of being tilted upwards or downwards due to buoyancy. This triggers the rolling of a metallic ball or mercury inside the buoy which then in turn closes or opens the external circuit. You can therefore use it to activate a tank refill when the levels reach a certain point or discontinue pumping from a well when the levels reach low levels.