ModularSensors > Files > sensors / YosemitechY504.h

YosemitechY504.h file

Contains the YosemitechY504 sensor subclass and the variable subclasses YosemitechY504_DOpct, YosemitechY504_Temp, and YosemitechY504_DOmgL.

These are for the Yosemitech Y502-A or Y504-A optical dissolved oxygen sensor.

This depends on the YosemitechParent super class.

Documentation for the Modbus Protocol commands and responses can be found within the documentation in the YosemitechModbus library at: https://github.com/EnviroDIY/YosemitechModbus

Classes

class YosemitechY504
The Sensor sub-class for the Yosemitech Y502-A or Y504-A optical dissolved oxygen sensors.
class YosemitechY504_DOpct
The Variable sub-class used for the dissolved oxygen percent saturation output from a Yosemitech Y502-A or Y504-A optical dissolved oxygen sensor.
class YosemitechY504_Temp
The Variable sub-class used for the temperature output from a Yosemitech Y504 optical dissolved oxygen sensor.
class YosemitechY504_DOmgL
The Variable sub-class used for the dissolved oxygen concentration output from a Yosemitech Y502-A or Y504-A optical dissolved oxygen sensor.

Defines

#define Y504_NUM_VARIABLES = 3
Sensor::_numReturnedValues; the Y504 can report 3 values.

Sensor Timing

The sensor timing for a Yosemitch Y504

#define Y504_WARM_UP_TIME_MS = 375
Sensor::_warmUpTime_ms; time before sensor responds after power - 375ms.
#define Y504_STABILIZATION_TIME_MS = 8000
Sensor::_stabilizationTime_ms; time between "StartMeasurement" command and stable reading - 8sec (8000ms).
#define Y504_MEASUREMENT_TIME_MS = 1700
Sensor::_measurementTime_ms; the Y504 takes ~1700ms to complete a measurement.

Dissolved Oxygen Percent Saturation

The dissolved oxygen percent saturation variable from a Yosemitch Y504

  • Range is 0-20mg/L or 0-200% Saturation
  • Accuracy is ± 1 %

YosemitechY504_DOpct(YosemitechY504* parentSense, const char* uuid = "", const char* varCode = Y504_DOPCT_DEFAULT_CODE) explicit

Construct a new YosemitechY504_DOpct object.

Parameters
parentSense The parent YosemitechY504 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 "Y504DOpct".

#define Y504_DOPCT_RESOLUTION = 1
Decimals places in string representation; dissolved oxygen percent should have 1 - resolution is 0.1%.
#define Y504_DOPCT_VAR_NUM = 0
Sensor variable number; dissolved oxygen percent is stored in sensorValues[0].
#define Y504_DOPCT_VAR_NAME = "oxygenDissolvedPercentOfSaturation"
Variable name in ODM2 controlled vocabulary; "oxygenDissolvedPercentOfSaturation".
#define Y504_DOPCT_UNIT_NAME = "percent"
Variable unit name in ODM2 controlled vocabulary; "milligramPerLiter" (mg/L)
#define Y504_DOPCT_DEFAULT_CODE = "Y504DOpct"
Default variable short code; "Y504DOmgL".

Temperature

The temperature variable from a Yosemitch Y504

  • Range is 0°C to + 50°C
  • Accuracy is ± 0.2°C

YosemitechY504_Temp(YosemitechY504* parentSense, const char* uuid = "", const char* varCode = Y504_TEMP_DEFAULT_CODE) explicit

Construct a new YosemitechY504_Temp object.

Parameters
parentSense The parent YosemitechY504 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 "Y504Temp".

#define Y504_TEMP_RESOLUTION = 1
Decimals places in string representation; temperature should have 1 - resolution is 0.1°C.
#define Y504_TEMP_VAR_NUM = 1
Sensor variable number; temperature is stored in sensorValues[1].
#define Y504_TEMP_VAR_NAME = "temperature"
Variable name in ODM2 controlled vocabulary; "temperature".
#define Y504_TEMP_UNIT_NAME = "degreeCelsius"
Variable unit name in ODM2 controlled vocabulary; "degreeCelsius" (°C)
#define Y504_TEMP_DEFAULT_CODE = "Y504Temp"
Default variable short code; "Y504Temp".

Dissolved Oxygen Concentration

The dissolved oxygen concentration variable from a Yosemitch Y504

  • Range is 0-20mg/L or 0-200% Saturation
  • Accuracy is ± 1 %

YosemitechY504_DOmgL(YosemitechY504* parentSense, const char* uuid = "", const char* varCode = Y504_DOMGL_DEFAULT_CODE) explicit

Construct a new YosemitechY504_DOmgL object.

Parameters
parentSense The parent YosemitechY504 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 "Y504DOmgL".

#define Y504_DOMGL_RESOLUTION = 2
Decimals places in string representation; dissolved oxygen concentration should have 2 - resolution is 0.01 mg/L.
#define Y504_DOMGL_VAR_NUM = 2
Sensor variable number; dissolved oxygen concentration is stored in sensorValues[2].
#define Y504_DOMGL_VAR_NAME = "oxygenDissolved"
Variable name in ODM2 controlled vocabulary; "oxygenDissolved".
#define Y504_DOMGL_UNIT_NAME = "milligramPerLiter"
Variable unit name in ODM2 controlled vocabulary; "milligramPerLiter" (mg/L)
#define Y504_DOMGL_DEFAULT_CODE = "Y504DOmgL"
Default variable short code; "Y504DOmgL".