Precipitation is typically measured using a tipping-bucket rain gauge.  It is usually a cylinder with a known base area that allows precipitation to enter and is directed to a funnel where it fills a very small and sensitive bucket that pivots like a see-saw in such a way that when one side fills, it drops and allows water to flow into the other side until it drops and the cycle continues.  The number of pivots of the axis is measured and is related to the amount of rain fall.  It is common in cold climates to heat the inside of the cylinder so that if the precipitation is frozen it will be melted and counted.

Image of tip-bucket_operation
Image of tipping-bucket