Decagon CTD-10 topic

Classes for the Decagon CTD-10 conductivity, temperature, and depth sensor.

Introduction

The Decagon CTD is implemented as a sub-classes of the SDI12Sensors class. It requires a 3.5-12V power supply, which can be turned off between measurements. While contrary to the manual, they will run with power as low as 3.3V.

Sensor Datasheet

Documentation for the SDI-12 Protocol commands and responses for the Decagon CTD are archived in the ModularSensors wiki.

Build flags

Sensor Constructor

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

Construct a new Decagon CTD object.

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

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

  • The CTD-10 requires a 3.5-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 Decagon CTD-10 is used in the menu a la carte example.

1#include <sensors/DecagonCTD.h>
2
3// NOTE: Use -1 for any pins that don't apply or aren't being used.
4const char* CTDSDI12address = "1"; // The SDI-12 Address of the CTD
5const uint8_t CTDNumberReadings = 6; // The number of readings to average
6const int8_t CTDPower = sensorPowerPin; // Power pin
7const int8_t CTDData = 7; // The SDI-12 data pin
8
9// Create a Decagon CTD sensor object
10DecagonCTD ctd(*CTDSDI12address, CTDPower, CTDData, CTDNumberReadings);
11
12// Create conductivity, temperature, and depth variable pointers for the CTD
13Variable* ctdCond = new DecagonCTD_Cond(&ctd,
14 "12345678-abcd-1234-ef00-1234567890ab");
15Variable* ctdTemp = new DecagonCTD_Temp(&ctd,
16 "12345678-abcd-1234-ef00-1234567890ab");
17Variable* ctdDepth =
18 new DecagonCTD_Depth(&ctd, "12345678-abcd-1234-ef00-1234567890ab");

Classes

class DecagonCTD
The Sensor sub-class for the Decagon CTD-10 conductivity, temperature, and depth sensor.
class DecagonCTD_Cond
The Variable sub-class used for the conductivity output from a Decagon CTD-10 3-in-1 water level sensor..
class DecagonCTD_Temp
The Variable sub-class used for the temperature output from a Decagon CTD-10 3-in-1 water level sensor..
class DecagonCTD_Depth
The Variable sub-class used for the depth output from a Decagon CTD-10 3-in-1 water level sensor..

Sensor Variable Counts

The number of variables that can be returned by Decagon CTD

#define CTD_NUM_VARIABLES = 3
Sensor::_numReturnedValues; the CTD can report 3 values.
#define CTD_INC_CALC_VARIABLES = 0
Sensor::_incCalcValues; we don't calculate any additional values.

Sensor Timing

The sensor timing for a Decagon CTD-10

#define CTD_WARM_UP_TIME_MS = 500
Sensor::_warmUpTime_ms; maximum warm-up time in SDI-12 mode: 500ms.
#define CTD_STABILIZATION_TIME_MS = 0
Sensor::_stabilizationTime_ms; the CTD is stable as soon as it warms up (0ms stabilization).
#define CTD_MEASUREMENT_TIME_MS = 500
Sensor::_measurementTime_ms; maximum measurement duration: 500ms.
#define CTD_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 CTD requires no extra time.

Conductivity

The conductivity variable from a Decagon CTD-10

  • Range is 0 – 120 mS/cm (bulk)
  • Accuracy is ±0.01mS/cm or ±10% (whichever is greater)

DecagonCTD_Cond::DecagonCTD_Cond(DecagonCTD* parentSense, const char* uuid = "", const char* varCode = "CTDcond") explicit

Construct a new DecagonCTD_Cond object.

Parameters
parentSense The parent DecagonCTD 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 "CTDcond".

#define CTD_COND_RESOLUTION = 1
Decimals places in string representation; conductivity should have 1.
#define CTD_COND_VAR_NUM = 2
Sensor variable number; conductivity is stored in sensorValues[2].
#define CTD_COND_VAR_NAME = "specificConductance"
Variable name in ODM2 controlled vocabulary; "specificConductance".
#define CTD_COND_UNIT_NAME = "microsiemenPerCentimeter"
Variable unit name in ODM2 controlled vocabulary; "microsiemenPerCentimeter" (µS/cm)
#define CTD_COND_DEFAULT_CODE = "CTDcond"
Default variable short code; "CTDcond".

Temperature

The temperature variable from a Decagon CTD-10

  • Range is -11°C to +49°C
  • Accuracy is ±1°C

DecagonCTD_Temp::DecagonCTD_Temp(DecagonCTD* parentSense, const char* uuid = "", const char* varCode = "CTDtemp") explicit

Construct a new DecagonCTD_Temp object.

Parameters
parentSense The parent DecagonCTD 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 "CTDtemp".

#define CTD_TEMP_RESOLUTION = 2
Decimals places in string representation; temperature should have 2.
#define CTD_TEMP_VAR_NUM = 1
Sensor variable number; temperature is stored in sensorValues[1].
#define CTD_TEMP_VAR_NAME = "temperature"
Variable name in ODM2 controlled vocabulary; "temperature".
#define CTD_TEMP_UNIT_NAME = "degreeCelsius"
Variable unit name in ODM2 controlled vocabulary; "degreeCelsius" (°C)
#define CTD_TEMP_DEFAULT_CODE = "CTDtemp"
Default variable short code; "CTDtemp".

Water Depth

The water depth variable from a Decagon CTD-10

  • Range is 0 to 5 m or 0 to 10 m, depending on model
  • Accuracy is ±0.05% of full scale

DecagonCTD_Depth::DecagonCTD_Depth(DecagonCTD* parentSense, const char* uuid = "", const char* varCode = "CTDdepth") explicit

Construct a new DecagonCTD_Depth object.

Parameters
parentSense The parent DecagonCTD 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 "CTDdepth".

#define CTD_DEPTH_RESOLUTION = 1
Decimals places in string representation; depth should have 1.
#define CTD_DEPTH_VAR_NUM = 0
Sensor variable number; depth is stored in sensorValues[0].
#define CTD_DEPTH_VAR_NAME = "waterDepth"
Variable name in ODM2 controlled vocabulary; "waterDepth".
#define CTD_DEPTH_UNIT_NAME = "millimeter"
Variable unit name in ODM2 controlled vocabulary; "millimeter".
#define CTD_DEPTH_DEFAULT_CODE = "CTDdepth"
Default variable short code; "CTDdepth".

Define documentation

#define CTD_NUM_VARIABLES = 3

Sensor::_numReturnedValues; the CTD can report 3 values.


#define CTD_INC_CALC_VARIABLES = 0

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


#define CTD_WARM_UP_TIME_MS = 500

Sensor::_warmUpTime_ms; maximum warm-up time in SDI-12 mode: 500ms.


#define CTD_STABILIZATION_TIME_MS = 0

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


#define CTD_MEASUREMENT_TIME_MS = 500

Sensor::_measurementTime_ms; maximum measurement duration: 500ms.


#define CTD_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 CTD requires no extra time.


#define CTD_COND_RESOLUTION = 1

Decimals places in string representation; conductivity should have 1.

0 are reported, adding extra digit to resolution to allow the proper number of significant figures for averaging - resolution is 0.001 mS/cm = 1 µS/cm


#define CTD_COND_VAR_NUM = 2

Sensor variable number; conductivity is stored in sensorValues[2].


#define CTD_COND_VAR_NAME = "specificConductance"

Variable name in ODM2 controlled vocabulary; "specificConductance".


#define CTD_COND_UNIT_NAME = "microsiemenPerCentimeter"

Variable unit name in ODM2 controlled vocabulary; "microsiemenPerCentimeter" (µS/cm)


#define CTD_COND_DEFAULT_CODE = "CTDcond"

Default variable short code; "CTDcond".


#define CTD_TEMP_RESOLUTION = 2

Decimals places in string representation; temperature should have 2.

1 is reported, adding extra digit to resolution to allow the proper number of significant figures for averaging - resolution is 0.1°C


#define CTD_TEMP_VAR_NUM = 1

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


#define CTD_TEMP_VAR_NAME = "temperature"

Variable name in ODM2 controlled vocabulary; "temperature".


#define CTD_TEMP_UNIT_NAME = "degreeCelsius"

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


#define CTD_TEMP_DEFAULT_CODE = "CTDtemp"

Default variable short code; "CTDtemp".


#define CTD_DEPTH_RESOLUTION = 1

Decimals places in string representation; depth should have 1.

0 are reported, adding extra digit to resolution to allow the proper number of significant figures for averaging - resolution is 2 mm


#define CTD_DEPTH_VAR_NUM = 0

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


#define CTD_DEPTH_VAR_NAME = "waterDepth"

Variable name in ODM2 controlled vocabulary; "waterDepth".


#define CTD_DEPTH_UNIT_NAME = "millimeter"

Variable unit name in ODM2 controlled vocabulary; "millimeter".


#define CTD_DEPTH_DEFAULT_CODE = "CTDdepth"

Default variable short code; "CTDdepth".