Humidity

Electronic humidity sensors (hydrometer) measure humidity by measuring the capacitance or resistance of air samples. This sensor comes packaged with the BME280 integrated environmental unit, only available on MetaEnvironment boards, and is accessible through the IHumidityBme280 interface.

using MbientLab.MetaWear.Sensor;

IHumidityBme280 humidity = metawear.GetModule<IHumidityBme280>();

Configuration

For humidity measurements, oversampling can be used to reduce the noise. Oversampling modes are set with Configure method.

using MbientLab.MetaWear.Sensor;
using MbientLab.MetaWear.Sensor.BarometerBosch;

import com.mbientlab.metawear.module.HumidityBme280.OversamplingMode;

// set to ultra high oversampling
humidity.Configure(Oversampling.UltraHigh);

Humidity Data

Relative humidity data is a float value from 0 to 100 percent and is represented as a forced data producer.

await humidity.Percentage.AddRouteAsync(source =>
    source.Stream(data => Console.WriteLine("Humidity = " + data.Value<float>()))
);