ModularSensors > Files > src / sensors / SensirionSHT4x.h

SensirionSHT4x.h file

Contains the SensirionSHT4x sensor subclass and the variable subclasses SensirionSHT4x_Humidity and SensirionSHT4x_Temp.

These are used for the Sensirion SHT40, SHT41, and SHT45 capacitive humidity and temperature sensor.

This depends on the Adafruit SHT40 library.

Classes

class SensirionSHT4x
The Sensor sub-class for the Sensirion SHT4x.
class SensirionSHT4x_Humidity
The Variable sub-class used for the relative humidity output from an Sensirion SHT4x.
class SensirionSHT4x_Temp
The Variable sub-class used for the temperature output from an Sensirion SHTx0.

Defines

#define SHT4X_NUM_VARIABLES = 2
Sensor::_numReturnedValues; the SHT4x can report 2 values.
#define SHT4X_INC_CALC_VARIABLES = 0
Sensor::_incCalcValues; we don't calculate any additional values.

Sensor Timing

The sensor timing for an Sensirion SHT4x

#define SHT4X_WARM_UP_TIME_MS = 1
Sensor::_warmUpTime_ms; SHT4x warms up in 0.3ms (typical) and soft-resets in 1ms (max).
#define SHT4X_STABILIZATION_TIME_MS = 0
Sensor::_stabilizationTime_ms; SHT4x is assumed to be immediately stable.
#define SHT4X_MEASUREMENT_TIME_MS = 9
Sensor::_measurementTime_ms; SHT4x takes 8.2ms (max) to complete a measurement at the highest precision. At medium precision measurement time is 4.5ms (max) and it is 1.7ms (max) at low precision.

Humidity

The humidity variable from an Sensirion SHT4x

  • Range is 0 to 100% RH
  • Accuracy is ± 1.8 % RH (typical)

SensirionSHT4x_Humidity(SensirionSHT4x* parentSense, const char* uuid = "", const char* varCode = SHT4X_HUMIDITY_DEFAULT_CODE) explicit

Construct a new SensirionSHT4x_Humidity object.

Parameters
parentSense The parent SensirionSHT4x 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 "SHT4xHumidity".

#define SHT4X_HUMIDITY_RESOLUTION = 2
Decimals places in string representation; humidity should have 2 (0.01 % RH).
#define SHT4X_HUMIDITY_VAR_NUM = 0
Sensor variable number; humidity is stored in sensorValues[0].
#define SHT4X_HUMIDITY_VAR_NAME = "relativeHumidity"
Variable name in ODM2 controlled vocabulary; "relativeHumidity".
#define SHT4X_HUMIDITY_UNIT_NAME = "percent"
Variable unit name in ODM2 controlled vocabulary; "percent" (percent relative humidity)
#define SHT4X_HUMIDITY_DEFAULT_CODE = "SHT4xHumidity"
Default variable short code; "SHT4xHumidity".

Temperature

The temperature variable from an Sensirion SHT4x

  • Range is -40°C to +125°C
  • Accuracy is ±0.2°C

SensirionSHT4x_Temp(SensirionSHT4x* parentSense, const char* uuid = "", const char* varCode = SHT4X_TEMP_DEFAULT_CODE) explicit

Construct a new SensirionSHT4x_Temp object.

Parameters
parentSense The parent SensirionSHT4x 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 "SHT4xTemp".

#define SHT4X_TEMP_RESOLUTION = 2
Decimals places in string representation; humidity should have 2 (0.01 °C).
#define SHT4X_TEMP_VAR_NUM = 1
Sensor variable number; temperature is stored in sensorValues[1].
#define SHT4X_TEMP_VAR_NAME = "temperature"
Variable name in ODM2 controlled vocabulary; "temperature".
#define SHT4X_TEMP_UNIT_NAME = "degreeCelsius"
Variable unit name in ODM2 controlled vocabulary; "degreeCelsius" (°C)
#define SHT4X_TEMP_DEFAULT_CODE = "SHT4xTemp"
Default variable short code; "SHT4xTemp".