Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, a web toolkit designed to help citizens, conservation practitioners, municipal decision-makers, researchers, educators, and students advance knowledge and stewardship of fresh water. New to EnviroDIY? Start here

Reply To: Rain Gauge Tip Data Without Rain

Home Forums Mayfly Data Logger Rain Gauge Tip Data Without Rain Reply To: Rain Gauge Tip Data Without Rain

#14785
Shannon Hicks
Participant

After thinking about this old code yesterday, I was curious about what actually happens if a tip occurs during a long delay period, like the 2-second delay on line 123 and and 2.5-second delay on line 125 (which are delays to give the Xbee 900mhz radio module time to successfully wake up and then finish its routine before sleeping).   I programmed a test board with the sketch from above, but increased the delay time to 10 seconds for each of those lines, to give me enough time to experiment.  What I found was that if a simulated bucket tip on pin D10 happens anytime during a 10-second delay, the delay instantly ends and the interrupt routine successfully gets executed (meaning a tip gets counted) and then the sketch moves on with the next line of code (either line 124 or 126, depending on which delay the tip happened in).  So this shows that no tips will get missed by the Mayfly, but the delay period gets instantly cut short.  If you’ve got a radio or cell module that needs multiple seconds of uninterrupted wait times before doing the next step, then care should be taken about how you handle interrupts from D10 during that time.  You could unattach the D10 interrupt during those important delay times, and then reattach it when you’re done, or find another way to handle either the interrupt or the telemetry delays.