Characteristic Locus
Inheritance System.Object > GroveTH02
Implements IAtmosphericSensor ITemperatureSensor IHumiditySensor
Namespace Meadow.Foundation.Sensors.Atmospheric
Assembly GroveTH02.dll

Syntax

public class GroveTH02 : FilterableObservableBase<AtmosphericConditionChangeResult, AtmosphericConditions>, IAtmosphericSensor, ITemperatureSensor, IHumiditySensor

Remarks

This is a multifunctional sensor that gives you temperature and relative humidity information at the same time with I2C interface. It utilizes a TH02 sensor that can meet measurement needs of general purposes. It provides reliable readings when environment humidity condition in between 0-80% RH, and temperature condition in between 0-70°C, covering needs in most home and daily applications that don't contain extreme conditions.

Examples

An example will be available once the driver is implemented.

Example Circuit

Constructors

View Source

GroveTH02(II2cBus, Byte)

Create a new GroveTH02 object using the default parameters for the component.

Declaration
public GroveTH02(II2cBus i2cBus, byte address = 64)

Parameters

Type Name Description
II2cBus i2cBus

I2C bus (default = 100 KHz).

System.Byte address

Address of the Grove TH02 (default = 0x4-).

Fields

View Source

MinimumPollingPeriod

Minimum value that should be used for the polling frequency.

Declaration
public const ushort MinimumPollingPeriod = 200

Field Value

Type Description
System.UInt16

Properties

View Source

Conditions

The AtmosphericConditions from the last reading.

Declaration
public AtmosphericConditions Conditions { get; protected set; }

Property Value

Type Description
AtmosphericConditions
View Source

HeaterOn

Get / set the heater status.

Declaration
public bool HeaterOn { get; set; }

Property Value

Type Description
System.Boolean
View Source

Humidity

The humidity, in percent relative humidity, from the last reading..

Declaration
public float Humidity { get; }

Property Value

Type Description
System.Single
View Source

IsSampling

Gets a value indicating whether the analog input port is currently sampling the ADC. Call StartSampling() to spin up the sampling process.

Declaration
public bool IsSampling { get; protected set; }

Property Value

Type Description
System.Boolean

true if sampling; otherwise, false.

View Source

Temperature

The temperature, in degrees celsius (ºC), from the last reading.

Declaration
public float Temperature { get; }

Property Value

Type Description
System.Single

Methods

View Source

RaiseChangedAndNotify(AtmosphericConditionChangeResult)

Declaration
protected void RaiseChangedAndNotify(AtmosphericConditionChangeResult changeResult)

Parameters

Type Name Description
AtmosphericConditionChangeResult changeResult
View Source

Read()

Convenience method to get the current sensor readings. For frequent reads, use StartSampling() and StopSampling() in conjunction with the SampleBuffer.

Declaration
public Task<AtmosphericConditions> Read()

Returns

Type Description
System.Threading.Tasks.Task<AtmosphericConditions>
View Source

StartUpdating(Int32)

Declaration
public void StartUpdating(int standbyDuration = 1000)

Parameters

Type Name Description
System.Int32 standbyDuration
View Source

StopUpdating()

Stops sampling the temperature.

Declaration
public void StopUpdating()

Events

View Source

Updated

Declaration
public event EventHandler<AtmosphericConditionChangeResult> Updated

Event Type

Type Description
System.EventHandler<AtmosphericConditionChangeResult>