Zebra-Tech D-Opto topic

Classes for the Zebra-Tech D-Opto digital dissolved oxygen sensor.

Introduction

The Zebra-Tech D-Opto sensor is implemented as a sub-classes of the SDI12Sensors class. It requires an 8-12V power supply, which can be turned off between measurements. The connection between the logger and the Arduino board is made by way of a white interface module provided by Zebra-Tech. You will need a voltage booster or a separate power supply to give the D-Opto sufficient voltage to run. At the Stroud Center, we use Pololu 9V Step-Up Voltage Regulators.

Sensor Datasheet

The manual for this sensor is available at: www.zebra-tech.co.nz/wp-content/uploads/2014/04/D-Opto-Sensor-manual-A4-ver-2.pdf

Build flags

Sensor Constructor

ZebraTechDOpto::ZebraTechDOpto(char SDI12address, int8_t powerPin, int8_t dataPin, uint8_t measurementsToAverage = 1)

Construct a new Zebra-Tech DOpto object.

Parameters
SDI12address The SDI-12 address of the DOpto; can be a char, char*, or int.
powerPin

The pin on the mcu controlling power to the D-Opto Use -1 if it is continuously powered.

  • The D-Opto requires a 8-12V power supply, which can be turned off between measurements
dataPin The pin on the mcu connected to the data line of the SDI-12 circuit.
measurementsToAverage The number of measurements to take and average before giving a "final" result from the sensor; optional with a default value of 1.

The SDI-12 address of the sensor, the Arduino pin controlling power on/off, and the Arduino pin sending and receiving data are required for the sensor constructor. Optionally, you can include a number of distinct readings to average. The data pin must be a pin that supports pin-change interrupts.



Example Code

The Zebra-Tech D-Opto is used in the menu a la carte example.

1#include <sensors/ZebraTechDOpto.h>
2
3// NOTE: Use -1 for any pins that don't apply or aren't being used.
4const char* DOptoSDI12address = "5"; // The SDI-12 Address of the D-Opto
5const int8_t ZTPower = sensorPowerPin; // Power pin
6const int8_t ZTData = 7; // The SDI-12 data pin
7
8// Create a Zebra Tech DOpto dissolved oxygen sensor object
9ZebraTechDOpto dopto(*DOptoSDI12address, ZTPower, ZTData);
10
11// Create dissolved oxygen percent, dissolved oxygen concentration, and
12// temperature variable pointers for the Zebra Tech
13Variable* dOptoDOpct =
14 new ZebraTechDOpto_DOpct(&dopto, "12345678-abcd-1234-ef00-1234567890ab");
15Variable* dOptoDOmgL =
16 new ZebraTechDOpto_DOmgL(&dopto, "12345678-abcd-1234-ef00-1234567890ab");
17Variable* dOptoTemp =
18 new ZebraTechDOpto_Temp(&dopto, "12345678-abcd-1234-ef00-1234567890ab");

Classes

class ZebraTechDOpto
The Sensor sub-class for the Zebra-Tech D-Opto dissolved oxygen sensor.
class ZebraTechDOpto_Temp
The Variable sub-class used for the temperature output from a Zebra-Tech D-Opto dissolved oxygen sensor.
class ZebraTechDOpto_DOpct
The Variable sub-class used for the dissolved oxygen percent saturation output from a Zebra-Tech D-Opto dissolved oxygen sensor.
class ZebraTechDOpto_DOmgL
The Variable sub-class used for the dissolved oxygen concentration output from a Zebra-Tech D-Opto dissolved oxygen sensor.

Sensor Variable Counts

The number of variables that can be returned by a ZebraTech D-Opto

#define DOPTO_NUM_VARIABLES = 3
Sensor::_numReturnedValues; the D-Opto can report 3 values.
#define DOPTO_INC_CALC_VARIABLES = 0
Sensor::_incCalcValues; we don't calculate any additional values.

Sensor Timing

The sensor timing for a ZebraTech D-Opto

#define DOPTO_WARM_UP_TIME_MS = 275
Sensor::_warmUpTime_ms; the D-Opto warms up in 275ms. Maximum warm-up time in SDI-12 mode: ~250ms, give a bit of extra for safety.
#define DOPTO_STABILIZATION_TIME_MS = 0
Sensor::_stabilizationTime_ms; the D-Opto is stable as soon as it warms up (0ms stabilization).
#define DOPTO_MEASUREMENT_TIME_MS = 5335
Sensor::_measurementTime_ms; the D-Opto takes 5335ms to complete a measurement.
#define DOPTO_EXTRA_WAKE_TIME_MS = 0
Extra wake time required for an SDI-12 sensor between the "break" and the time the command is sent. The D-Opto requires no extra time.

Temperature

The temperature variable from a ZebraTech D-Opto

  • Range is not specified in sensor datasheet
  • Accuracy is ± 0.1°C

ZebraTechDOpto_Temp::ZebraTechDOpto_Temp(ZebraTechDOpto* parentSense, const char* uuid = "", const char* varCode = "DOtempC") explicit

Construct a new ZebraTechDOpto_Temp object.

Parameters
parentSense The parent ZebraTechDOpto 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 "DOtempC".

#define DOPTO_TEMP_RESOLUTION = 2
Decimals places in string representation; temperature should have 2 - resolution is 0.01°C.
#define DOPTO_TEMP_VAR_NUM = 0
Sensor variable number; temperature is stored in sensorValues[0].
#define DOPTO_TEMP_VAR_NAME = "temperature"
Variable name in ODM2 controlled vocabulary; "temperature".
#define DOPTO_TEMP_UNIT_NAME = "degreeCelsius"
Variable unit name in ODM2 controlled vocabulary; "degreeCelsius" (°C)
#define DOPTO_TEMP_DEFAULT_CODE = "DOtempC"
Default variable short code; "DOtempC".

Dissolved Oxygen Percent Saturation

The percent saturation variable from a ZebraTech D-Opto

  • Range is not specified in sensor datasheet
  • Accuracy is 1 % of reading or 0.02PPM, whichever is greater

ZebraTechDOpto_DOpct::ZebraTechDOpto_DOpct(ZebraTechDOpto* parentSense, const char* uuid = "", const char* varCode = "DOpercent") explicit

Construct a new ZebraTechDOpto_DOpct object.

Parameters
parentSense The parent ZebraTechDOpto 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 "DOpercent".

#define DOPTO_DOPCT_RESOLUTION = 2
Decimals places in string representation; dissolved oxygen percent should have 2.
#define DOPTO_DOPCT_VAR_NUM = 1
Sensor variable number; dissolved oxygen percent is stored in sensorValues[1].
#define DOPTO_DOPCT_VAR_NAME = "oxygenDissolvedPercentOfSaturation"
Variable name in ODM2 controlled vocabulary; "oxygenDissolvedPercentOfSaturation".
#define DOPTO_DOPCT_UNIT_NAME = "percent"
Variable unit name in ODM2 controlled vocabulary; "percent" (% saturation)
#define DOPTO_DOPCT_DEFAULT_CODE = "DOpercent"
Default variable short code; "DOpercent".

Dissolved Oxygen Concentration

The DO concentration variable from a ZebraTech D-Opto

  • Range is not specified in sensor datasheet
  • Accuracy is 1 % of reading or 0.02PPM, whichever is greater

ZebraTechDOpto_DOmgL::ZebraTechDOpto_DOmgL(ZebraTechDOpto* parentSense, const char* uuid = "", const char* varCode = "DOppm") explicit

Construct a new ZebraTechDOpto_DOmgL object.

Parameters
parentSense The parent ZebraTechDOpto 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 "DOppm".

#define DOPTO_DOMGL_RESOLUTION = 3
Decimals places in string representation; dissolved oxygen concentration should have 3 - resolution is 0.01 % / 0.001 PPM.
#define DOPTO_DOMGL_VAR_NUM = 2
Sensor variable number; dissolved oxygen concentration is stored in sensorValues[2].
#define DOPTO_DOMGL_VAR_NAME = "oxygenDissolved"
Variable name in ODM2 controlled vocabulary; "oxygenDissolved".
#define DOPTO_DOMGL_UNIT_NAME = "milligramPerLiter"
Variable unit name in ODM2 controlled vocabulary; "milligramPerLiter" (mg/L)
#define DOPTO_DOMGL_DEFAULT_CODE = "DOppm"
Default variable short code; "DOppm".

Define documentation

#define DOPTO_NUM_VARIABLES = 3

Sensor::_numReturnedValues; the D-Opto can report 3 values.


#define DOPTO_INC_CALC_VARIABLES = 0

Sensor::_incCalcValues; we don't calculate any additional values.


#define DOPTO_WARM_UP_TIME_MS = 275

Sensor::_warmUpTime_ms; the D-Opto warms up in 275ms. Maximum warm-up time in SDI-12 mode: ~250ms, give a bit of extra for safety.


#define DOPTO_STABILIZATION_TIME_MS = 0

Sensor::_stabilizationTime_ms; the D-Opto is stable as soon as it warms up (0ms stabilization).


#define DOPTO_MEASUREMENT_TIME_MS = 5335

Sensor::_measurementTime_ms; the D-Opto takes 5335ms to complete a measurement.

  • Excitiation time before measurement: ~5225ms
  • Maximum measurement duration: ~110ms

Obnoxiously, the sensor will not take a "concurrent" measurement and leave the sensor powered on, so we must wait entire ~5200ms exitation time and the 110ms measurement time each time. There is the ability to do a non-concurrent measurement and leave the sensor powered on, in which case the re-measurement takes ~110ms, but doing it that way the sensor would send an interruption when it was finished, possibly colliding with and confusing other sensor results.


#define DOPTO_EXTRA_WAKE_TIME_MS = 0

Extra wake time required for an SDI-12 sensor between the "break" and the time the command is sent. The D-Opto requires no extra time.


#define DOPTO_TEMP_RESOLUTION = 2

Decimals places in string representation; temperature should have 2 - resolution is 0.01°C.


#define DOPTO_TEMP_VAR_NUM = 0

Sensor variable number; temperature is stored in sensorValues[0].


#define DOPTO_TEMP_VAR_NAME = "temperature"

Variable name in ODM2 controlled vocabulary; "temperature".


#define DOPTO_TEMP_UNIT_NAME = "degreeCelsius"

Variable unit name in ODM2 controlled vocabulary; "degreeCelsius" (°C)


#define DOPTO_TEMP_DEFAULT_CODE = "DOtempC"

Default variable short code; "DOtempC".


#define DOPTO_DOPCT_RESOLUTION = 2

Decimals places in string representation; dissolved oxygen percent should have 2.


#define DOPTO_DOPCT_VAR_NUM = 1

Sensor variable number; dissolved oxygen percent is stored in sensorValues[1].


#define DOPTO_DOPCT_VAR_NAME = "oxygenDissolvedPercentOfSaturation"

Variable name in ODM2 controlled vocabulary; "oxygenDissolvedPercentOfSaturation".


#define DOPTO_DOPCT_UNIT_NAME = "percent"

Variable unit name in ODM2 controlled vocabulary; "percent" (% saturation)


#define DOPTO_DOPCT_DEFAULT_CODE = "DOpercent"

Default variable short code; "DOpercent".


#define DOPTO_DOMGL_RESOLUTION = 3

Decimals places in string representation; dissolved oxygen concentration should have 3 - resolution is 0.01 % / 0.001 PPM.


#define DOPTO_DOMGL_VAR_NUM = 2

Sensor variable number; dissolved oxygen concentration is stored in sensorValues[2].


#define DOPTO_DOMGL_VAR_NAME = "oxygenDissolved"

Variable name in ODM2 controlled vocabulary; "oxygenDissolved".


#define DOPTO_DOMGL_UNIT_NAME = "milligramPerLiter"

Variable unit name in ODM2 controlled vocabulary; "milligramPerLiter" (mg/L)


#define DOPTO_DOMGL_DEFAULT_CODE = "DOppm"

Default variable short code; "DOppm".