![]() |
Data Gator
Hardware and software documentation for the Data Gator project.
|
Interface for converting a voltage measurement from an analog sensor into a double, as a Volume of water per volume of soil percentage. More...
#include <VWCSensor.hpp>
Public Types | |
enum | SoilMedia { MINERAL_SOIL , SOILLESS } |
Defines types of soil for which the volumetric water content calculation needs to be adjusted. More... | |
Public Member Functions | |
virtual double | getVWC (SoilMedia media, double voltage) |
Convert raw data to volume water/volume soil percentage. | |
virtual std::string | getSensorType () |
Return brand+sensor model string for topic. | |
virtual std::string | toJSON (double voltage) |
Convert data to JSON key value pairs. | |
Interface for converting a voltage measurement from an analog sensor into a double, as a Volume of water per volume of soil percentage.
Defines types of soil for which the volumetric water content calculation needs to be adjusted.
These types are defined according to the needs of the Meter Teros10, though in principle this can be extended to other sensors or disregarded by sub-classes. Pass to VWCSensor::getVWC(...)
to apply to conversion from analog voltage to digital VWC value.
Enumerator | |
---|---|
MINERAL_SOIL | Mineral-based soil. Dirt! |
SOILLESS | Fake soil, potting soil for example. |
|
virtual |
Return brand+sensor model string for topic.
Reimplemented in Teros10.
Convert raw data to volume water/volume soil percentage.
[in] | media | The type of soil the sensor is going to be used in. This is assumed to be natural dirt by default, but some sensors allow this value to be changed to provide better accuracy. |
[in] | voltage | The raw reading from the sensor. |
Reimplemented in Teros10.
Convert data to JSON key value pairs.
[in] | voltage | The analog voltage read from the sensor. |
Reimplemented in Teros10.