VEGAPULS C 21 topic
- Introduction
- Sensor Datasheet
- Build flags
- Sensor Constructor
- Example Code
- Reference
- Detailed Descriptions
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:/
Build flags
Sensor Constructor
Construct a new VEGAPULS C 21 object. The pin on the mcu controlling power to the VEGA PULS 21 Use -1 if it is continuously powered. 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.
VegaPuls21::
Parameters
SDI12address
The SDI-12 address of the VEGA PULS 21; can be a char, char*, or int.
powerPin
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.
Example Code
The VEGAPULS C 21 is used in the menu a la carte example.
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)
Construct a new VegaPuls21_
VegaPuls21_
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)
Construct a new VegaPuls21_
VegaPuls21_
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
Construct a new VegaPuls21_
VegaPuls21_
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
Construct a new VegaPuls21_
VegaPuls21_
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.
Construct a new VegaPuls21_
VegaPuls21_
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
#include <src/sensors/VegaPuls21.h>
Sensor::
#define VEGAPULS21_INC_CALC_VARIABLES = 0
#include <src/sensors/VegaPuls21.h>
#define VEGAPULS21_WARM_UP_TIME_MS = 5200
#include <src/sensors/VegaPuls21.h>
Sensor::
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
#include <src/sensors/VegaPuls21.h>
Sensor::
#define VEGAPULS21_MEASUREMENT_TIME_MS = 6050
#include <src/sensors/VegaPuls21.h>
Sensor::
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
#include <src/sensors/VegaPuls21.h>
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
#include <src/sensors/VegaPuls21.h>
Decimals places in string representation; stage in meters should have 3 - resolution is 1mm.
#define VEGAPULS21_STAGE_VAR_NUM = 0
#include <src/sensors/VegaPuls21.h>
Sensor variable number; stage is stored in sensorValues[0].
#define VEGAPULS21_STAGE_VAR_NAME = "gageHeight"
#include <src/sensors/VegaPuls21.h>
Variable name in ODM2 controlled vocabulary; "gageHeight".
#define VEGAPULS21_STAGE_UNIT_NAME = "meter"
#include <src/sensors/VegaPuls21.h>
Variable unit name in ODM2 controlled vocabulary; "meter" (m)
#define VEGAPULS21_STAGE_DEFAULT_CODE = "VegaPulsStage"
#include <src/sensors/VegaPuls21.h>
Default variable short code; "VegaPulsStage".
#define VEGAPULS21_DISTANCE_RESOLUTION = 3
#include <src/sensors/VegaPuls21.h>
Decimals places in string representation; distance in meters should have 3 - resolution is 1mm.
#define VEGAPULS21_DISTANCE_VAR_NUM = 1
#include <src/sensors/VegaPuls21.h>
Sensor variable number; stage is stored in sensorValues[1].
#define VEGAPULS21_DISTANCE_VAR_NAME = "distance"
#include <src/sensors/VegaPuls21.h>
Variable name in ODM2 controlled vocabulary; "distance".
#define VEGAPULS21_DISTANCE_UNIT_NAME = "meter"
#include <src/sensors/VegaPuls21.h>
Variable unit name in ODM2 controlled vocabulary; "meter" (m)
#define VEGAPULS21_DISTANCE_DEFAULT_CODE = "VegaPulsDistance"
#include <src/sensors/VegaPuls21.h>
Default variable short code; "VegaPulsDistance".
#define VEGAPULS21_TEMP_RESOLUTION = 1
#include <src/sensors/VegaPuls21.h>
Decimals places in string representation; temperature should have 1 - resolution is 0.1°C.
#define VEGAPULS21_TEMP_VAR_NUM = 2
#include <src/sensors/VegaPuls21.h>
Sensor variable number; temperature is stored in sensorValues[2].
#define VEGAPULS21_TEMP_VAR_NAME = "temperature"
#include <src/sensors/VegaPuls21.h>
Variable name in ODM2 controlled vocabulary; "temperature".
#define VEGAPULS21_TEMP_UNIT_NAME = "degreeCelsius"
#include <src/sensors/VegaPuls21.h>
Variable unit name in ODM2 controlled vocabulary; "degreeCelsius" (°C)
#define VEGAPULS21_TEMP_DEFAULT_CODE = "VegaPulsTemp"
#include <src/sensors/VegaPuls21.h>
Default variable short code; "VegaPulsTemp".
#define VEGAPULS21_RELIABILITY_RESOLUTION = 1
#include <src/sensors/VegaPuls21.h>
Decimals places in string representation; reliability should have 1 (resolution is 0.1 dB).
#define VEGAPULS21_RELIABILITY_VAR_NUM = 3
#include <src/sensors/VegaPuls21.h>
Sensor variable number; reliability is stored in sensorValues[3].
#define VEGAPULS21_RELIABILITY_VAR_NAME = "reliability"
#include <src/sensors/VegaPuls21.h>
Variable name in ODM2 controlled vocabulary; "reliability".
#define VEGAPULS21_RELIABILITY_UNIT_NAME = "decibel"
#include <src/sensors/VegaPuls21.h>
Variable unit name in ODM2 controlled vocabulary; "decibel" (dB)
#define VEGAPULS21_RELIABILITY_DEFAULT_CODE = "VegaPulsReliability"
#include <src/sensors/VegaPuls21.h>
Default variable short code; "VegaPulsReliability".
#define VEGAPULS21_ERRORCODE_RESOLUTION = 0
#include <src/sensors/VegaPuls21.h>
Decimals places in string representation; the error code has 0.
#define VEGAPULS21_ERRORCODE_VAR_NUM = 4
#include <src/sensors/VegaPuls21.h>
Sensor variable number; error code is stored in sensorValues[4].
#define VEGAPULS21_ERRORCODE_VAR_NAME = "instrumentStatusCode"
#include <src/sensors/VegaPuls21.h>
Variable name in ODM2 controlled vocabulary; "instrumentStatusCode".
#define VEGAPULS21_ERRORCODE_UNIT_NAME = "dimensionless"
#include <src/sensors/VegaPuls21.h>
Variable unit name in ODM2 controlled vocabulary; "dimensionless".
#define VEGAPULS21_ERRORCODE_DEFAULT_CODE = "VegaPulsError"
#include <src/sensors/VegaPuls21.h>
Default variable short code; "VegaPulsError".