ModularSensors > Files > sensors / ApogeeSQ212.h

ApogeeSQ212.h file

Contains the ApogeeSQ212 sensor subclass and the variable subclasses ApogeeSQ212_PAR and ApogeeSQ212_Voltage.

These are used for the Apogee SQ-212 quantum light sensor.

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

Classes

class ApogeeSQ212
The Sensor sub-class for the Apogee SQ-212 sensor.
class ApogeeSQ212_PAR
The Variable sub-class used for the photosynthetically active radiation (PAR) output from an Apogee SQ-212.
class ApogeeSQ212_Voltage
The Variable sub-class used for the raw voltage output from an Apogee SQ-212.

Defines

#define SQ212_NUM_VARIABLES = 2
Sensor::_numReturnedValues; the SQ212 can report 2 values.
#define SQ212_CALIBRATION_FACTOR = 1
The calibration factor between output in volts and PAR (microeinsteinPerSquareMeterPerSecond) 1 µmol mˉ² sˉ¹ per mV (reciprocal of sensitivity)
#define ADS1115_ADDRESS = 0x48
The assumed address of the ADS1115, 1001 000 (ADDR = GND)

Sensor Timing

The sensor timing for an Apogee SQ-212

#define SQ212_WARM_UP_TIME_MS = 2
Sensor::_warmUpTime_ms; the warm up time is unknown; using the 2ms for the TI ADS1x15 to warm up.
#define SQ212_STABILIZATION_TIME_MS = 2
Sensor::_stabilizationTime_ms; the ADS1115 is stable after 2ms.
#define SQ212_MEASUREMENT_TIME_MS = 2
Sensor::_measurementTime_ms; ADS1115 takes almost 2ms to complete a measurement (860/sec).

PAR

The PAR variable from an Apogee SQ-212

  • Range is 0 to 2500 µmol m-2 s-1
  • Accuracy is ± 0.5%
  • Resolution:
    • 16-bit ADC (ADS1115): 0.3125 µmol m-2 s-1 (ADS1115)
    • 12-bit ADC (ADS1015, using build flag MS_USE_ADS1015): 5 µmol m-2 s-1 (ADS1015)
  • Reported as microeinsteins per square meter per second (µE m-2 s-1 or µmol m-2 s-1)

{{ ApogeeSQ212_PAR }}

#define SQ212_PAR_VAR_NUM = 0
Variable number; PAR is stored in sensorValues[0].
#define SQ212_PAR_VAR_NAME = "radiationIncomingPAR"
Variable name in ODM2 controlled vocabulary; "radiationIncomingPAR".
#define SQ212_PAR_UNIT_NAME = "microeinsteinPerSquareMeterPerSecond"
Variable unit name in ODM2 controlled vocabulary; "microeinsteinPerSquareMeterPerSecond" (µE m-2 s-1 or µmol * m-2 s-1)
#define SQ212_PAR_DEFAULT_CODE = "photosyntheticallyActiveRadiation"
Default variable short code; "photosyntheticallyActiveRadiation".
#define SQ212_PAR_RESOLUTION = 4
Decimals places in string representation; PAR should have 4 when using an ADS1115.

Voltage

The voltage variable from an Apogee SQ-212

  • Range is 0 to 3.6V [when ADC is powered at 3.3V]
  • Accuracy is ± 0.5%
    • 16-bit ADC (ADS1115): < 0.25% (gain error), <0.25 LSB (offset error)
    • 12-bit ADC (ADS1015, using build flag MS_USE_ADS1015): < 0.15% (gain error), <3 LSB (offset error)
  • Resolution [assuming the ADC is powered at 3.3V with inbuilt gain set to 1 (0-4.096V)]:
    • 16-bit ADC (ADS1115): 0.125 mV (ADS1115)
    • 12-bit ADC (ADS1015, using build flag MS_USE_ADS1015): 2 mV (ADS1015)

{{ ApogeeSQ212_Voltage }}

#define SQ212_VOLTAGE_VAR_NUM = 1
Variable number; voltage is stored in sensorValues[1].
#define SQ212_VOLTAGE_VAR_NAME = "voltage"
Variable name in ODM2 controlled vocabulary; "voltage".
#define SQ212_VOLTAGE_UNIT_NAME = "volt"
Variable unit name in ODM2 controlled vocabulary; "volt" (V)
#define SQ212_VOLTAGE_DEFAULT_CODE = "SQ212Voltage"
Default variable short code; "SQ212Voltage".
#define SQ212_VOLTAGE_RESOLUTION = 4
Decimals places in string representation; voltage should have 4 when used with an ADS1115.