Apogee SQ-212 topic
- Introduction
- Sensor Datasheet
- Build flags
- Sensor Constructor
- Example Code
- Reference
- Detailed Descriptions
Classes for the Apogee SQ-212 quantum light sensor.
Introduction
The Apogee SQ-212 quantum light sensor measures photosynthetically active radiation (PAR) - typically defined as total radiation across a range of 400 to 700 nm. PAR is often expressed as photosynthetic photon flux density (PPFD): photon flux in units of micromoles per square meter per second (μmol m-2 s-1, equal to microEinsteins per square meter per second) summed from 400 to 700 nm. The raw output from the sensor is a simple analog signal which must be converted to a digital signal and then multiplied by a calibration factor to get the final PAR value. The PAR sensor requires a 5-24 V DC power source with a nominal current draw of 300 μA. The power supply to the sensor can be stopped between measurements.
To convert the sensor's analog signal to a high resolution digital signal, the sensor must be attached to an analog-to-digital converter. See the ADS1115 for details on the conversion.
The calibration factor this library uses to convert from raw voltage to PAR is that specified by Apogee for the SQ-212: 1 µmol mˉ² sˉ¹ per mV (reciprocal of sensitivity). If needed, this calibration factor can be modified by compiling with the build flag -D SQ212_CALIBRATION_FACTOR=x
where x is the calibration factor. This allows you to adjust the calibration or change to another Apogee sensor (e.g. SQ-215 or SQ225) as needed.
Sensor Datasheet
Build flags
-D MS_USE_ADS1015
- switches from the 16-bit ADS1115 to the 12 bit ADS1015
-D SQ212_CALIBRATION_FACTOR=x
- Changes the calibration factor from 1 to x
Sensor Constructor
Construct a new Apogee SQ-212 object - need the power pin and the data channel on the ADS1x15. The pin on the mcu controlling power to the Apogee SQ-212. Use -1 if it is continuously powered.
ApogeeSQ212::
Parameters
powerPin
adsChannel
The analog data channel the Apogee SQ-212 is connected to on the TI ADS1115 (0-3).
i2cAddress
The I2C address of the ADS 1x15, default is 0x48 (ADDR = GND)
measurementsToAverage
The number of measurements to take and average before giving a "final" result from the sensor; optional with a default value of 1.
Example Code
The SQ-212 is used in the menu a la carte example.
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.
Sensor Variable Counts
The number of variables that can be returned by the Apogee SQ-212
- #define SQ212_NUM_VARIABLES = 2
- Sensor::
_numReturnedValues; the SQ212 can report 2 values, raw voltage and calculated PAR. - #define SQ212_INC_CALC_VARIABLES = 1
- Sensor::
_incCalcValues; PAR is calculated from the raw voltage.
Configuration Defines
Defines to set the calibration of the SQ-212 and the address of the ADD.
- #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_
- #define SQ212_PAR_RESOLUTION = 4
- Decimals places in string representation; PAR should have 4 when using an ADS1115.
- #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".
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_
- #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.
Define documentation
#define SQ212_NUM_VARIABLES = 2
#include <src/sensors/ApogeeSQ212.h>
Sensor::
#define SQ212_INC_CALC_VARIABLES = 1
#include <src/sensors/ApogeeSQ212.h>
Sensor::
#define SQ212_CALIBRATION_FACTOR = 1
#include <src/sensors/ApogeeSQ212.h>
The calibration factor between output in volts and PAR (microeinsteinPerSquareMeterPerSecond) 1 µmol mˉ² sˉ¹ per mV (reciprocal of sensitivity)
#define ADS1115_ADDRESS = 0x48
#include <src/sensors/ApogeeSQ212.h>
The assumed address of the ADS1115, 1001 000 (ADDR = GND)
#define SQ212_WARM_UP_TIME_MS = 2
#include <src/sensors/ApogeeSQ212.h>
Sensor::
#define SQ212_STABILIZATION_TIME_MS = 2
#include <src/sensors/ApogeeSQ212.h>
Sensor::
The stabilization time of the SQ-212 itself is not known!
#define SQ212_MEASUREMENT_TIME_MS = 2
#include <src/sensors/ApogeeSQ212.h>
Sensor::
#define SQ212_PAR_RESOLUTION = 4
#include <src/sensors/ApogeeSQ212.h>
Decimals places in string representation; PAR should have 4 when using an ADS1115.
#define SQ212_PAR_VAR_NUM = 0
#include <src/sensors/ApogeeSQ212.h>
Variable number; PAR is stored in sensorValues[0].
#define SQ212_PAR_VAR_NAME = "radiationIncomingPAR"
#include <src/sensors/ApogeeSQ212.h>
Variable name in ODM2 controlled vocabulary; "radiationIncomingPAR".
#define SQ212_PAR_UNIT_NAME = "microeinsteinPerSquareMeterPerSecond"
#include <src/sensors/ApogeeSQ212.h>
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"
#include <src/sensors/ApogeeSQ212.h>
Default variable short code; "photosyntheticallyActiveRadiation".
#define SQ212_VOLTAGE_VAR_NUM = 1
#include <src/sensors/ApogeeSQ212.h>
Variable number; voltage is stored in sensorValues[1].
#define SQ212_VOLTAGE_VAR_NAME = "voltage"
#include <src/sensors/ApogeeSQ212.h>
Variable name in ODM2 controlled vocabulary; "voltage".
#define SQ212_VOLTAGE_UNIT_NAME = "volt"
#include <src/sensors/ApogeeSQ212.h>
Variable unit name in ODM2 controlled vocabulary; "volt" (V)
#define SQ212_VOLTAGE_DEFAULT_CODE = "SQ212Voltage"
#include <src/sensors/ApogeeSQ212.h>
Default variable short code; "SQ212Voltage".
#define SQ212_VOLTAGE_RESOLUTION = 4
#include <src/sensors/ApogeeSQ212.h>
Decimals places in string representation; voltage should have 4 when used with an ADS1115.