Open source UWP library for communication with Sensirion Humidity Sensor SHT85.
This library targets UWP IoT projects! Download directly from NuGet Rca.Sht85Lib on NuGet.
- SingleShot support (temperature and rel. humidity)
- Periodic data acquisition support incl. timestamp
- Control sensor heater
- Read serial and status-register
- Physics calculator for:
- Dew point
- Absolute humidity
- Vapour-pressure
- Saturation-vapour-pressure
Download the source from GitHub or get the compiled assembly from NuGet Rca.Sht85Lib on NuGet.
All measured and calculated values are of the data type double
and are given in the following units:
Value | Unit | Range |
---|---|---|
Temperature | °C | |
Relative humidity | %RH | 0..100 |
Absolute humidity | % | 0..100 |
Dew point | °C | |
Vapour pressure | hPa | |
Saturation vapour pressure | hPa |
In the following a few basic usage examples of the library.
In this example is the I2C address of conneted SHT85 sensor set to default (0x44 factory-fixed):
var mySht85Sensor = new Rca.Sht85Lib.Sht85();
Perform a single reading with default repeatability "low":
var measData = mySht85Sensor.SingleShot(); //Tuple<double, double>
var temperature = measData.Item1; //double
var humidity = measData.Item2; //double
Start the periodic data acquisition mode with specified measure mode:
void StartPeriodicDataAcquisitionMode()
{
//...
mySht85Sensor.NewMeasData += mySht85Sensor_NewMeasData;
mySht85Sensor.StartPeriodicDataAcquisitionMode(PeriodicMeasureModes.High10Hz);
//...
}
Method to receive the NewMeasData
event. The update rate depends on the selected measure mode and the hardware runtimes:
void mySht85Sensor_NewMeasData(Tuple<DateTime, double, double> measData)
{
var timeStamp = measData.Item1; //DateTime object
var temperature = measData.Item2; //double
var humidity = measData.Item3; //double
}
The library also offers a calculator, which offers the possibility to calculate further sizes.
measData
is an Tuple<double, double>
object (Item1: temperature in °C; Item2: rel. humidity in %RH), e.g. provided by SigleShot()
.
var myCalculator = new Rca.Sht85Lib.Physics.Calculator();
var dewPoint = myCalculator.DewPoint(measData); //double
var absHumidity = myCalculator.AbsoluteHumidity(measData); //double
This library is made possible by contributions from:
- Elias Rümmler (@rmmlr) - core contributor
Rca.Sht85Lib is licensed under MIT. Refer to LICENSE.txt for more information.
Contributions are welcome. Fork this repository and send a pull request if you have something useful to add.
- Rca.EzoDeviceLib - Another sensor library for water analytics with Atlas Scientific EZO modules.