A Sensor is some sort of device that is capable of taking one or more measurements using some sort of method. Most often we can think of these as probes or other instruments that can give back information about the world around them. Sensors can usually be given power or have that power cut. They may be awoken or activated and then returned to a sleeping/low power use state. The may need to be asked to begin a single reading or they may continuously return data. They must be capable of returning the value of their readings to a logger of some type.
The detailed Sensor class documentation is here: https://envirodiy.github.io/ModularSensors/class_
A Variable is a result value taken by a Sensor or calculated from the results of one or more sensors. It is characterized by a name (what it is a measurement of), a unit of measurement, and a resolution. The names and units of measurements for all variables come from the controlled vocabularies developed for the ODM2 data system. (http:/
The Variable class documentation is here: https://envirodiy.github.io/ModularSensors/class_
Variables are grouped together into VariableArrays. The VariableArray class documentation is here: https://envirodiy.github.io/ModularSensors/class_
A logger is a circuit board with a processor or microcontroller unit (MCU) that can control all functions of the modem and sensors that are attached to it and save the values of all variables measured by those sensors to an attached SD card. In this library, all loggers are Arduino-style small processor circuit boards.
The Logger class documentation is here: https://envirodiy.github.io/ModularSensors/class_
A modem is a system on a chip or system on a module a that can communicate with the logger's MCU and with the world wide web. This doesn't mean something that makes beeps and bloops on the phone line. The modem SoC or SOM handles all the intricacies and lower layers of internet communication allowing the logger to operate at the top application layer. A cellular SoC may actually have a much more powerful processor than the logger MCU. The two communcicate via serial lines. Within this library, the modem is represented as a loggerModem object. All loggerModem functions are heavily dependent on the TinyGSM library.
The loggerModem class documentation is available here: https://envirodiy.github.io/ModularSensors/classlogger_
Unlike the other components, a dataPublisher object doesn't represent any physical device. It's an object only in the sense of object oriented programming - not something you could hold. Within the functioning of the library, the dataPublisher "watches" the logger for new data and correctly formats and sends that data to some online web service.
The dataPublisher class documentation is available here: https://envirodiy.github.io/ModularSensors/classdata_
This library is built to fully take advantage of Objecting Oriented Programing (OOP) approaches. This means there are a number of base abstract classes with virtual functions and then many more daughter classes which inherit the functions of their parents and implement others themselves.
The main classes are implemented in the src directory of the library. They exactly match the terms defined above.
Each sensor is implemented as a subclass of the "Sensor" class contained in "SensorBase.h".
Each variable is separately implemented as a subclass of the "Variable" class contained in "VariableBase.h". The variables are tied to the sensor using an "[Observer](https://en.wikipedia.org/wiki/Observer_pattern)" software pattern.
The "VariableArray" class contained in "VariableArray.h" defines the logic for iterating through many variable objects. The VariableArray class takes advantage of various time stamps within the Sensor class to optimize the timing of communications with many sensors.
The "Logger" class defines functions for sleeping the processor and writing to an SD card.
The dataPublisher again act as observers of the logger.