Remarks

Dht10
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Atmospheric.Dhtxx

The DHT10 is a low-cost humidity and temperature sensor that communicates over the I2C bus.

-40 to 80 celius +/- 0.5 degrees 0 to 99.9% humidity +/- 3% relative humidity

Code Example

public class MeadowApp : App<F7Micro, MeadowApp>
{
    Dht12 sensor;

    public MeadowApp()
    {
        sensor = new Dht12(Device.CreateI2cBus());

        sensor.StartUpdating();

        sensor.Updated += SensorUpdated;
    }

    void SensorUpdated(object sender, Meadow.Peripherals.Sensors.Atmospheric.AtmosphericConditionChangeResult e)
    {
        Console.WriteLine($"Humidity: {e.New.Humidity}%, Temperature: {e.New.Temperature}°C");
    }
}

Sample projects available on GitHub

Wiring Example

To wire a DHT10 to your Meadow board, connect the following:

DHT12 Meadow Pin
GND GND
VCC 3V3
SCL D08 (SCL Pin)
SDA D07 (SDA Pin)
Characteristic Locus
Inheritance System.Object ObservableBase<System.ValueTuple<System.Nullable<Units.Temperature>, System.Nullable<RelativeHumidity>>> SensorBase<System.ValueTuple<System.Nullable<Units.Temperature>, System.Nullable<RelativeHumidity>>> SamplingSensorBase<System.ValueTuple<System.Nullable<Units.Temperature>, System.Nullable<RelativeHumidity>>> ByteCommsSensorBase<System.ValueTuple<System.Nullable<Units.Temperature>, System.Nullable<RelativeHumidity>>> DhtBase > Dht10
Implements IDisposable ITemperatureSensor IHumiditySensor
Inherited Members DhtBase.TemperatureUpdated DhtBase.HumidityUpdated DhtBase.Temperature DhtBase.Humidity DhtBase.WasLastReadSuccessful DhtBase.RaiseEventsAndNotify(IChangeResult<ValueTuple<Nullable<Units.Temperature>, Nullable<RelativeHumidity>>>) DhtBase.ReadSensor() ByteCommsSensorBase<(Nullable<Units.Temperature> Temperature, Nullable<RelativeHumidity> Humidity)>.Peripheral ByteCommsSensorBase<(Nullable<Units.Temperature> Temperature, Nullable<RelativeHumidity> Humidity)>.ReadBuffer ByteCommsSensorBase<(Nullable<Units.Temperature> Temperature, Nullable<RelativeHumidity> Humidity)>.WriteBuffer ByteCommsSensorBase<(Nullable<Units.Temperature> Temperature, Nullable<RelativeHumidity> Humidity)>.Init(Int32, Int32) ByteCommsSensorBase<(Nullable<Units.Temperature> Temperature, Nullable<RelativeHumidity> Humidity)>.Dispose(Boolean) ByteCommsSensorBase<(Nullable<Units.Temperature> Temperature, Nullable<RelativeHumidity> Humidity)>.Dispose() SamplingSensorBase<(Nullable<Units.Temperature> Temperature, Nullable<RelativeHumidity> Humidity)>.StartUpdating(Nullable<TimeSpan>) SamplingSensorBase<(Nullable<Units.Temperature> Temperature, Nullable<RelativeHumidity> Humidity)>.StopUpdating() SensorBase<(Nullable<Units.Temperature> Temperature, Nullable<RelativeHumidity> Humidity)>.Updated SensorBase<(Nullable<Units.Temperature> Temperature, Nullable<RelativeHumidity> Humidity)>.samplingLock SensorBase<(Nullable<Units.Temperature> Temperature, Nullable<RelativeHumidity> Humidity)>.SamplingTokenSource SensorBase<(Nullable<Units.Temperature> Temperature, Nullable<RelativeHumidity> Humidity)>.Conditions SensorBase<(Nullable<Units.Temperature> Temperature, Nullable<RelativeHumidity> Humidity)>.IsSampling SensorBase<(Nullable<Units.Temperature> Temperature, Nullable<RelativeHumidity> Humidity)>.UpdateInterval SensorBase<(Nullable<Units.Temperature> Temperature, Nullable<RelativeHumidity> Humidity)>.ReadSensor() SensorBase<(Nullable<Units.Temperature> Temperature, Nullable<RelativeHumidity> Humidity)>.RaiseEventsAndNotify(IChangeResult<>) SensorBase<(Nullable<Units.Temperature> Temperature, Nullable<RelativeHumidity> Humidity)>.Read() ObservableBase<(Nullable<Units.Temperature> Temperature, Nullable<RelativeHumidity> Humidity)>.observers ObservableBase<(Nullable<Units.Temperature> Temperature, Nullable<RelativeHumidity> Humidity)>.NotifyObservers(IChangeResult<>) Meadow.Foundation.ObservableBase<System.ValueTuple<System.Nullable<Units.Temperature>, System.Nullable<RelativeHumidity>>>.Subscribe(IObserver<>) Meadow.Foundation.ObservableBase<System.ValueTuple<System.Nullable<Units.Temperature>, System.Nullable<RelativeHumidity>>>.CreateObserver(Action<>, System.Nullable<Predicate<IChangeResult<UNIT>>>)
Namespace Meadow.Foundation.Sensors.Atmospheric
Assembly Dhtxx.dll

Syntax

public class Dht10 : DhtBase, IDisposable, ITemperatureSensor, IHumiditySensor

Constructors

Dht10(II2cBus, Byte)

Create a new Dht10 object.

Declaration
public Dht10(II2cBus i2cBus, byte address = null)

Parameters

Type Name Description
II2cBus i2cBus

I2C bus (default = 100 KHz).

System.Byte address

Address of the Dht12 (default = 0x27).