Skip to content

Releases: EnviroDIY/TippingBucketRainCounter

v0.2.0: Add Anemometer Counting and Bug Fix

09 Apr 13:02
14cfdd6
Compare
Choose a tag to compare

Tipping Bucket Rain Counter I2C Slave Device

Arduino code & instructions to convert an Adafruit Pro Trinket 3V board into an event counter for any reed switch sensor, such as a tipping bucket rain gauge. The programmed Pro Trinket will continuously count tip events, and will respond as an I2C Slave to a Master data logger board, such as the EnviroDIY Mayfly.

This release increases the count range and response stability, enabling it's use with a reed switch anemometer such as the Inspeed Reed Switch Anemometer. This device can now be used in place of the Northern Widget Tally with the EnviroDIY Modular Sensors library (with commit EnviroDIY/ModularSensors@87cd0c9).

Change Log

New Features

  • Increased count range from 0-255 events between readings (1-byte, uint8) to 0-2,147,483,648 events (4-bytes, int32), which enabled use with high-frequency reed switch devices, such as an anemometer. #4
    • Power consumption by the Pro Trinket does not appear to be an issue with high-frequency counting because the Pro Trinket only takes ~24us for the trinket to record a tip event and go back to sleep (see #5 (comment)). Field testing confirmed low power consumption, when the Pro Trinket power light was disabled (option A described in our Reducing Power ReadMe).
    • Added logic to Master_Test.ino example to ensure backward compatibility with v0.1.0 slave devices. 7782eab

Improvements

  • Improved code documentation and styling, to better match the C++ explicit data types, comments, and whitespace styling used by most EnviroDIY libraries, including Modular Sensors. 07efe0e
  • Added extra serial print outputs for debugging, in the Master_Test.ino example, which the user can enable with #define RAINCOUNTERI2C_DEBUG. 9b12d13, 7782eab

Bug Fixes

  • Fixed a critical bug (#5) that would return an error with a data loss after and during a high intensity storm.
    • The slave was returning a 1-byte (uint8) rather than 2-bytes as intended, which resulted in the maximum count being 255 (or 2.55 inches for a typical tipping bucket). We believe this was exceeded in a 15-min interval during a few very intense storms. (see #5 (comment)).
    • Because the Master was requesting 2-bytes, and slave was returning 1-byte, the second byte would be returned as 255 (i.e. equivalent to a non-response) if a tip was occurring during an I2C communication (lasting up to 0.5 sec) between the slave and the master devices, as shown in tests shared in #5 (comment)). Under most conditions, the second byte was being returned as 0, which is why we did not notice this bug with initial testing.
    • NOTE: when the number of bytes requested by the master equals the number of bytes sent by the slave, the I2C communication can not get interrupted by a tip.

v0.1.0: Initial Release of Event Counting I2C Slave Device

21 May 19:34
Compare
Choose a tag to compare

DOI

TippingBucketRainCounter I2C Slave Device

Arduino code & instructions to convert an Adafruit Pro Trinket 3V board into a tip counter for a tipping bucket rain gauge. The Pro Trinket monitors tips and acts as an I2C Slave to a Master data logger board, such as the EnviroDIY Mayfly.

This initial release has been working for many users since 2018.