rain gauge sensor used for digital rain gauge

How to make a Digital Rain Gauge Monitor | Arduino Tutorial

A Rain gauge is one of those sensors that is a great addition for your DIY weather station.

Finding a stand alone rain gauge is not that common, so I decided to go down to the local hardware store to see what cheap weather stations they had that included a rain gauge.  There was a $14 dollar digital rain gauge monitor, then my eyes spotted a digital rain gauge on clearance for 43cent, so I though for a moment, that can’t be real, then reading the sales ticket, it said $9.00 then $1.50, then $0.85, then finally $0.43 cents, then I thought BARGAIN ! I’ll take a couple of those, one to experiment with and one for a spare.

In this tutorial, I’ll show you how to make a digital rain gauge monitor by using a rain gauge sensor from an off the shelf product, how this particular sensor works and how to read the signal with an Arduino Uno and display the result to an LCD Display. So, keep reading to find out how……or Watch the Video below if that’s easier…..




How is Rain Fall Measured

Measuring rain fall is one of those parameters that is nice to have for a weather station. Getting hold of a cheap rain gauge sensor on it’s own is not easy, so you could either make one or by a cheap off the shelf digital rain gauge monitor and use that sensor, which is what I did.

This particular sensor uses a bucket catchment system where water is funneled  into a bucket, and when correct amount of water is present, it swings to one side, activates a reed switch sensor with a tiny built in magnet, then tips the water out.

Every time the bucket swings we can register one count.  For this particular unit, one count is equal to 0.8mm or 0.031 inches of rainfall. I worked this out simply by moving the tipping bucket back and forth and watching the rainfall measurement on the LCD screen increment by 0.08mm each time the sensor was activated. So there was no need for calculations to calibrate the sensor.


Circuit of the Digital Rain Gauge Project

The circuit in this project is very simple as I use an LCD shield and a single digital input. The only circuitry required is connecting the sensor to the digital input using a 10k pull up resistor. See the schematic below:


rain gauge circuit schematic



Programming the Arduino to Measure Rain Fall

In the coding we use the digital pin number 2 and set it up as an input.  We use a function called get_rainfall () that checks the sensor input and every time a high is registered, 0.8mm is added to the float variable called rainfall and the rainfall value on the LCD is updated.

You may also notice there is a 1000 millisecond delay in the main loop, this is introduced to allow the reed switch sensor to reset before the program checks the sensor again. This helps to prevent false readings.

See the code below:


#include <LiquidCrystal.h>

LiquidCrystal lcd(8,9,4,5,6,7);
float rainfall = 0;
int rain_sensor = 2;                //set rainsensor to pin 2

void setup() {
digitalWrite(rain_sensor, LOW);     //set pin 2 low
pinMode(rain_sensor, INPUT);        //set pin 2 as an input
lcd.print(“Total Rainfall”);
lcd.print(” mm”);

float get_rainfall()
 a:  if (digitalRead(rain_sensor) == HIGH)
           return 0.8;
 goto a;           

void loop() {
rainfall = rainfall + get_rainfall();
lcd.print(” mm”);
delay (1000);



How to make a Digital Rain Gauge Monitor | Summary

Connecting a rain gauge to your DIY weather station is quite a simple exercise. So next time it is raining in your area, you can use your weather station to measure rain fall. As a real life example, you could use it to see if there has been enough rain to water your garden.

I hope this tutorial has been useful to you.

If you liked it please share it with a Friend !

Subscribe Now !

Receive updates and new information straight to your inbox.