The design is simple. A series of lights are connected in such a way that rising water will complete the circuit and turn each light on in sequence. Water is not normally a good conductor of electricity but a "pinch" of salt added to water creates a salt water solution that is a good conductor of electricity.
Use a cup with parallel sides to hold your wires, add a bit of salt and wait for the rain. This animated GIF demonstrates how the electronic rain gauge works. The "white" lines in the salt water show the completed circuit through the salt solution.
In this rain gauge sensor, wires are inserted in holes drilled in
a plastic tube.
Glue is used to seal the holes.
Holes are 2 cm apart.
Rain gauge sensor connected with "-" battery connection at bottom.
As water rises in the tube the LED's will light in sequence.
Salt is used to increase conductivity.
Another idea for a rain gauge.
You may notice bubbles of gas rising from the "-" wire
in your cup, this is hydrogen gas. The electricity, salt and water combine
in some interesting electrochemistry.