Open aufdenkampe opened 4 years ago
It's time to get back to this task!
In the RainAccumulator branch, I've added to the documentation some old code from @s-hicks2 to count and accumulate tips directly on the Mayfly, which she shared on 2020-11-03 via https://www.envirodiy.org/topic/rain-gauge-tip-data-without-rain/#post-14783.
My commit 3d7281b placed a copy here: https://github.com/EnviroDIY/TippingBucketRainCounter/tree/RainAccumulator/doc/mayfly_rain_1_20200121_example.
@s-hicks2 also shared separately:
The sketch I currently use on all my rain gages is 5 years old and uses libraries that have been renamed or replaced and aren't available on our Github repo, so you won't be able to easily replicate the sketch. But I can send you the code and you can see if the functions are helpful. It essentially just has an integer named "dailytips" that gets incremented by 1 every time there's a tip. At midnight, it resets the integer back to 0. Would you be transmitting the data via xbee or cellular, or just recording to a memory card? Because I have examples of all 3.
My code only handles 2G cellular, because in order for the 4G LTE boards to work happily with our boards, Sara Damiano took over the sketch writing a couple years ago and rewrote all the libraries to work together, which is why I don't think my old sketch is going to work properly without being rewritten and readjusted for the new libraries. But in any case, the sketch is attached so you can see the basic structure and get some ideas on how it works.
The hardest part about counting tips with a sleeping logger, is that you have 2 separate interrupts that can wake the Mayfly. One is the clock, which happens every minute. The other is when there's a tip detected on Pin 10. You do that by attaching an interrupt to those 2 inputs, and then clearing the interrupt when it happens so that the board can go back to sleep. It took me a long time of experimenting to get them to work together without causing conflicts, or getting ignored. Resetting at midnight was the easy part.
Here is a description of the requested feature: