Using an Arduino with a Tipping Bucket Rain Gauge

Поделиться
HTML-код
  • Опубликовано: 27 окт 2018
  • I create all this content for the greater good with everything licensed under Creative Commons. At the same time your support is genuinely appreciated- tips are welcome via this link:
    www.buymeacoffee.com/mmaker
    NOTE: Update posted 1/8/2020: • Argent Weather Station... (start at minute 14:31)
    UPDATE 2/18/2020:
    --- At minute 7:20, I revisited this code based on correspondence with Argent Data Systems and a review of libraries prepared for their hardware. If I set the debounce constant to 15, and then multiply it by 1000 on line 56 of the code, this eliminates the problematic bounce demonstrated at 7:35. With this edit, the code does execute successfully with the bounce filtered out. In response, I updated the sketch "weatherStationMod3_g" available on www.modestmaker.com/arduino/pa... under "Chapter 9" with these edits.
    --- The successful code modification and tests suggests I can use a reed switch in a tipping bucket rain gage coupled with an Arduino without needing to incorporate an RC circuit and a Schmidt trigger, or replacing the reed switch with a Hall Effect Sensor. However, these alternatives are mechanically and electrically sound while simplifying the code.
    --- At minute 8:29, I incorrectly stated: "Interrupts.... generally should not be used with timers that take more than a microsecond to execute". That is incorrect - I should have stated "millisecond" rather than "microsecond".
    -- At minute 8:55, I incorrectly state there is a delay in my interrupt function. This is incorrect - there is no delay in the interrupt function shared in my code.
    In this video, I reverse engineer how tipping bucket rain gages work, and then demonstrate how to integrate an Arduino for counting tips, which can then be translated to rainfall depth. I then demonstrate software and hardware remedies for filtering out bounce noise associated with the reed switch used in these instruments. UPDATE: Please see January 1, 2020 correction posted in comments section.
    Schmitt trigger used in this demonstration available here: www.digikey.com/product-detai...
    Images used for gauge explanation came from these links: www.researchgate.net/figure/W...
    and
    www.explainthatstuff.com/howr...
    Details on assembly your own gauge available here (wireless component not necessary):
    www.allaboutcircuits.com/proj...
    Code uploaded here:
    modestmaker.com/arduino/part2...
  • НаукаНаука

Комментарии • 53

  • @automationtechnologyclub
    @automationtechnologyclub 3 года назад +5

    Very nice, I came to just find out if a rain gauge could be used with an Arduino - I actually learned more than I thought I would. thank you

    • @ModestMaker
      @ModestMaker  3 года назад +1

      Wonderful - glad it helped! I'm still learning myself - I've posted an update here: ruclips.net/video/KHrTqdmYoAk/видео.html

  • @sebakiller9736
    @sebakiller9736 2 года назад

    Wow amazing Informations and cool Video

  • @m.ar.es.4358
    @m.ar.es.4358 2 года назад

    Hi ModestMaker, great video and explanation!
    Hope you can clarify one question I've got. At 8:09 you said that you found out that it [fixing bouncetime to calibrate 1 count / tip] was not a stable solution over longer periods of time. How did you found out? Over which timespan? Many thanks!

    • @ModestMaker
      @ModestMaker  2 года назад

      I tested this approach over the course of just a few minutes using different delays, and it eventually compounded tips regardless of the constant. I subsequently learned that delays of more than a few microseconds in an interrupt function is just not a good idea.

  • @MrBobWareham
    @MrBobWareham 5 лет назад

    With no disrespect, I would use a Hall Effect Magnetic Sensor Module as it has debounced built-in so that would solve all your problems and be very reliable as there are no moving parts but you will need three wires and if it is a long way away you could get voltage drop on the cable but I used one for a security switch circuit that worked very well, Love your channel have joined as you are covering the current sensor INA219 that I want to use to monitor current in a colloidal silver generator I want to make, Thanks Bob in the UK

    • @ModestMaker
      @ModestMaker  5 лет назад

      Thanks Bob. I am in total agreement. I was not familiar with Hall Effect sensors until after I posted this video and have since picked up a few on eBay. These old rain gauges can be easily hacked for the same, and I hope to post an update shortly. I am a little distracted these days with my kids who've asked me to build stuff for them instead of work ;) Cheers!

    • @ModestMaker
      @ModestMaker  4 года назад

      Update posted with Hall effect sensor demo: 1/8/2020: ruclips.net/video/KHrTqdmYoAk/видео.html

  • @StuffUCanMake
    @StuffUCanMake 5 лет назад

    Awesome stuff! I subscribe.

  • @rongeernaert1208
    @rongeernaert1208 3 года назад

    Thanks interesting lesson, and can I use a Hall sensor with magnet on a Arduino pin 3 ?

    • @ModestMaker
      @ModestMaker  3 года назад +1

      Yes. This is explained /demonstrated in subsequent tests, cued here: ruclips.net/video/KHrTqdmYoAk/видео.html

  • @eduardoibarraarcos7455
    @eduardoibarraarcos7455 2 года назад

    Hi, great job you do. I like to ask you what happen in the 13:48 minute? why can not see the counts 10, 12, and 15? in the quick and rapid move

    • @ModestMaker
      @ModestMaker  2 года назад +1

      I suspect the baud rate on the serial terminal couldn’t keep up with the action, but I closely monitored the total count and can confirm it was correct.

  • @disenojas
    @disenojas Год назад

    Hi! Thank you soo mucho for this video. Step-by-Step guide, have it?

    • @ModestMaker
      @ModestMaker  Год назад

      Unfortunately not for rain gages, but I do have this which contains some background on microcontrollers and environmental monitoring in general - see description of video: ruclips.net/video/jEO_OjcrRfM/видео.html

  • @ModestMaker
    @ModestMaker  4 года назад +2

    UPDATE 2/18/2020:
    --- At minute 7:20, I revisited this code based on correspondence with Argent Data Systems and a review of libraries prepared for their hardware. If I set the debounce constant to 15, and then multiply it by 1000 on line 56 of the code, this eliminates the problematic bounce demonstrated at 7:35. With this edit, the code does execute successfully with the bounce filtered out. In response, I updated the sketch "weatherStationMod3_g" available on www.biod101.com/arduino/part2.html under "Chapter 9" with these edits.
    --- The successful code modification and tests suggests I can use a reed switch in a tipping bucket rain gage coupled with an Arduino without needing to incorporate an RC circuit and a Schmidt trigger, or replacing the reed switch with a Hall Effect Sensor. However, these alternatives are mechanically and electrically sound while simplifying the code.
    --- At minute 8:29, I incorrectly stated: "Interrupts.... generally should not be used with timers that take more than a microsecond to execute". That is incorrect - I should have stated "millisecond" rather than "microsecond".
    -- At minute 8:55, I incorrectly state there is a delay in my interrupt function. This is incorrect - there is no delay in the interrupt function shared in my code.
    Field tests have not yet been conducted. Thanks for your patience as I become better acauainted with these instruments and electronics.

    • @EL34XYZ
      @EL34XYZ 2 года назад

      Thanks for the info. I have a 20+ year old Dallas One Wire weather system that I am converting to Arduino. I have a tip bucket rain gauge and I was not sure how to integrate it into Arduino. I gave up on Dallas One wire sensors and went with Adafruit BME280 for Temp, Humidity and Barometer on a I2C bus. Very simple and works great. I added a Ethernet shield onto a Arduino Mega 2560. It records the weather sensor data to the SD card on the shield. I can read the data file over my network. The last sensor to add is the rain gauge.

    • @ModestMaker
      @ModestMaker  2 года назад +1

      Sounds great! Hope it works out. If you deal with heavy rains, make sure to check out the accuracy check on these tipping buckets. ruclips.net/video/iR331RDdPW4/видео.html . I will be experimenting with a strain gage shortly to measure weight as an alternative. I just need to figure out how to empty the gage between storms.

  • @user-nm8bv8zp4o
    @user-nm8bv8zp4o 5 месяцев назад

    The Schmidt trigger used in the demonstration is out of stock on Digikey, is there a reasonable alternative?

    • @ModestMaker
      @ModestMaker  5 месяцев назад

      I have some in stock I can drop off at SRO (assuming this is Jason Elliot), but you might try a Hall effect sensor as a simpler alternative.

  • @benzi2353
    @benzi2353 3 года назад

    There is a solution to debounce with the microcontroller.
    You just have to wake up the µC with the Interrupt. Then perform the debounce in the loop() function. After that you can go to sleep again.
    Using this way you have a much easier and cheaper setup.

    • @ModestMaker
      @ModestMaker  3 года назад

      Thanks - if you have some code you might share, I'd be glad to test it and post.

    • @benzi2353
      @benzi2353 3 года назад

      @@ModestMaker I can send you an example, how can I contact you?

    • @ModestMaker
      @ModestMaker  3 года назад

      The code should be relatively short - can you post it as a comment?

    • @benzi2353
      @benzi2353 3 года назад

      This should work (not tested)
      #define RAIN_PIN 2 // interrupt pin
      #define DEBOUNCE_TIME 15 // time * 1000 in microseconds required to get through bounce noise
      unsigned long timer;
      volatile unsigned int rainTrigger = 0;
      volatile unsigned long lastTrigger = 0;
      volatile bool stateChanged = false;
      void setup() {
      Serial.begin(9600);
      attachInterrupt(digitalPinToInterrupt(RAIN_PIN), countingRain, RISING);
      pinMode(RAIN_PIN, INPUT);
      nextCalc = millis() + CALC_INTERVAL;
      }
      void loop() {
      timer = millis();
      if(stateChanged)
      {
      bool Value = digitalRead(RAIN_PIN);
      if(!Value)
      {
      stateChanged = false;
      }
      else if((timer-lastTrigger)>=DEBOUNCE_TIME
      {
      rainTrigger += 1;
      stateChanged = false;
      Serial.print("Total Tips: ");
      Serial.println(rainTrigger);
      }
      }
      }
      void countingRain() {
      lastTrigger = millis();
      stateChanged = true;
      }

    • @benzi2353
      @benzi2353 3 года назад

      But I would recommend you to send the microcontroller into deep sleep. Then you could easily run this on battery.
      One more hint: The debouncing you used (and the one I did too) is not a true debouncing. It debounces only the rising edge and not the falling edge. For this use case this should not be a problem but for others it might be.
      Where did you get the tipping bucket from?

  • @sandikodev
    @sandikodev 3 года назад

    please increase the volume speaker...
    nice explanation, thanks

  • @brianh21858
    @brianh21858 Год назад

    How do you calibrate the rain fall in relation to the area of the collection bucket surface area?

    • @ModestMaker
      @ModestMaker  Год назад +1

      Great question! I cover the calculations and accuracy checks in this video, which I've cued of your convenience: ruclips.net/video/iR331RDdPW4/видео.html

    • @brianh21858
      @brianh21858 Год назад +1

      @@ModestMaker well done, thanks very much

  • @NITAGRIAJITHREDDYG
    @NITAGRIAJITHREDDYG 10 месяцев назад

    Can u please explain,How was the arduino protected from rain in the field?

    • @ModestMaker
      @ModestMaker  10 месяцев назад

      Usually, just by embedding my electronics in a weather proof enclosure - like this one ;) ruclips.net/video/93ipPhr7QtQ/видео.htmlsi=hM7NnXB3yc_QcpZL&t=1. Advance to minute 17:50 for more about the enclosure.

  • @AminYahya.
    @AminYahya. 2 года назад

    hey is there any way that i can contact you ask you about this project because i need help for my final year project

    • @ModestMaker
      @ModestMaker  2 года назад

      I have an update to this video you might check out here:ruclips.net/video/KHrTqdmYoAk/видео.html

  • @benzi2353
    @benzi2353 3 года назад

    Where do you get this rain bucket?

    • @ModestMaker
      @ModestMaker  3 года назад

      it was borrowed from work. I think you can find these on eBay occasionally.

  • @muhamadfairulizwanbmatzain2103
    @muhamadfairulizwanbmatzain2103 4 года назад

    Hi sir, have u finished his project?

    • @ModestMaker
      @ModestMaker  4 года назад

      I'll attached it to an REM shortly - have been working on a remote air quality monitor that I can attach to my bike, so it has had me a little distracted ;)

    • @ModestMaker
      @ModestMaker  4 года назад

      Just finished the latest post: ruclips.net/video/jaRye_8i2q8/видео.html; will come back to this next.

  • @mohamadhakim9907
    @mohamadhakim9907 2 года назад

    Hello sir can i ask you your coding can put in blynks app

    • @ModestMaker
      @ModestMaker  2 года назад

      Sorry for not replying sooner - I am not familiar with blynks.

  • @NgoprekdirumahYT
    @NgoprekdirumahYT 2 года назад

    CODE LINK IS DEAD, please update it.

    • @ModestMaker
      @ModestMaker  2 года назад

      You can find it here: modestmaker.com/arduino/part2.html . Thanks for the heads up - video description updated.

  • @user-ec6zg3co8e
    @user-ec6zg3co8e 8 месяцев назад

    can you give me a free downloud of arduino uno software please peter

    • @ModestMaker
      @ModestMaker  8 месяцев назад

      www.arduino.cc/en/software - it's free for download online.

  • @claytonmorrissey
    @claytonmorrissey 3 года назад

    hear is a rain gauge for under 100 bucks

    • @ModestMaker
      @ModestMaker  3 года назад

      ... and one that you now have an understanding of how it works!

  • @tonyfremont
    @tonyfremont 4 года назад

    At 10:43, you misstated the RC formula. When using microfarads, you need to use megohms, not kiloohms. T=RC uses seconds, ohms and whole farad's. Since you are using millionths of farads, you need to use millions of ohm's. I'm not good at explaining this, I apologise for that.
    That said, you can denounce the switch in software, you just have to do it at main level, not in the interrupt handler.