Tally Counter I2C topic
- Introduction
- Sensor Datasheet
- Sensor Constructor
- Example Code
- Reference
- Detailed Descriptions
Classes for the Tally Counter I2C external event counter.
Introduction
Northern Widget's Tally is
a minimal ultra low power digital event counter, designed to be a counterpart to a traditional data logger to measure and average rapid events like an anemometer reading. It communicates over I2C at either 3.3 or 5V.
The [Tally_Library] (https://github.com/EnviroDIY/Tally_
Sensor Datasheet
Documentation for the sensor can be found at:
Sensor Constructor
Construct a new Tally Counter I2C object using the primary hardware I2C instance. The pin on the mcu controlling power to TallyCounterI2C.
TallyCounterI2C::
Parameters
powerPin
i2cAddressHex
The I2C address of the Tally Counter I2C is 0x33 by default.
Example Code
The Tally countetr is used in the menu a la carte example.
Classes
- class TallyCounterI2C
- The Sensor sub-class for the Tally Counter I2C.
- class TallyCounterI2C_Events
- The Variable sub-class used for the events output from a Tally Counter I2C - shows the number of events since last read.
Sensor Variable Counts
The number of variables that can be returned by the Tally event counter
- #define TALLY_NUM_VARIABLES = 1
- Sensor::
_numReturnedValues; the Tally can report 1 value. - #define TALLY_INC_CALC_VARIABLES = 0
- Sensor::
_incCalcValues; we don't calculate any additional values.
Configuration Defines
Defines to set the address of the Tally event counter.
- #define TALLY_ADDRESS_BASE = 0x33
- The default address of the Tally.
Sensor Timing
The sensor timing for a Northern Widget Tally event counter
- Readings transferred from the reed-switch counting device (i.e. anemometer or tipping bucket) to the logger are from past events, so there is no need to wait for stability or measuring.
- #define TALLY_WARM_UP_TIME_MS = 10
- Sensor::
_warmUpTime_ms; Tally warms up in <10 ms. - #define TALLY_STABILIZATION_TIME_MS = 10
- Sensor::
_stabilizationTime_ms; Tally is stable after <10ms. - #define TALLY_MEASUREMENT_TIME_MS = 10
- Sensor::
_measurementTime_ms; Tally takes <10ms to complete a measurement.
Events
The events variable from a Northern Widget Tally event counter
- Range and accuracy depend on the sensor used
- For wind, we often use [Inspeed WS2R Version II Reed Switch Anemometer] (https:/
/ www.store.inspeed.com/ Inspeed-Version-II-Reed-Switch-Anemometer-Sensor-Only-WS2R.htm)
- For wind, we often use [Inspeed WS2R Version II Reed Switch Anemometer] (https:/
Construct a new TallyCounterI2C_
TallyCounterI2C_
Parameters
parentSense
The parent TallyCounterI2C providing the result values.
uuid
A universally unique identifier (UUID or GUID) for the variable; optional with the default value of an empty string.
varCode
A short code to help identify the variable in files; optional with a default value of "TallyCounterI2CEvents".
- #define TALLY_EVENTS_RESOLUTION = 0
- Decimals places in string representation; events are an integer should be 0 - resolution is 1 event.
- #define TALLY_EVENTS_VAR_NUM = 0
- Sensor variable number; events is stored in sensorValues[0].
- #define TALLY_EVENTS_VAR_NAME = "counter"
- Variable name in ODM2 controlled vocabulary; "counter".
- #define TALLY_EVENTS_UNIT_NAME = "event"
- Variable unit name in ODM2 controlled vocabulary; "event".
- #define TALLY_EVENTS_DEFAULT_CODE = "TallyCounterI2CEvents"
- Default variable short code; "TallyCounterI2CEvents".
Define documentation
#define TALLY_NUM_VARIABLES = 1
#include <src/sensors/TallyCounterI2C.h>
Sensor::
#define TALLY_INC_CALC_VARIABLES = 0
#include <src/sensors/TallyCounterI2C.h>
Sensor::
#define TALLY_ADDRESS_BASE = 0x33
#include <src/sensors/TallyCounterI2C.h>
The default address of the Tally.
#define TALLY_WARM_UP_TIME_MS = 10
#include <src/sensors/TallyCounterI2C.h>
Sensor::
#define TALLY_STABILIZATION_TIME_MS = 10
#include <src/sensors/TallyCounterI2C.h>
Sensor::
#define TALLY_MEASUREMENT_TIME_MS = 10
#include <src/sensors/TallyCounterI2C.h>
Sensor::
#define TALLY_EVENTS_RESOLUTION = 0
#include <src/sensors/TallyCounterI2C.h>
Decimals places in string representation; events are an integer should be 0 - resolution is 1 event.
#define TALLY_EVENTS_VAR_NUM = 0
#include <src/sensors/TallyCounterI2C.h>
Sensor variable number; events is stored in sensorValues[0].
#define TALLY_EVENTS_VAR_NAME = "counter"
#include <src/sensors/TallyCounterI2C.h>
Variable name in ODM2 controlled vocabulary; "counter".
#define TALLY_EVENTS_UNIT_NAME = "event"
#include <src/sensors/TallyCounterI2C.h>
Variable unit name in ODM2 controlled vocabulary; "event".
#define TALLY_EVENTS_DEFAULT_CODE = "TallyCounterI2CEvents"
#include <src/sensors/TallyCounterI2C.h>
Default variable short code; "TallyCounterI2CEvents".