Intro: Gradient Rain Gauge
The Gradient Rain Gauge is a relatively simple way to measure rainfall in a continuous and real-time way. Do you want to check whether the weather predictions were true? Do you want to have fun building a useful device and at the same time learn something about physics and programming? Then go ahead and follow the instructions.
Make sure to gather the following equipment before starting to build:
- A small plastic box to store the water in (approximately 0.5 – 1 litres)
- A bolt long enough to fit through the plastic box and a screw fitting to the bolt
- A flexible tube (diameter 1-5 mm, length 30-50 cm)
- Wood (4 beams of 50x10x10 cm, 1 beam of 30x10x5 cm, 2 beams of 20x10x5 cm)
- A Photon device (for example the particle maker kit) See the website of particle for more information An accelerometer (We used Adafruit LIS3DH Triple-Axis Accelerometer)
- Wires to connect the accelerometer to the photon
- A funnel
- A few elastic bands
In addition to these materials, a basic knowledge of soldering and programming a Photon (comparable to an Arduino) is advised, but not needed.
Step 1: Building!
Constructing the frame
Like shown in the picture, the catchment area of the rain gauge must be able to move freely over the frame. The frame can be made like the one in the picture, but feel free to make your own version of it. The frame consists of a few wooden bars constructed to each other. Firstly, the 2 legs of the construction can be made, by screwing the bars together with an angle of 90 degrees. Make sure both legs have the same height, so it will not have influence on the angle. On top of the legs, a bar can be placed to connect the legs. Attached to this bar, 2 smaller bars can be attached, to which the catchment area can eventually be constructed.
Constructing the catchment
The catchment area is the most important part of the device. It is going to measure the volume of the rain falling. To start with, holes need to be drilled to fit in a bolt. The bolt is the axis over which the plastic box will tilt. The axis is not constructed in the middle of the plastic box. Instead it is constructed to one side of the box, like shown in the picture. This way, the centre of gravity of the box causes it to tilt around the axis, creating the angle which will later be used for measuring the volume. Before fastening the bolt with the plastic box to the frame, it is convenient to first construct a mechanism for emptying the catchment area. For this, you can use a siphon. The physical principle of a siphon relies on the fact that once the water level has reached the highest point of the siphon, the complete catchment area will empty. To attach the siphon to the plastic box drill a hole in the bottom of the box on the opposite side of the axis and attach the siphon to it. Make sure the highest point of the siphon does not reach above the edge of the box, so the water won’t flow over the top of the box. Whenever you are done constructing the siphon, you can attach the plastic box with the bolt to the frame. To measure the rotation of the box when rain has fallen in it, the box needs resistance to turning, so it will not flip over immediately. This resistance can be created by using (a few) rubber bands. Attach the rubber bands with one side to the plastic tilting box (opposite of the turning axis) and with the other side to the frame, so it will be slightly slanted compared to the horizontal. Look at the image for clarification.
Step 2: Wiring
After building the skeleton of the rain gauge the accelerometer has to be hooked up to the photon and sticked onto the plastic cup. Stick the meter on the bottom of the cup with some tape (or glue) and make sure it is water resistant. This can be anything you can think of as long as it keeps the meter dry, but if your imagination abandons you use a plastic bag like we did (as can be seen in the picture).
The accelerometer, used to measure the angle of the catchment area, needs to be wired to the photon correctly. These connections should be soldered and in between use about 30 cm of wire to ensure the accelerometer can be attached to the plastic cup. To do this, the following connections need to be made:
- VIN: 3V3
- GND: GND
- SCL: D1
- SDA: D0
- INT: WKP
If using a different accelerometer check documentation for the correct connections.
Step 3: Programming
After the construction of the gauge and correct wiring, the accelerometer has to be programmed to measure the angle of the catchment and convert this to rainfall.
As we used the [Adafruit LIS3DH Triple-Axis Accelerometer] a community library can be modified. This specific community library can be found here after authenticating at the particle website (Click here). Using and Modifying the I2C.ino code in this library will make this rain gauge operational. For a detailed explanation of the modified code download the document attached and look at the comments in the program. If using a different brand of Accelerometer look for a community library for your specific brand.
After flashing the firmware to the photon device our rain gauge is operational. As we used the photon for its networking capabilities and its autonomy, it's already publishing data the the cloud. To be able to actually use this data it has to be setup to log these results. In the code provided above an event named "Regen" is published (which is the dutch word for rain). Using IFTTT we can publish this data in any form we like!
Step 4: Calibration
After tinkering with your settings in IFTTT, the gauge has to be calibrated to your settings. As can be seen in the code attached, the gauge has to be calibrated to couple angle with amount of rainfall. As this is specific for each location it has to be done when the sensor is in place. This relation is then included in the code. To determine this function, rainfall has to be simulated and correlated to the angle, for which we used a spreadsheet and plotted a trendline. An easy way to simulate rainfall is to use a measuring cup and use a specific amount of water to increase the angle. An example can be seen in the picture below. Taking a sufficient number of steps until the siphon activates and a relative low polynomial ensures a good fit for a trendline.
Step 5: Finished!
Now the rain meter is done and you can enjoy measuring the rain yourself and you can check whether your laundry is still dry after heavy rainfall. Small note, do not use in heavy weather like hurricanes and typhoons.