Remarks
Dht10 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
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) |
Syntax
public class Dht10 : DhtBase, IObservable<IChangeResult<(Temperature? Temperature, RelativeHumidity? Humidity)>>, ISamplingSensor<(Temperature? Temperature, RelativeHumidity? Humidity)>, ISensor<(Temperature? Temperature, RelativeHumidity? Humidity)>, IDisposable, ITemperatureSensor, ISamplingSensor<Temperature>, ISensor<Temperature>, IHumiditySensor, ISamplingSensor<RelativeHumidity>, ISensor<RelativeHumidity>
Constructors
Dht10(II2cBus, byte)
Create a new Dht10 object.
Declaration
public Dht10(II2cBus i2cBus, byte address = 92)
Parameters
Type | Name | Description |
---|---|---|
II2cBus | i2cBus | I2C bus (default = 100 KHz). |
byte | address | Address of the Dht12 (default = 0x27). |
Remarks
Dht10 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
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) |