

The AHT10 is a digital temperature and humidity sensor designed to provide accurate and reliable measurements of environmental conditions. It features a built-in I2C interface, making it easy to integrate with microcontrollers and other digital systems. The AHT10 is known for its high precision, low power consumption, and compact design, making it ideal for a wide range of applications.








The AHT10 sensor has four pins, as described in the table below:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | VDD | Power supply (2.0V to 5.5V) |
| 2 | GND | Ground |
| 3 | SCL | I2C clock line |
| 4 | SDA | I2C data line |
Below is an example of how to use the AHT10 with an Arduino UNO:
#include <Wire.h> // Include the Wire library for I2C communication
#define AHT10_ADDRESS 0x38 // Default I2C address of the AHT10
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Start serial communication for debugging
// Initialize the AHT10 sensor
Wire.beginTransmission(AHT10_ADDRESS);
Wire.write(0xE1); // Send initialization command
Wire.endTransmission();
delay(10); // Wait for the sensor to initialize
}
void loop() {
// Request data from the AHT10 sensor
Wire.beginTransmission(AHT10_ADDRESS);
Wire.write(0xAC); // Trigger measurement command
Wire.write(0x33); // Command parameter
Wire.write(0x00); // Command parameter
Wire.endTransmission();
delay(100); // Wait for the measurement to complete
// Read 6 bytes of data from the sensor
Wire.requestFrom(AHT10_ADDRESS, 6);
if (Wire.available() == 6) {
uint8_t data[6];
for (int i = 0; i < 6; i++) {
data[i] = Wire.read();
}
// Process the data to extract temperature and humidity
uint32_t humidity = ((uint32_t)data[1] << 12) | ((uint32_t)data[2] << 4) |
(data[3] >> 4);
uint32_t temperature = ((uint32_t)(data[3] & 0x0F) << 16) |
((uint32_t)data[4] << 8) | data[5];
float humidityPercent = (humidity * 100.0) / 1048576.0;
float temperatureCelsius = (temperature * 200.0 / 1048576.0) - 50.0;
// Print the results to the serial monitor
Serial.print("Humidity: ");
Serial.print(humidityPercent);
Serial.println(" %");
Serial.print("Temperature: ");
Serial.print(temperatureCelsius);
Serial.println(" °C");
}
delay(2000); // Wait 2 seconds before the next reading
}
No Data from the Sensor:
Inaccurate Readings:
I2C Communication Errors:
Q: Can the AHT10 operate at 5V?
A: Yes, the AHT10 can operate with a supply voltage between 2.0V and 5.5V.
Q: Do I need to calibrate the AHT10?
A: No, the AHT10 is factory-calibrated and does not require additional calibration.
Q: What is the typical response time of the AHT10?
A: The typical response time is less than 8 seconds.
Q: Can I use the AHT10 with a 3.3V microcontroller?
A: Yes, the AHT10 is compatible with both 3.3V and 5V systems.