The AHT10/15 and AHT20 sensors are high-precision, calibrated temperature and relative humidity sensor modules with an I2C digital interface.
The binding supports the following types:
The binding supports the following sensor functions:
- acquiring the temperature and relative humidty readings
- reading status
- issueing calibration and reset commands
You need to choose the class depending on the sensor type.
Sensor | Required class |
---|---|
AHT10 | Aht10 |
Aht15 | Aht10 |
Aht20 | Aht20 |
The binding gets instantiated using an existing I2cDevice
instance. The AHT-sensor modules support only the default I2C address.
Setup for an AHT20 sensor module:
const int I2cBus = 1;
I2cConnectionSettings i2cSettings = new I2cConnectionSettings(I2cBus, Aht20.DefaultI2cAddress);
I2cDevice i2cDevice = I2cDevice.Create(i2cSettings);
Aht20 sensor = new Aht20(i2cDevice);
The temperature and humidity readings are acquired by using the following methods:
public Temperature GetTemperature()
public Ratio GetHumidity()
Refer to the sample application for a complete example.
The AHTxx sensor is wired to the I2C interface (SDC/SDA) of the Raspberry Pi. The sensor is supplied with 3.3V to comply with the 3.3V interface level of the RPi.