Go Down

Topic: Find sketch for rain sensor for seeduino (Read 5768 times) previous topic - next topic


For Seeduino.. Rain sensor...
someone has a sketch for this type of sensor? I also need algorithm to calculate the rate and amount of rainfall.




That device detects the presence of rain (or other water) but does not measure the rate or amount.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp


The en vogue way of measuring rainfall in commercial rain guages today seems to be 'count the drops' -- where you have a container that drips a known volume of liquid per drop.  With a warming device, this then also will work with snow.  These are nice because there are no moving parts.

Then there's the tip-bucket kind but that entails moving parts (which also can therefore become non-moving parts)

Thirdly, there's the use of a wheel linked to a rotary encoder and a having a number of small rain catchers (think ferris wheel) to make the wheel spin.

In any of these cases the commonly available 'groove opto coupler' sensor could be adapted easily to the task.

Example part:  http://www.electrodragon.com/?product=groove-opto-coupler-optical-sensor-for-arduino-speed-counting


I bought something similar to this, except it was just the board with the traces, and not the comparator board (search for 'water sensor' on ebay).  The auction listing had sample code, but it had some errors in it.  I fixed it up:

Code: [Select]
int analogPin = A1; // water sensor connected to the analog port 1
int led = 8; // LEd connected to digital pin 8
int val = 0; // definition variable val initial value as 0
int data = 0; // definition variable data initial value as 0

void setup ()
pinMode(led, OUTPUT); // definition led as output pin

void loop ()
val = analogRead(analogPin); // read the simulation value and send to variable val
if (val > 200) { // judgment variable val is whether more than 700 or not
digitalWrite(led, HIGH); // variable val greater than 200, LED on
else {
digitalWrite(led, LOW); // variable val less than 700, LED off
data = val; // variable val assignment to variable data
Serial.print("sensor = " );
Serial.print(data); // serial print variable data

Their 'greater than' value was originally 700, but my board doesn't go that high- I had a little accident and I shorted something out on it.   It still works, but he values are now a little lower.

I found that the board does actually seem to measure the amount of water that it's immersed in- the deeper it goes, the more the output value changes. 



I'll try and let you know the sketching ... john interessanto are also evolved to the type of rain gauge since it can also measure the snowfall .. you know how I can build or buy buy?

Thank you all for the help ..


hello 99er.

I'm testing the sketch you suggested, it actually works. but I question arises, (perhaps responded johnwasser) there is a method that the return values ??can be calculated speed or amount of rain in mm or volume of water '. I offer this question because they simply splashing water on the panel which has an area of:

* Control panel board Demintion: 30mm * 16mm
* Area of ??raindrop detection board 54mm * 40mm

I believe that with some algorithm or methodology, you can calculate different functions and not simply say that the rain is falling ...

Any idea? 've seen a few posts in some forums that can do for me?

Any help is greatly appreciated ... :-)

Go Up