What type of sensor is used in this water flow sensor with two wires?
A simple sensor used in such an application is a magnetic reed switch.

 (source)

The simplest normally-open reed switch has two contacts, which are separated when there is no strong magnetic field incident on the switch. When the switch is exposed to a strong enough magnetic field, the contacts close and a circuit can be established through it. In your case, the float would have a small magnet on it, which passes close to the reed switch when the float moves.

The advantage of this approach is that no current flows, and hence no power is consumed, while the switch is open. Power requirement of the sensor is marginal even when the switch is off - just sufficient to overcome a pull-up resistor at the microcontroller sense pin, for instance.







simulate this circuit &ndash; Schematic created using CircuitLab