EnviroDIY / TippingBucketRainCounter

Arduino code & instructions to convert a Pro Trinket board into a low-power I2C event counter for a tipping bucket rain gauge or anemometer.
BSD 3-Clause "New" or "Revised" License
1 stars 3 forks source link

Modify to enable anemometer counts? #4

Closed aufdenkampe closed 3 years ago

aufdenkampe commented 5 years ago

Modifications to the firmware code could enable this to count the higher frequency signals of a reed-switch anemometer such as https://www.store.inspeed.com/Inspeed-Version-II-Reed-Switch-Anemometer-Sensor-Only-WS2R.htm

This might not be a great idea, given that the Project Tally device and Tally Library all do this quite well.

If someone is interested in doing this, here are some ideas from @bschulz1701 (Mar. 2019):

I just glanced back at the code, and using the debounce I have, you would be able to measure windspeeds up to ~ 100 m/s, realistically I would not want to push it beyond ~75 m/s (Still plenty). The bigger issues are that right now it is just set to return 1 byte (0 ~ 256 values) which would mean if you're measuring every 15 minutes, you would have a max average wind speed of 0.28 m/s, not even enough to spin the cups. This can be fixed of course, we would return a 4 byte (0 ~ 4.29billion) value no problem, of course, the code on both ends would have to be modified to send and accept that, but not a big deal. I think the biggest issue if that we could hedge a bit of a hacked system I made for you because we would only wake up when the rain bucket would tip, maybe a few times an hour, and on average 50 tips in a day would be a good amount, where as with the anemometer, we get several counts per second, which means the device never can go to sleep and we draw much more current (several mA) all the time, which is less than desirable.

tl;dr The [Trinket] counter I made could work with some software modification, but it would consume a decent bit of power (a few mA) being on all the time, the Project Tally device I designed would be a better fit I think (unless you need I2C, which is going to be added, but not on there yet), because it sips power at <uA when it is recording counts, and has the range designed to handle the rapid ticks of anemometers

aufdenkampe commented 3 years ago

The update to a 32-bit integer (4-bytes) has now made it possible to use the Master and Slave firmware to count spins of a reed-switch anemometer.

This has been tested and works with a recent update to the EnviroDIY Modular Sensors library ( https://github.com/EnviroDIY/ModularSensors/commit/87cd0c995e5f6358fa3c11f25295d3a13e01c6fc).

Use with an anemometer does require the slave device to get updated to >= v0.2.0 of this firmware (Slave_TippingBucket_Test_LowPower.ino), unlike the fix to #5.

Note that to calculate wind speed, you will need to create a calculated variable that divides counts by time to get frequency, then muliplies by a conversion factor. This is similar to getting wind speed from the Tally counter, as shown in these two examples:

We have not yet tested power consumption with an anemometer during windy conditions, but will report back when we do.

aufdenkampe commented 3 years ago

Tested anemometer logging all night at ~12 km/hr, using a ModularSensors sketch with logging at 15 min intervals. Lipo battery voltage only dropped from 4.185 V to 4.154 V. It looks like the modified Pro Trinket (with green LED trace cut) does not consume too much power!

To close this issue, it might be good to build in a frequency calculation that would be equally useful for wind and calculating rain rate as in #2.

aufdenkampe commented 3 years ago

@fisherba just deployed a test of this in the wild this morning at https://monitormywatershed.org/sites/CL-outlet/.

Let's see how the battery holds up. I think it is a 6600 mAh LiPo with a 3.5W solar panel.

aufdenkampe commented 3 years ago

Battery is doing well, even after a windy and cloudy 5-day stretch in April, in which solar charging was minimal and winds were sustained between 10-20 km/hr day and night.