Introduction:
In this Instructable we 'construct' a rain gauge with Arduino and calibrate it to report daily and hourly rainfall. The rain collector I am using is a re-purposed rain gauge of the tipping bucket type. It came from a damaged personal weather station. However there are a lot of great Instructables on how to make one from scratch.
This Instructable is a part of a weather station I am making and is a documentation of my learning process disguised as a tutorial:)
Characteristics of the Rain Gauge:
Rainfall is reported/measured in millimeters or inches which has the dimension of length. It is indicative of how high, every portion of rain area got the rain, if the rain water had not dissipated and drained away. So, a 1.63 mm of rainfall would mean that if I had a flat leveled tank of any shape the rain water collected would be of a height 1.63 mm from the tanks bottom.
All rain gauges have a rainfall catchment area and a rainfall amount measurement. The catchment area is the region over which the rain is collected. The measuring object would be some kind of volume measurement for a liquid.
So the rainfall in mm or inches would be
rainfall height = volume of rain collected / catchment area
In my rain collector, the length and breadth were 11 cm by 5 cm respectively giving a catchment area of 55 sq.cm. So a collection of 9 milliliters of rain would mean 9 cc/55 sq.cm = 0.16363... cm = 1.6363... mm = 0.064 inches.
In the tipping bucket rain gauge, the bucket tips 4 times for 9 ml (or 0.064... inches of rain) and so a single tip is for (9/4) ml = 2.25ml (or 0.0161.. inches). If we take hourly readings (24 readings per day before resets) keeping three significant digit accuracy is decent enough.
Thus, at each bucket tip/tumble, the code accesses it as 1 on-off-on sequence or one click. Yes, we have reported 0.0161 inches of rain. To repeat, from the Arduino point of view
one click = 0.0161 inches of rain
Note 1: I prefer the International System of Units, but Weather Underground prefers the Imperial/US units and so this conversion into inches.
Note 2: If calculations are not your cup of tea, head over to Volume of Rainfall which provides perfect help for such matters.
Most of the parts were lying around and a fair listing (for formality) is
Tools:
The photos of my rain collector should make thing clear to many. Anyway, the rain that falls on its catchment area gets channeled to one of the two tipping-buckets inside it. The two tipping-buckets are connected like a see-saw and as the rain water weight ( 0.0161 inches of rain for mine ) tips one bucket down it gets emptied and the other buckets goes up and positions itself to collect the next rain water. The tipping motion moves a magnet over a 'magnetic-switch' and the circuit gets electrically connected.
To make the circuit
The circuit is complete. Jumper wires and breadboard make the connections easier to make.
To complete the project connect the Arduino to the PC using the USB cable and load the sketch provided below.
The sketch RainGauge.ino (embedded at the end of this step) is well commented and so I shall point out three sections only.
One part counts the number of tipping-bucket tips.
if(bucketPositionA==false && digitalRead(RainPin) == HIGH){ ... ... }
Another part checks time and computes the rain amount
if(now.minute()==0 && first == true){ hourlyRain = dailyRain - dailyRain_till_LastHour; ...... ......
and another part clears the rain for the day, at midnight.
if(now.hour() == 0){ dailyRain = 0; .....
Disconnect the Rain Collector from the rest of the circuit and perform the following steps.
const double bucketAmount = 0.0161;
That's all to it. For more accuracy, one can include more digits like 0.01610595. Of course your calculated numbers are expected to vary if your Rain Collector is not identical to mine.
For testing purposes
The resolution of the rainfall readings in my case is 0.0161 inches and cannot be made more accurate. Practical circumstances may decrease the accuracy further. Weather measurements do not have the accuracy of quantum mechanics.
Part of the code was borrowed from Lazy Old Geek's Instructable.