Using two wires to detect water - making your own water sensor

I would use an Optocoupler. Check the schematic.