No video

Using an Arduino with a Tipping Bucket Rain Gauge

  Рет қаралды 31,829

Modest Maker

Modest Maker

5 жыл бұрын

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.buymeacoff...
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... 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.co...
Images used for gauge explanation came from these links: www.researchga...
and
www.explaintha...
Details on assembly your own gauge available here (wireless component not necessary):
www.allaboutci...
Code uploaded here:
modestmaker.co...

Пікірлер: 53
@automationtechnologyclub
@automationtechnologyclub 3 жыл бұрын
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 жыл бұрын
Wonderful - glad it helped! I'm still learning myself - I've posted an update here: kzbin.info/www/bejne/gXnVhaSaor6id80
@ModestMaker
@ModestMaker 4 жыл бұрын
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 жыл бұрын
Sounds great! Hope it works out. If you deal with heavy rains, make sure to check out the accuracy check on these tipping buckets. kzbin.info/www/bejne/n4OWZGSIecmDjZY . 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.
@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: kzbin.info/www/bejne/gXnVhaSaor6id80
@sebakiller9736
@sebakiller9736 2 жыл бұрын
Wow amazing Informations and cool Video
@ModestMaker
@ModestMaker 2 жыл бұрын
Glad you liked it!
@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.
@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: kzbin.info/www/bejne/oHaykIKgmNeFnK8
@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?
@user-nm8bv8zp4o
@user-nm8bv8zp4o 6 ай бұрын
The Schmidt trigger used in the demonstration is out of stock on Digikey, is there a reasonable alternative?
@ModestMaker
@ModestMaker 6 ай бұрын
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.
@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 жыл бұрын
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.
@rongeernaert1208
@rongeernaert1208 3 жыл бұрын
Thanks interesting lesson, and can I use a Hall sensor with magnet on a Arduino pin 3 ?
@ModestMaker
@ModestMaker 3 жыл бұрын
Yes. This is explained /demonstrated in subsequent tests, cued here: kzbin.info/www/bejne/gXnVhaSaor6id80
@sandikodev
@sandikodev 3 жыл бұрын
please increase the volume speaker... nice explanation, thanks
@ModestMaker
@ModestMaker 3 жыл бұрын
Ok next time.thanks!
@StuffUCanMake
@StuffUCanMake 5 жыл бұрын
Awesome stuff! I subscribe.
@NITAGRIAJITHREDDYG
@NITAGRIAJITHREDDYG 11 ай бұрын
Can u please explain,How was the arduino protected from rain in the field?
@ModestMaker
@ModestMaker 11 ай бұрын
Usually, just by embedding my electronics in a weather proof enclosure - like this one ;) kzbin.info/www/bejne/b2TMoYOep5yEqrMsi=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:kzbin.info/www/bejne/gXnVhaSaor6id80
@brianh21858
@brianh21858 Жыл бұрын
How do you calibrate the rain fall in relation to the area of the collection bucket surface area?
@ModestMaker
@ModestMaker Жыл бұрын
Great question! I cover the calculations and accuracy checks in this video, which I've cued of your convenience: kzbin.info/www/bejne/n4OWZGSIecmDjZY
@brianh21858
@brianh21858 Жыл бұрын
@@ModestMaker well done, thanks very much
@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.
@user-ec6zg3co8e
@user-ec6zg3co8e 9 ай бұрын
can you give me a free downloud of arduino uno software please peter
@ModestMaker
@ModestMaker 9 ай бұрын
www.arduino.cc/en/software - it's free for download online.
@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.
@ModestMaker
@ModestMaker 4 жыл бұрын
You are correct. Thank You!
@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!
@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: kzbin.info/www/bejne/oJK1qpiVbc5lp5o; will come back to this next.
@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.
Testing LoRa Transmission in Rangelands
4:29
Modest Maker
Рет қаралды 1,3 М.
Argent Weather Station Arduino Hacks - Hardware and Code
38:28
Modest Maker
Рет қаралды 71 М.
Can A Seed Grow In Your Nose? 🤔
00:33
Zack D. Films
Рет қаралды 32 МЛН
Fast and Furious: New Zealand 🚗
00:29
How Ridiculous
Рет қаралды 48 МЛН
A teacher captured the cutest moment at the nursery #shorts
00:33
Fabiosa Stories
Рет қаралды 61 МЛН
Fun with Transistors
24:33
HackMakeMod
Рет қаралды 142 М.
How a Tipping-Bucket Rain Gauge Works
2:54
Mississippi WMO
Рет қаралды 53 М.
Regensensor YL-83/MH-RD und FC-37, einfach erklärt! | #EdisTechlab
10:36
Building a Relay-Powered Pi Machine
17:35
The Science Elf
Рет қаралды 304 М.
I Built a Transparent Boomerang (it's lethal)
13:10
Mike Shake
Рет қаралды 3,1 МЛН
Measuring Wind and Rain
18:31
Jay Ham
Рет қаралды 4,9 М.
DIY WIFI Rain Gauge, powered by Home Assistant
13:30
Smart Solutions for Home
Рет қаралды 34 М.
DIY Arduino Rain Gauge - Measure rain with Arduino
12:01
Giovanni Aggiustatutto
Рет қаралды 9 М.
Rain Gauge Hardware & Software
21:27
Zookeeper JohnG
Рет қаралды 2,4 М.