VEGAPULS C 21 topic

Classes for the VEGAPULS C 21 radar sensor.

Introduction

VEGAPULS C 21 is the ideal sensor for non-contact level measurement in simple applications where a high degree of protection is required. It is particularly suitable for use in water treatment, pumping stations and rain overflow basins, for flow measurement in open channels and level monitoring. In bulk solids the sensors are used in small bulk solids silos or open containers.

The sensor is implemented as a sub-classes of the SDI12Sensors class. It requires a 8 to 30 Vdc power supply, which can be turned off between measurements. It pulls 25 mW in low-power mode and 100 mW in standard mode.

Sensor Datasheet

The specifications and datasheet are available at https://www.vega.com/api/sitecore/DocumentDownload/Handler?documentContainerId=1006748&languageId=2&fileExtension=pdf&softwareVersion=&documentGroupId=58354&version=03-04-2023

Build flags

Sensor Constructor

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

Construct a new VEGAPULS C 21 object.

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

The pin on the mcu controlling power to the VEGA PULS 21 Use -1 if it is continuously powered.

  • The VEGA PULS 21 requires a 8 to 30 Vdc 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 VEGAPULS C 21 is used in the menu a la carte example.

1#include <sensors/VegaPuls21.h>
2
3// NOTE: Use -1 for any pins that don't apply or aren't being used.
4const char* VegaPulsSDI12address = "0"; // The SDI-12 Address of the VegaPuls10
5const int8_t VegaPulsPower = sensorPowerPin; // Power pin
6const int8_t VegaPulsData = 7; // The SDI-12 data pin
7// NOTE: you should NOT take more than one readings. THe sensor already takes
8// and averages 8 by default.
9
10// Create a Campbell VegaPusl21 sensor object
11VegaPuls21 VegaPuls(*VegaPulsSDI12address, VegaPulsPower, VegaPulsData);
12
13// Create stage, distance, temperature, reliability, and error variable pointers
14// for the VegaPuls21
15Variable* VegaPulsStage =
16 new VegaPuls21_Stage(&VegaPuls, "12345678-abcd-1234-ef00-1234567890ab");
17Variable* VegaPulsDistance =
18 new VegaPuls21_Distance(&VegaPuls, "12345678-abcd-1234-ef00-1234567890ab");
19Variable* VegaPulsTemp =
20 new VegaPuls21_Temp(&VegaPuls, "12345678-abcd-1234-ef00-1234567890ab");
21Variable* VegaPulsRelia = new VegaPuls21_Reliability(
22 &VegaPuls, "12345678-abcd-1234-ef00-1234567890ab");
23Variable* VegaPulsError =
24 new VegaPuls21_ErrorCode(&VegaPuls, "12345678-abcd-1234-ef00-1234567890ab");

Classes

class VegaPuls21
The Sensor sub-class for the VEGAPULS C 21 radar level sensor.
class VegaPuls21_Stage
The Variable sub-class used for the temperature output from a VEGAPULS C 21 radar level sensor.
class VegaPuls21_Distance
The Variable sub-class used for the temperature output from a VEGAPULS C 21 radar level sensor.
class VegaPuls21_Temp
The Variable sub-class used for the temperature output from a VEGAPULS C 21 radar level sensor.
class VegaPuls21_Reliability
The Variable sub-class used for the reliability output from a VEGAPULS C 21 radar level sensor.
class VegaPuls21_ErrorCode
The Variable sub-class used for the error code output from a VEGAPULS C 21 radar level sensor.

Sensor Variable Counts

The number of variables that can be returned by the VEGA PULS 21

#define VEGAPULS21_NUM_VARIABLES = 5
Sensor::_numReturnedValues; the VEGA PULS 21 can report 5 values.
#define VEGAPULS21_INC_CALC_VARIABLES = 0
Sensor::_incCalcValues;.

Sensor Timing

The sensor timing for a VEGAPULS C 21

#define VEGAPULS21_WARM_UP_TIME_MS = 5200
Sensor::_warmUpTime_ms; the VEGA PULS 21 warms up in ~5200ms.
#define VEGAPULS21_STABILIZATION_TIME_MS = 0
Sensor::_stabilizationTime_ms; the VEGA PULS 21 is stable as soon as it warms up (0ms stabilization).
#define VEGAPULS21_MEASUREMENT_TIME_MS = 6050
Sensor::_measurementTime_ms; the VEGA PULS 21 takes ~6000ms to complete a measurement.
#define VEGAPULS21_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 VEGA PULS 21 requires no extra time.

Stage

The stage variable from a VEGAPULS C 21

  • Accuracy is ≤ 2 mm (meas. distance > 0.25 m/0.8202 ft)

VegaPuls21_Stage::VegaPuls21_Stage(VegaPuls21* parentSense, const char* uuid = "", const char* varCode = "VegaPulsStage") explicit

Construct a new VegaPuls21_Stage object.

Parameters
parentSense The parent VegaPuls21 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 "VegaPulsStage".

#define VEGAPULS21_STAGE_RESOLUTION = 3
Decimals places in string representation; stage in meters should have 3 - resolution is 1mm.
#define VEGAPULS21_STAGE_VAR_NUM = 0
Sensor variable number; stage is stored in sensorValues[0].
#define VEGAPULS21_STAGE_VAR_NAME = "gageHeight"
Variable name in ODM2 controlled vocabulary; "gageHeight".
#define VEGAPULS21_STAGE_UNIT_NAME = "meter"
Variable unit name in ODM2 controlled vocabulary; "meter" (m)
#define VEGAPULS21_STAGE_DEFAULT_CODE = "VegaPulsStage"
Default variable short code; "VegaPulsStage".

Distance

The distance variable from a VEGAPULS C 21

  • Accuracy is ≤ 2 mm (meas. distance > 0.25 m/0.8202 ft)

VegaPuls21_Distance::VegaPuls21_Distance(VegaPuls21* parentSense, const char* uuid = "", const char* varCode = "VegaPulsDistance") explicit

Construct a new VegaPuls21_Distance object.

Parameters
parentSense The parent VegaPuls21 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 "VegaPulsDistance".

#define VEGAPULS21_DISTANCE_RESOLUTION = 3
Decimals places in string representation; distance in meters should have 3 - resolution is 1mm.
#define VEGAPULS21_DISTANCE_VAR_NUM = 1
Sensor variable number; stage is stored in sensorValues[1].
#define VEGAPULS21_DISTANCE_VAR_NAME = "distance"
Variable name in ODM2 controlled vocabulary; "distance".
#define VEGAPULS21_DISTANCE_UNIT_NAME = "meter"
Variable unit name in ODM2 controlled vocabulary; "meter" (m)
#define VEGAPULS21_DISTANCE_DEFAULT_CODE = "VegaPulsDistance"
Default variable short code; "VegaPulsDistance".

Temperature

The temperature variable from a VEGAPULS C 21

VegaPuls21_Temp::VegaPuls21_Temp(VegaPuls21* parentSense, const char* uuid = "", const char* varCode = "VegaPulsTemp") explicit

Construct a new VegaPuls21_Temp object.

Parameters
parentSense The parent VegaPuls21 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 "VegaPulsTemp".

#define VEGAPULS21_TEMP_RESOLUTION = 1
Decimals places in string representation; temperature should have 1 - resolution is 0.1°C.
#define VEGAPULS21_TEMP_VAR_NUM = 2
Sensor variable number; temperature is stored in sensorValues[2].
#define VEGAPULS21_TEMP_VAR_NAME = "temperature"
Variable name in ODM2 controlled vocabulary; "temperature".
#define VEGAPULS21_TEMP_UNIT_NAME = "degreeCelsius"
Variable unit name in ODM2 controlled vocabulary; "degreeCelsius" (°C)
#define VEGAPULS21_TEMP_DEFAULT_CODE = "VegaPulsTemp"
Default variable short code; "VegaPulsTemp".

Reliability

The reliability variable from a VEGAPULS C 21

VegaPuls21_Reliability::VegaPuls21_Reliability(VegaPuls21* parentSense, const char* uuid = "", const char* varCode = "VegaPulsReliability") explicit

Construct a new VegaPuls21_Reliability object.

Parameters
parentSense The parent VegaPuls21 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 "VegaPulsReliability".

#define VEGAPULS21_RELIABILITY_RESOLUTION = 1
Decimals places in string representation; reliability should have 1 (resolution is 0.1 dB).
#define VEGAPULS21_RELIABILITY_VAR_NUM = 3
Sensor variable number; reliability is stored in sensorValues[3].
#define VEGAPULS21_RELIABILITY_VAR_NAME = "reliability"
Variable name in ODM2 controlled vocabulary; "reliability".
#define VEGAPULS21_RELIABILITY_UNIT_NAME = "decibel"
Variable unit name in ODM2 controlled vocabulary; "decibel" (dB)
#define VEGAPULS21_RELIABILITY_DEFAULT_CODE = "VegaPulsReliability"
Default variable short code; "VegaPulsReliability".

Error Code

The error code variable from a VEGAPULS C 21

  • Significance of error code values is unknown.

VegaPuls21_ErrorCode::VegaPuls21_ErrorCode(VegaPuls21* parentSense, const char* uuid = "", const char* varCode = "VegaPulsError") explicit

Construct a new VegaPuls21_ErrorCode object.

Parameters
parentSense The parent VegaPuls21 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 "VegaPulsError".

#define VEGAPULS21_ERRORCODE_RESOLUTION = 0
Decimals places in string representation; the error code has 0.
#define VEGAPULS21_ERRORCODE_VAR_NUM = 4
Sensor variable number; error code is stored in sensorValues[4].
#define VEGAPULS21_ERRORCODE_VAR_NAME = "instrumentStatusCode"
Variable name in ODM2 controlled vocabulary; "instrumentStatusCode".
#define VEGAPULS21_ERRORCODE_UNIT_NAME = "dimensionless"
Variable unit name in ODM2 controlled vocabulary; "dimensionless".
#define VEGAPULS21_ERRORCODE_DEFAULT_CODE = "VegaPulsError"
Default variable short code; "VegaPulsError".

Define documentation

#define VEGAPULS21_NUM_VARIABLES = 5

Sensor::_numReturnedValues; the VEGA PULS 21 can report 5 values.


#define VEGAPULS21_WARM_UP_TIME_MS = 5200

Sensor::_warmUpTime_ms; the VEGA PULS 21 warms up in ~5200ms.

This is longer than the expected 250ms for a SDI-12 sensor, but I couldn't get a response from the sensor faster than that. The instruction sheet says the warm-up is less than 10s, but also says that the initial tests on power-up can take up to 3 minutes.


#define VEGAPULS21_STABILIZATION_TIME_MS = 0

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


#define VEGAPULS21_MEASUREMENT_TIME_MS = 6050

Sensor::_measurementTime_ms; the VEGA PULS 21 takes ~6000ms to complete a measurement.

Spec sheet says the measurement time is 250ms but when you ask the sensor it says it won't return for 14s. When taking a standard measurement I was getting a result after about 5800-6000 ms.


#define VEGAPULS21_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 VEGA PULS 21 requires no extra time.


#define VEGAPULS21_STAGE_RESOLUTION = 3

Decimals places in string representation; stage in meters should have 3 - resolution is 1mm.


#define VEGAPULS21_STAGE_VAR_NUM = 0

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


#define VEGAPULS21_STAGE_VAR_NAME = "gageHeight"

Variable name in ODM2 controlled vocabulary; "gageHeight".


#define VEGAPULS21_STAGE_UNIT_NAME = "meter"

Variable unit name in ODM2 controlled vocabulary; "meter" (m)


#define VEGAPULS21_STAGE_DEFAULT_CODE = "VegaPulsStage"

Default variable short code; "VegaPulsStage".


#define VEGAPULS21_DISTANCE_RESOLUTION = 3

Decimals places in string representation; distance in meters should have 3 - resolution is 1mm.


#define VEGAPULS21_DISTANCE_VAR_NUM = 1

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


#define VEGAPULS21_DISTANCE_DEFAULT_CODE = "VegaPulsDistance"

Default variable short code; "VegaPulsDistance".


#define VEGAPULS21_TEMP_RESOLUTION = 1

Decimals places in string representation; temperature should have 1 - resolution is 0.1°C.


#define VEGAPULS21_TEMP_VAR_NUM = 2

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


#define VEGAPULS21_TEMP_VAR_NAME = "temperature"

Variable name in ODM2 controlled vocabulary; "temperature".


#define VEGAPULS21_TEMP_UNIT_NAME = "degreeCelsius"

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


#define VEGAPULS21_TEMP_DEFAULT_CODE = "VegaPulsTemp"

Default variable short code; "VegaPulsTemp".


#define VEGAPULS21_RELIABILITY_RESOLUTION = 1

Decimals places in string representation; reliability should have 1 (resolution is 0.1 dB).


#define VEGAPULS21_RELIABILITY_VAR_NUM = 3

Sensor variable number; reliability is stored in sensorValues[3].


#define VEGAPULS21_RELIABILITY_VAR_NAME = "reliability"

Variable name in ODM2 controlled vocabulary; "reliability".


#define VEGAPULS21_RELIABILITY_UNIT_NAME = "decibel"

Variable unit name in ODM2 controlled vocabulary; "decibel" (dB)


#define VEGAPULS21_RELIABILITY_DEFAULT_CODE = "VegaPulsReliability"

Default variable short code; "VegaPulsReliability".


#define VEGAPULS21_ERRORCODE_RESOLUTION = 0

Decimals places in string representation; the error code has 0.


#define VEGAPULS21_ERRORCODE_VAR_NUM = 4

Sensor variable number; error code is stored in sensorValues[4].


#define VEGAPULS21_ERRORCODE_VAR_NAME = "instrumentStatusCode"

Variable name in ODM2 controlled vocabulary; "instrumentStatusCode".


#define VEGAPULS21_ERRORCODE_UNIT_NAME = "dimensionless"

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


#define VEGAPULS21_ERRORCODE_DEFAULT_CODE = "VegaPulsError"

Default variable short code; "VegaPulsError".