Davis Rain Gauge Arduino's code

Hello everyone, I’m a new member in this forum, and I’m also a newbie with arduino. I have done the registration because I need help with the tipping bucket rain gauge - Davis 6463. - https://www.davisnet.com/product_documents/weather/manuals/07395-295_IM_6463.pdf

Despite being a newbie, the vast applications of the Arduino have left me very excited. As a way to learn arduino features better, learn the programming techniques, and also because I love meteorology, I decided to start building a weather station.

Firstly, I’m picking the sensors and programming them on the Arduino. One of the sensors that I had chose was Davis 6463 (equal to the old Davis rain gauges, only the appearance has changed ). This sensor has an accuracy of 0.2mm.

I did lot of research on the internet, but i couldn’t find any schema with the wire conections that I need to do on the Arduino, the only thing that I have found was a part of the programation code, that only provides information about rain rate (mm/h).

How can I do the programming code to also get the accumulated rainfall in mm? And what are the connections that I need to do on the arduino?

This was the only part of the code that I have found, it provides information about the rain rate, I don’t know if this part is correct, because I couldn’t test it:

const byte interruptPin = 3;
const int interval = 500;
volatile unsigned long tiptime = millis();

void setup(){
Serial.begin(9600);

// Set up our digital pin as an interrupt
pinMode(interruptPin, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(interruptPin), count, FALLING);
}

void loop() {
}

void count() {
// Grab the current ms count for common calculations
unsigned long curtime = millis();

// Make sure we don’t record bounces
if ((curtime - tiptime) < interval) {
return;
}

// How long since the last tip?
unsigned long tipcount = curtime - tiptime;
tiptime = curtime;

// Calculate mm/hr from period between cup tips
double rainrate = 914400.0 / tipcount;

Serial.print("Cup tip: ");
Serial.print(tipcount);
Serial.println(“ms”);

Serial.print("Rain rate: ");
Serial.print(rainrate);
Serial.println(“mm/hr”);
}

Thanks for your time and your atention,
Kind regards,
Stratocumulus

The rain gauge is just a switch (a magnetically operated reed switch), which signals that a bucket tipped.

From the code it appears that you connect one of the leads to ground and the other to digital pin 3, which signals an interrupt when the bucket tips.

That is all, except the calibration may not be accurate, and the code may not even be intended for the gauge you have. Adjust the number in the following line so that your gauge reads the same (after a storm) as a calibrated gauge.

double rainrate = 914400.0 / tipcount; //mm/hr

Hi jremington. Thanks for the answer, and sorry by my ignorance;

But how do you get the correct number to replace in that part of the code? What do I have to determine?

This rain rauge doesn't need a conection to the pin of 5v or 3v?

What does each color represent? - The wire of this rain gauge has four colours, (yellow, green, red and black), I dont' know what they represent, and I suspect that the black wire is a dead wire, because, this wire only appears inside the cable. |500x375

And what I have to do on the code, to get the acumulated precipitation in mm?

Thanks one more time, sorry for bothering you.

Perhaps only two of the wires are being used. A switch needs only two, connected as I described above.

Trace the wires down internally to the switch, or use a multimeter, or a battery and a light bulb, to detect switch closure when the bucket tips. My first guess is green & yellow.

Are you sure that the pdf link in your post corresponds to rain gauge? If not you will need to find the correct one.

As for calibration, you will have to do a little math. If the rain gauge reads too high, reduce the number.