Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. Rain Guage

Rain Guage

Scheduled Pinned Locked Moved My Project
128 Posts 23 Posters 110.3k Views 21 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • marceltrapmanM Offline
    marceltrapmanM Offline
    marceltrapman
    Mod
    wrote on last edited by
    #9

    @BulldogLowell Can't say much except: wow :)

    Fulltime Servoy Developer
    Parttime Moderator MySensors board

    I use Domoticz as controller for Z-Wave and MySensors (previously Indigo and OpenHAB).
    I have a FABtotum to print cases.

    1 Reply Last reply
    0
    • greglG Offline
      greglG Offline
      gregl
      Hero Member
      wrote on last edited by
      #10

      Wow...Impressed!
      Like Marcel..i thought why not just use weather service? but before i read your reply i already thought of the reason...fun!

      Whats more impressive..and just freaking awesome to be able to email a design file to someone...jump in the car and go and pickup a physical object!!

      How did you find the printer guy?

      BulldogLowellB 1 Reply Last reply
      0
      • greglG gregl

        Wow...Impressed!
        Like Marcel..i thought why not just use weather service? but before i read your reply i already thought of the reason...fun!

        Whats more impressive..and just freaking awesome to be able to email a design file to someone...jump in the car and go and pickup a physical object!!

        How did you find the printer guy?

        BulldogLowellB Offline
        BulldogLowellB Offline
        BulldogLowell
        Contest Winner
        wrote on last edited by BulldogLowell
        #11

        @gregl

        I used 3dhubs.com.

        They connect you with local folks who have the machines and want to make money with them. Really awesome,

        I had to quote a few before I found the right price, though.

        Check out the website, and put your location in. It will show you all of the local folks that do it.

        (Once I know that this works, I'll post the geometry or a link to it in case anyone wants to make one. I just want to make sure it works with he magnet first.)

        1 Reply Last reply
        0
        • marceltrapmanM Offline
          marceltrapmanM Offline
          marceltrapman
          Mod
          wrote on last edited by
          #12

          Thank you again!

          1. For the idea ( and when you think it is ready the files :)
          2. For the suggestion of 3dhubs.com I will certainly use it to make some money with my upcoming printer...

          Fulltime Servoy Developer
          Parttime Moderator MySensors board

          I use Domoticz as controller for Z-Wave and MySensors (previously Indigo and OpenHAB).
          I have a FABtotum to print cases.

          BulldogLowellB 1 Reply Last reply
          0
          • petewillP Offline
            petewillP Offline
            petewill
            Admin
            wrote on last edited by
            #13

            This is awesome! I was also wanting to do this. You beat me to it again (and I'm ok with that) :)

            I live in Colorado and we also have very localized rain. I would like a rain meter so I know when and how often I need to irrigate. I was also thinking it would be useful to use VeraAlerts to announce if a window is open and it's raining.

            How much rain water does it take to tip? From the video it seems like it would need quite a bit to tip. Would it be good to make the buckets(?) a little smaller so it would be more precise? Keep in mind I have no idea how big it is or how these things work in general so I could be way off with the question.

            Great job though! Keep up the great work.

            My "How To" home automation video channel: https://www.youtube.com/channel/UCq_Evyh5PQALx4m4CQuxqkA

            BulldogLowellB 1 Reply Last reply
            0
            • petewillP petewill

              This is awesome! I was also wanting to do this. You beat me to it again (and I'm ok with that) :)

              I live in Colorado and we also have very localized rain. I would like a rain meter so I know when and how often I need to irrigate. I was also thinking it would be useful to use VeraAlerts to announce if a window is open and it's raining.

              How much rain water does it take to tip? From the video it seems like it would need quite a bit to tip. Would it be good to make the buckets(?) a little smaller so it would be more precise? Keep in mind I have no idea how big it is or how these things work in general so I could be way off with the question.

              Great job though! Keep up the great work.

              BulldogLowellB Offline
              BulldogLowellB Offline
              BulldogLowell
              Contest Winner
              wrote on last edited by BulldogLowell
              #14

              @petewill said:

              This is awesome! I was also wanting to do this. You beat me to it again (and I'm ok with that) :)

              I live in Colorado and we also have very localized rain. I would like a rain meter so I know when and how often I need to irrigate. I was also thinking it would be useful to use VeraAlerts to announce if a window is open and it's raining.

              How much rain water does it take to tip? From the video it seems like it would need quite a bit to tip. Would it be good to make the buckets(?) a little smaller so it would be more precise? Keep in mind I have no idea how big it is or how these things work in general so I could be way off with the question.

              Great job though! Keep up the great work.

              I designed it to about 8ml, I have to calibrate it because of the meniscus, which looks substantial. I can tweak it by raising/lowing the allen cap screws.

              there are 25 cubic inches of water per inch of rain in an 8in gauge. So considering that there are 16.38ml per cubic inch, that gets us to approx 50 tips per inch of rain or 0.02in (0.5mm) resolution. I believe for me that's OK, particularly here i s SoFla where we get a lot of rain.

              I see your point regarding precision but you can easily go smaller. I wonder if I can make a funnel that will actually drop the water to the bottom if we only received 0.5mm of rain. I'll have to apply something to the funnel to lower the surface tension of the droplets, I think. The other consideration is offsetting the mass of the magnet, which is small but dense.

              So unless you get enough water to fall down and tip it, it won't likely record less than say 1mm of rain.

              BulldogLowellB 1 Reply Last reply
              0
              • BulldogLowellB BulldogLowell

                @petewill said:

                This is awesome! I was also wanting to do this. You beat me to it again (and I'm ok with that) :)

                I live in Colorado and we also have very localized rain. I would like a rain meter so I know when and how often I need to irrigate. I was also thinking it would be useful to use VeraAlerts to announce if a window is open and it's raining.

                How much rain water does it take to tip? From the video it seems like it would need quite a bit to tip. Would it be good to make the buckets(?) a little smaller so it would be more precise? Keep in mind I have no idea how big it is or how these things work in general so I could be way off with the question.

                Great job though! Keep up the great work.

                I designed it to about 8ml, I have to calibrate it because of the meniscus, which looks substantial. I can tweak it by raising/lowing the allen cap screws.

                there are 25 cubic inches of water per inch of rain in an 8in gauge. So considering that there are 16.38ml per cubic inch, that gets us to approx 50 tips per inch of rain or 0.02in (0.5mm) resolution. I believe for me that's OK, particularly here i s SoFla where we get a lot of rain.

                I see your point regarding precision but you can easily go smaller. I wonder if I can make a funnel that will actually drop the water to the bottom if we only received 0.5mm of rain. I'll have to apply something to the funnel to lower the surface tension of the droplets, I think. The other consideration is offsetting the mass of the magnet, which is small but dense.

                So unless you get enough water to fall down and tip it, it won't likely record less than say 1mm of rain.

                BulldogLowellB Offline
                BulldogLowellB Offline
                BulldogLowell
                Contest Winner
                wrote on last edited by
                #15

                @BulldogLowell

                Neodymium magnet in and works fine. I had to clean out the countersink hole with a drill to get it in and used E6000 glue to hold it.

                Now onto the hall effect sensor, wiring it up and of course the sketch.

                The 123D Design file is also attached if anyone wants to make one, play with the design, make fun of it, etc. The .stl file is 13Mb, I can email that if you want.

                If you want a print, let me know. I also have a few magnets and sensors, so I can send what you need for the project.

                I think I'm going to design a housing for the electronics too. I'm not sure I can find the right project box for this (I really just want to print more parts :)

                Screen Shot 2014-06-06 at 2.43.36 PM.png

                TippingBucket.123dx

                marceltrapmanM N 2 Replies Last reply
                0
                • hekH Offline
                  hekH Offline
                  hek
                  Admin
                  wrote on last edited by
                  #16

                  Isn't it enough space in the foot for the electronics?
                  Or perhaps make foot a little bigger in v2.0 to fit it there ;)

                  BulldogLowellB 1 Reply Last reply
                  0
                  • hekH hek

                    Isn't it enough space in the foot for the electronics?
                    Or perhaps make foot a little bigger in v2.0 to fit it there ;)

                    BulldogLowellB Offline
                    BulldogLowellB Offline
                    BulldogLowell
                    Contest Winner
                    wrote on last edited by
                    #17

                    @hek

                    right!

                    While I want to keep the height low, I can modify the foot to include the whole of the electronica for sure. a radius of 4in provides a nice area for a lot of stuff.

                    plus, I was thinking about having the antenna at the bottom of the device...

                    good idea, thanks! It is better that we know that the tipping bucket will work (volumetrically) at this point.

                    time to get onto the rest of the physical design, I guess.

                    1 Reply Last reply
                    0
                    • marceltrapmanM marceltrapman

                      Thank you again!

                      1. For the idea ( and when you think it is ready the files :)
                      2. For the suggestion of 3dhubs.com I will certainly use it to make some money with my upcoming printer...
                      BulldogLowellB Offline
                      BulldogLowellB Offline
                      BulldogLowell
                      Contest Winner
                      wrote on last edited by
                      #18

                      @marceltrapman said:

                      1. For the suggestion of 3dhubs.com I will certainly use it to make some money with my upcoming printer...

                      Don't forget my "one free part referral" fee!!!

                      1 Reply Last reply
                      0
                      • BulldogLowellB BulldogLowell

                        @BulldogLowell

                        Neodymium magnet in and works fine. I had to clean out the countersink hole with a drill to get it in and used E6000 glue to hold it.

                        Now onto the hall effect sensor, wiring it up and of course the sketch.

                        The 123D Design file is also attached if anyone wants to make one, play with the design, make fun of it, etc. The .stl file is 13Mb, I can email that if you want.

                        If you want a print, let me know. I also have a few magnets and sensors, so I can send what you need for the project.

                        I think I'm going to design a housing for the electronics too. I'm not sure I can find the right project box for this (I really just want to print more parts :)

                        Screen Shot 2014-06-06 at 2.43.36 PM.png

                        TippingBucket.123dx

                        marceltrapmanM Offline
                        marceltrapmanM Offline
                        marceltrapman
                        Mod
                        wrote on last edited by
                        #19

                        @BulldogLowell I have read about techniques to include the magnet while printing.
                        You can do that by designing a hole, stop the printer when the hole is about to be covered, insert the magnet and continue printing.

                        I will think about you once the printer is there (a couple of months from now)...

                        Fulltime Servoy Developer
                        Parttime Moderator MySensors board

                        I use Domoticz as controller for Z-Wave and MySensors (previously Indigo and OpenHAB).
                        I have a FABtotum to print cases.

                        BulldogLowellB 1 Reply Last reply
                        0
                        • marceltrapmanM marceltrapman

                          @BulldogLowell I have read about techniques to include the magnet while printing.
                          You can do that by designing a hole, stop the printer when the hole is about to be covered, insert the magnet and continue printing.

                          I will think about you once the printer is there (a couple of months from now)...

                          BulldogLowellB Offline
                          BulldogLowellB Offline
                          BulldogLowell
                          Contest Winner
                          wrote on last edited by BulldogLowell
                          #20

                          So, I managed to finish a sketch for the Rain Gauge.

                          It creates two devices:

                          1. an information panel that displays last 24hours rain and the current rate of rain. along with 5 buckets of time so that you may see up to 5 days total rainfall.
                            It stores 24, 48, 72, 96 and 120 hrs rain in the Variable1-Variable5 respectively.
                            I customized the Rain Sensor to look more like a rain sensor and be more descriptive on the front panel, using the image from the moisture sensor, which I thought looked better.
                          2. a binary sensor that you can set. Put in the hours you wish to evaluate (1-120) and the rainfall you desire to trip the device. They are entered as Variable1 and Variable 2.

                          images attached, take a look and comments are appreciated.

                          I would like to do more with the presentation of the sensors on the vera UI... I'll do that after I get this all together, if I can.

                          Screen Shot 2014-06-10 at 6.52.40 PM.png

                          Screen Shot 2014-06-10 at 6.51.41 PM.png

                          Screen Shot 2014-06-10 at 6.52.09 PM.png

                          Screen Shot 2014-06-10 at 6.52.09 PM.png

                          Screen Shot 2014-06-10 at 6.52.24 PM.png

                          1 Reply Last reply
                          0
                          • FrancoisF Offline
                            FrancoisF Offline
                            Francois
                            wrote on last edited by
                            #21

                            @BulldogLowell I also busy building an rain gauge. How is your one performing? Now did you set this up in the arduino? How did you do the calculation?

                            Regards

                            Francois

                            BulldogLowellB 1 Reply Last reply
                            0
                            • FrancoisF Francois

                              @BulldogLowell I also busy building an rain gauge. How is your one performing? Now did you set this up in the arduino? How did you do the calculation?

                              Regards

                              Francois

                              BulldogLowellB Offline
                              BulldogLowellB Offline
                              BulldogLowell
                              Contest Winner
                              wrote on last edited by
                              #22

                              @Francois

                              yes is working still, I mentioned how I did the math above...

                              1 Reply Last reply
                              1
                              • FrancoisF Offline
                                FrancoisF Offline
                                Francois
                                wrote on last edited by Francois
                                #23

                                @BulldogLowell do you mind sharing the sketch I not seeing in this forum or on the Build pages of MySensor.org

                                BulldogLowellB 1 Reply Last reply
                                0
                                • FrancoisF Francois

                                  @BulldogLowell do you mind sharing the sketch I not seeing in this forum or on the Build pages of MySensor.org

                                  BulldogLowellB Offline
                                  BulldogLowellB Offline
                                  BulldogLowell
                                  Contest Winner
                                  wrote on last edited by
                                  #24

                                  @Francois

                                  Sure, but I have that running at my 'other' house and it is on older version of MySensors (haven't upgraded there yet ;)

                                  I'll take a whack at updating if you like... it needs to get done anyway... here it is:

                                  /*
                                   Arduino Tipping Bucket Rain Gauge
                                   
                                   June 15, 2014
                                   
                                   Version 1.00b   
                                   
                                   Arduino Tipping Bucket Rain Gauge
                                   
                                   Utilizing a tipping bucket sensor, your Vera home automation controller and the MySensors.org 
                                   gateway you can measure and sense local rain.  This sketch will create two devices on your 
                                   Vera controller.  One will display your total precipitation for the last 24, 48, 72, 96 and 120
                                   hours.  The other, a sensor that changes state if there is recent rain (up to last 120 hours) 
                                   above a threshold.  Both these settings are user definable. 
                                   
                                   This sketch features the following:
                                   
                                   * Allows you to set the rain threshold in mm  
                                   * Allows you to determine the interval window up to 120 hours.
                                   * Displays the last 24, 48, 72, 96 and 120 hours total rain in Variable1 through Variable5
                                     of the Rain Sensor device
                                   * Configuration changes to Sensor device updated every 3 hours.
                                   * SHould run on any Arduino
                                   * Will retain Tripped/Not Tripped status and data in a power outage, saving small ammount
                                     of data to EEPROM (Circular Buffer to maximize life of EEBPROM
                                   * There is a unique setup requirement necessary in order to properly present the Vera device 
                                     variables.  The details are outlined in the sketch below.
                                   * LED status indicator
                                   
                                   by BulldogLowell@gmail.com for free public use
                                   
                                   */
                                  #include <SPI.h>
                                  #include <EEPROM.h>  
                                  #include <RF24.h>
                                  #include <Sensor.h>
                                  //
                                  #define STATE_LOCATION 513 // stay away from EEPROM used with Sensor.h
                                  #define EEPROM_BUFFER 514  // location of the EEPROM circular buffer
                                  #define BUFFER_LENGTH 121
                                  //
                                  Sensor gw;
                                  boolean metric = false;
                                  //
                                  int eepromIndex;
                                  int tipSensorPin = 3;
                                  int ledPin = 5; //PWM capable required
                                  unsigned long dataMillis;
                                  unsigned long serialInterval = 10000UL;
                                  const unsigned long oneHour = 60000UL;
                                  unsigned long lastTipTime;
                                  unsigned long lastBucketInterval;
                                  unsigned long startMillis;
                                  int dayBuckets [5] [2] = {
                                   { V_VAR1, 24 },
                                   { V_VAR2, 48 },
                                   { V_VAR3, 72 },
                                   { V_VAR4, 96 },
                                   { V_VAR5, 120},
                                   };
                                  volatile byte rainBucket [120] ; // 5 days of data
                                  const unsigned long calibrateFactor = 1UL; //Calibration in milimeters of rain per single tip
                                  unsigned long rainRate = 0;
                                  float currentRain = 0;
                                  boolean wasTipped = false;
                                  boolean updateVera;
                                  int rainCount;
                                  volatile int tipBuffer = 0;
                                  byte rainWindow = 72;//default rain window in hours
                                  int rainSensorThreshold = 15;//default rain sensor sensitivity in mm
                                  byte hourCount = 24;
                                  byte state;
                                  byte oldState = -1;
                                  unsigned long ledPulseTime = 500UL;
                                  unsigned long pulseStart;
                                  //
                                  void setup()  
                                  { 
                                    Serial.begin(115200);
                                    gw.begin();
                                    //
                                    pinMode(tipSensorPin, OUTPUT);
                                    attachInterrupt (1, sensorTipped, CHANGE);
                                    pinMode(ledPin, OUTPUT);
                                    digitalWrite(ledPin, HIGH);
                                    gw.sendSketchInfo("Rain Guage", "1.00b"); 
                                    gw.sendSensorPresentation(1, S_RAIN);
                                    gw.sendSensorPresentation(2, S_MOTION);
                                    Serial.println(F("Sensor Presentation Complete"));
                                    pinMode(tipSensorPin, INPUT);
                                    //
                                    state = EEPROM.read(STATE_LOCATION);
                                    for (int i = 0; i < BUFFER_LENGTH; i++)
                                    {
                                      byte locator = EEPROM.read(EEPROM_BUFFER + i);
                                      if (locator == 0xFF)
                                      {
                                        eepromIndex = EEPROM_BUFFER + i;
                                        loadRainArray(eepromIndex);
                                        Serial.println(eepromIndex);
                                        break;
                                      }
                                    }
                                    //
                                    gw.sendVariable(2, V_TRIPPED, state);
                                    dataMillis = millis();
                                    startMillis = millis();
                                    lastTipTime = millis() - oneHour;
                                    // uncomment the following block the first time you include this device.  The delays
                                    // are necessary in order to create the five Variable buckets in the correct order.
                                    // Once you create them, you can comment out these lines and re-upload to your arduino
                                    //------------------------------------------------------
                                    /*
                                    for (int j = 0; j < 5; j++)
                                     {
                                     delay(2000);
                                     gw.sendVariable(1, dayBuckets[j] [0], 1);
                                     }
                                     delay(2000);
                                     gw.sendVariable(2,V_VAR1, 1);
                                     delay(2000);
                                     gw.sendVariable(2,V_VAR2, 1);
                                     */
                                    //------------------------------------------------------  
                                    rainWindow = atoi(gw.getStatus(2, V_VAR1));
                                    delay(2000);
                                    rainSensorThreshold = atoi(gw.getStatus(2, V_VAR2));
                                    gw.sendVariable(1, V_RAINRATE, 0);
                                    Serial.print(F("Radio Done"));  
                                    analogWrite(ledPin, 20);
                                  }
                                  //
                                  void loop()     
                                  { 
                                    unsigned long measure = 0; // Check to see if we need to show sensor tripped in this block
                                    for (int i = 0; i < rainWindow; i++)
                                    {
                                      measure = measure + rainBucket [i];
                                    }
                                    measure >= rainSensorThreshold ? state = 1: state = 0;
                                    if (millis() - pulseStart < ledPulseTime)
                                    {
                                      analogWrite(ledPin, 255);
                                    }
                                    else 
                                    {
                                      analogWrite(ledPin, 20);
                                    }
                                    if (state != oldState)
                                    {
                                      gw.sendVariable(2, V_TRIPPED, state);
                                      EEPROM.write(STATE_LOCATION, state);
                                      oldState = state;
                                    }
                                    //
                                    if (millis() - lastTipTime >= oneHour)// timeout for rain rate
                                    {
                                      if (rainRate != 0)
                                      {
                                        rainRate = 0;
                                        gw.sendVariable(1, V_RAINRATE, rainRate);
                                      }
                                    }
                                    if (updateVera)
                                    {
                                      gw.sendVariable(1, V_RAINRATE, rainRate);
                                      updateVera = false;
                                    }
                                    //
                                    if ( (millis() - dataMillis) >= serialInterval)//Comment back in this block to enable Serial prints
                                    {
                                      for (int i = 24; i <= 120; i=i+24)
                                      {
                                        updateSerialData(i);
                                      }
                                      dataMillis = millis();
                                    }
                                    //
                                    if (tipBuffer > 0)
                                    {
                                      Serial.println(F("Sensor Tipped"));
                                      rainBucket [0] ++;
                                      pulseStart = millis();
                                      if (rainBucket [0] > 253) rainBucket[0] = 253; // odd occurance but prevent overflow
                                      int dayTotal = 0;
                                      for (int i = 0; i < 24; i++)
                                      {
                                        dayTotal = dayTotal + rainBucket [i];
                                      }
                                      gw.sendVariable(1, V_RAIN, dayTotal);
                                      unsigned long tipDelay = millis() - lastTipTime;
                                      if (tipDelay <= oneHour) 
                                      {
                                        rainRate = ((oneHour) / tipDelay);
                                        gw.sendVariable(1, V_RAINRATE, rainRate);
                                        Serial.print(F("RainRate= "));
                                        Serial.println(rainRate);
                                      }
                                      lastTipTime = millis();
                                      updateVera = true;
                                      tipBuffer--;
                                    }
                                    if ( (millis()- startMillis) >= oneHour)
                                    {
                                      Serial.println("one hour elapsed");
                                      //EEPROM write last value
                                      EEPROM.write(eepromIndex, rainBucket[0]);
                                      eepromIndex++;
                                      if (eepromIndex > EEPROM_BUFFER + BUFFER_LENGTH) eepromIndex = EEPROM_BUFFER;
                                      Serial.println(eepromIndex);
                                      EEPROM.write(eepromIndex, 0xFF);
                                      //
                                      for (int i = BUFFER_LENGTH - 1; i >= 0; i--)//cascade an hour of values
                                      {
                                        rainBucket [i + 1] = rainBucket [i];
                                      }
                                      rainBucket[0] = 0;
                                      gw.sendVariable(1, V_RAIN, tipCounter(24));// send 24hr tips
                                      startMillis = millis();
                                      for (int j = 0; j < 5; j++)
                                      {
                                        int total = 0;
                                        for (int i = 0; i < dayBuckets[j][1]; i++)
                                        {
                                          total = total + rainBucket [i];
                                        }
                                        gw.sendVariable( 1, dayBuckets[j] [0], total);
                                      }
                                      hourCount++;
                                      if (hourCount >=3)//8 times daily update the Sensor variables
                                      {
                                        rainWindow = atoi(gw.getStatus(2, V_VAR1));
                                        if (rainWindow < 6) 
                                        {
                                          rainWindow = 6;
                                          gw.sendVariable( 2, V_VAR1, rainWindow);
                                        }
                                        if (rainWindow > 120) 
                                        {
                                          rainWindow = 120;
                                          gw.sendVariable( 2, V_VAR2, rainWindow);
                                        }
                                        rainSensorThreshold = atoi(gw.getStatus(2, V_VAR2));
                                        delay(2000);
                                        //
                                        if (rainSensorThreshold < 1) 
                                        {
                                          rainSensorThreshold = 1;
                                          gw.sendVariable( 2, V_VAR2, rainSensorThreshold);
                                        }
                                        if (rainSensorThreshold > 1000) 
                                        {
                                          rainSensorThreshold = 1000;
                                          gw.sendVariable( 2, V_VAR2, rainSensorThreshold);
                                        }
                                        //
                                        hourCount = 0;
                                      }
                                    }
                                  }
                                  //
                                  void sensorTipped()
                                  {
                                    static unsigned long last_interrupt_time = 0;
                                    unsigned long interrupt_time = millis();
                                    if (interrupt_time - last_interrupt_time > 200)
                                    {
                                      tipBuffer++;
                                    }
                                    last_interrupt_time = interrupt_time;
                                  }
                                  //
                                  unsigned long tipCounter(int x)
                                  {
                                    int tipCount = 0;
                                    for ( int i = 0; i < x; i++)
                                    {
                                      tipCount = tipCount + rainBucket [i];
                                    }
                                    return tipCount;
                                  }
                                  //
                                  void updateSerialData(int x)
                                  {
                                    Serial.print(F("Tips last "));
                                    Serial.print(x);
                                    Serial.print(F("hours: "));
                                    int tipCount = 0;
                                    for (int i = 0; i < x; i++)
                                    {
                                      tipCount = tipCount + rainBucket [i];
                                    }
                                    Serial.println(tipCount);
                                  }
                                  void loadRainArray(int value)
                                  {
                                    for (int i = 0; i < BUFFER_LENGTH - 1; i++)
                                     {
                                       value--;
                                       Serial.println(value);
                                       if (value < EEPROM_BUFFER) 
                                         {
                                           value = EEPROM_BUFFER + BUFFER_LENGTH;
                                         }
                                       byte rainValue = EEPROM.read(value);
                                       Serial.println(rainValue);
                                       if (rainValue < 255)
                                       {
                                         rainBucket[i] = rainValue;
                                       }
                                       else
                                       {
                                         rainBucket [i] = 0;
                                       }
                                     }
                                  }
                                  
                                  1 Reply Last reply
                                  1
                                  • T Offline
                                    T Offline
                                    tomrask
                                    wrote on last edited by
                                    #25

                                    Hey Francois

                                    Thanks for a nice projekt. I am thinking on building one myself. But is it possible to log the rain for everyday and writing the data to a csv file so I can use the data in Excel on Windows.

                                    Hope that you can help my.

                                    Tom

                                    BulldogLowellB 1 Reply Last reply
                                    0
                                    • T tomrask

                                      Hey Francois

                                      Thanks for a nice projekt. I am thinking on building one myself. But is it possible to log the rain for everyday and writing the data to a csv file so I can use the data in Excel on Windows.

                                      Hope that you can help my.

                                      Tom

                                      BulldogLowellB Offline
                                      BulldogLowellB Offline
                                      BulldogLowell
                                      Contest Winner
                                      wrote on last edited by
                                      #26

                                      @tomrask

                                      Tom,

                                      Are you wishing to

                                      1. log to an SD card
                                      2. collect data controller side (e.g. Vera or other controller)
                                      3. transmit data directly to a server
                                      4. something else....?
                                      1 Reply Last reply
                                      0
                                      • BulldogLowellB Offline
                                        BulldogLowellB Offline
                                        BulldogLowell
                                        Contest Winner
                                        wrote on last edited by
                                        #27

                                        @BulldogLowell said:

                                        #define STATE_LOCATION 513 // stay away from EEPROM used with Sensor.h
                                        #define EEPROM_BUFFER 514  // location of the EEPROM circular buffer
                                        #define BUFFER_LENGTH 121
                                        

                                        @hek

                                        are we still required to steer clear of MySensor's EEPROM in addresses 0-512?

                                        hekH 1 Reply Last reply
                                        0
                                        • T Offline
                                          T Offline
                                          tomrask
                                          wrote on last edited by
                                          #28

                                          I use a vera light with a USB key where the data can be stored. It vill be better if I the date was on my dropbox og sendt to my NAS.

                                          But I have not fount a way to do it.

                                          Tom

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          8

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.1k

                                          Posts


                                          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular