Here is an interesting electronics project to detect if there is raining or not. Same circuit can also be used as water level indicator or as a tank overflow indicator.
Working: Water is a conductor of electricity. When water is in contact with the probe then there is a flow of current toward the base of NPN transistor (BC548), which conducts. With the conduction of NPN transistor, electron reaches to Q2, which is a PNP transistor . PNP transistor (BC558) also conducts and current flows through the speaker. In a speaker there is inductive coil which causes motion in one direction and after that produces induce current, which is in opposite direction to the flow of current this induced current in the form of pulse, flows through a capacitor, resistance and makes 1st transistor BC548 off for an inter-well and after-that it relaxes to previous state. This process repeats again and again till probe is in contact with water and an oscillation is created in the circuit. Speaker diaphragm vibrates and gives a tone. Frequency of the circuit depends on the value of Coil impendence, Capacitor and Resistance Value.