EnvironmentalUtils.h File Reference

Environmental Sensor Utilities. More...

+ This graph shows which files directly or indirectly include this file:


Retcode_T SetAmbientTemperatureOffset (float T_offset)
 Register the ambient temperature offset in degree C. More...
float GetAmbientTemperatureOffset (void)
 Returns the ambient temperature offset. More...
float ComputeAmbientTemperature (float T_sensor)
 Compute Ambient Temperature. More...
float ComputeAmbientHumidity (float rH_sensor, float T_sensor, float T_ambient)
 Compute Ambient Humidity. More...

Detailed Description

Environmental Sensor Utilities

The environmental sensor utilities consists of APIs that aid in compensating effects due to self-heating of the XDK during normal conditions

As any electronic component, the sensor is subject to self-heating, which can be from the sensor itself, as well as from other components used at the time of measurement.

Unfortunately, this self-heating strongly depends on the usage, and as the XDK can be freely programmed, we cannot provide a universal compensation algorithm.

The accuracy of the humidity measurement is strongly related the temperature; as relative humidity is calculated using the temperature reading.

Hence, a higher temperature leads to a lower relative humidity.

Once the temperature compensation is done, the relative humidity can be calculated using the temperature difference.

Function Documentation

float ComputeAmbientHumidity ( float  rH_sensor,
float  T_sensor,
float  T_ambient 

Computes the ambient relative humidity using the Tetens formula for estimation of ambient vapor pressure

Compensation formula:

Rh_ambient = Ew(T_sensor) / Ew(T_ambient) * Rh_sensor

The vapor pressure of water approximation used is the Tetens formula with a validity range between -10 degree C and 75 degree C
Sensor values are measured inside the device housing
This function has a division by zero in the case where T_sensor or T_ambient is equal to -TETENS_BETA_NEGATIVE (-265.5 degree C)
[in]rH_sensorRelative humidity measured by the sensor
[in]T_sensorTemperature in degree C measured by the sensor
[in]T_ambientTemperature in degree C measured or estimated outside
rH_ambient Computed ambient relative humidity

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float ComputeAmbientTemperature ( float  T_sensor)

Ambient Temperature is calculated by adding an offset to the measured sensor temperature

Compensation formula:

T_offset = T_ambient - T_sensor

T_ambient = T_sensor + T_offset

This API provides a default value for the temperature offset value.
[in]T_sensorTemperature in \C measured inside
T_ambient Calculated ambient temperature

+ Here is the caller graph for this function:

float GetAmbientTemperatureOffset ( void  )
Ambient Temperature Offset
Retcode_T SetAmbientTemperatureOffset ( float  T_offset)
returnCode Return code indicating state and success of the operation
Return values
RETCODE_OKoperation was successful
RETCODE_INVALID_PARAMInvalid Temperature offset

+ Here is the caller graph for this function:

This documentation file has been automatically generated on Fri Oct 4 2019 03:47:29 by doxygen 1.8.8