ModularSensors > Files > src / sensors / CampbellOBS3.h

CampbellOBS3.h file

Contains the CampbellOBS3 sensor subclass and the variable subclasses CampbellOBS3_Turbidity and CampbellOBS3_Voltage.

These are used for the Campbell Scientific OBS-3+.

This depends on the soligen2010 fork of the Adafruit ADS1015 library.

Classes

class CampbellOBS3
The Sensor sub-class for the Campbell OBS3 analog turbidity sensor.
class CampbellOBS3_Turbidity
The Variable sub-class used for the turbidity output from a Campbell OBS3+.
class CampbellOBS3_Voltage
The Variable sub-class used for the raw voltage output from a Campbell OBS3+.

Defines

#define OBS3_NUM_VARIABLES = 2
Sensor::_numReturnedValues; the OBS3 can report 2 values.
#define OBS3_INC_CALC_VARIABLES = 1
Sensor::_incCalcValues; turbidity is calculated from raw voltage using the input calibration equation.
#define ADS1115_ADDRESS = 0x48
The assumed address of the ADS1115, 1001 000 (ADDR = GND)

Sensor Timing

The sensor timing for an OBS3+

#define OBS3_WARM_UP_TIME_MS = 2
Sensor::_warmUpTime_ms; the ADS1115 warms up in 2ms.
#define OBS3_STABILIZATION_TIME_MS = 2000
Sensor::_stabilizationTime_ms; minimum stabilization time for the OBS3 is 2s (2000ms).
#define OBS3_MEASUREMENT_TIME_MS = 100
Sensor::_measurementTime_ms; OBS3 takes 100ms to complete a measurement - Maximum data rate = 10Hz (100ms/sample).

Turbidity

The turbidity variable from an OBS3+

  • Range: (depends on sediment size, particle shape, and reflectivity)
    • Turbidity (low/high):
      • T1: 250/1000 NTU
      • T2: 500/2000 NTU
      • T3: 1000/4000 NTU
    • Mud: 5000 to 10,000 mg L–1
    • Sand: 50,000 to 100,000 mg L–1
  • Accuracy: (whichever is larger)
    • Turbidity: 2% of reading or 0.5 NTU
    • Mud: 2% of reading or 1 mg L–1
    • Sand: 4% of reading or 10 mg L–1
  • Resolution:
    • 16-bit ADC, Turbidity:
      • T1: 0.03125/0.125 NTU
      • T2: 0.0625/0.25 NTU
      • T3: 0.125/0.5 NTU
      • OBS3_RESOLUTION = 5
    • 12-bit ADC, Turbidity:

CampbellOBS3_Turbidity(CampbellOBS3* parentSense, const char* uuid = "", const char* varCode = OBS3_TURB_DEFAULT_CODE) explicit

Construct a new CampbellOBS3_Turbidity object.

Parameters
parentSense The parent CampbellOBS3 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 "OBS3Turbidity".

#define OBS3_TURB_VAR_NUM = 0
Variable number; turbidity is stored in sensorValues[0].
#define OBS3_RESOLUTION = 5
Decimals places in string representation; turbidity should have 5.
#define OBS3_TURB_VAR_NAME = "turbidity"
Variable name in ODM2 controlled vocabulary; "turbidity".
#define OBS3_TURB_UNIT_NAME = "nephelometricTurbidityUnit"
Variable unit name in ODM2 controlled vocabulary; "nephelometricTurbidityUnit" (NTU)
#define OBS3_TURB_DEFAULT_CODE = "OBS3Turbidity"
Default variable short code; "OBS3Turbidity".

Voltage

The voltage variable from an OBS3+

  • Range is 0 to 2.5V
  • Accuracy:

CampbellOBS3_Voltage(CampbellOBS3* parentSense, const char* uuid = "", const char* varCode = OBS3_VOLTAGE_DEFAULT_CODE) explicit

Construct a new CampbellOBS3_Voltage object.

Parameters
parentSense The parent CampbellOBS3 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 "OBS3Voltage".

#define OBS3_VOLTAGE_VAR_NUM = 1
Variable number; voltage is stored in sensorValues[1].
#define OBS3_VOLTAGE_VAR_NAME = "voltage"
Variable name in ODM2 controlled vocabulary; "voltage".
#define OBS3_VOLTAGE_UNIT_NAME = "volt"
Variable unit name in ODM2 controlled vocabulary; "volt".
#define OBS3_VOLTAGE_DEFAULT_CODE = "OBS3Voltage"
Default variable short code; "OBS3Voltage".
#define OBS3_VOLTAGE_RESOLUTION = 4
Decimals places in string representation; voltage should have 4.