The LM1830 fluid detector IC from National Semiconductor is designed to be able to detect the presence of fluids using a probe. This chip requires a relatively high supply voltage and is not the most frugal power consumption. It is also quite specialized so unless you are buying in bulk the one-off price is not cheap.
An alternative circuit shown here uses a standard CMOS IC type 74HC14. It has the advantage of operating with a 3 V supply and consumes less than 1 µA when the alarm is not sounding, this makes it ideal for use with batteries.
The 74HC14 has six inverters with hysteresis on their input switching thresholds. A capacitor (C1) and a feedback resistor (R1) is all that’s necessary to make an inverter into a square wave signal generator.
In the water alarm circuit, the feedback resistor consists of R1 and the water sensor in series. R1 prevents any possibility of shortcircuit between the inverter’s input and output. Resistor R2 defines the inverter’s input signal level when the sensor is not in water. Any open-circuit (floating) input can cause the inverter to oscillate and draw more current. The remaining inverters in the package (IC1. B to IC1.F) drive the piezo buzzer to produce an alarm signal. Capacitor C2 ensures that no DC current flows when the circuit is in monitoring mode (with the alarm silent) this helps reduce the supply current.
A micro-switch can also be substituted for the water sensor to make the circuit a more general purpose alarm generator.