meta data for this page
LamaPLC: AHT10 Modul
The AHT10 is an affordable, high-precision digital sensor module that measures both temperature and humidity. It uses a standard I²C interface for communication and is commonly used with microcontrollers such as Arduino and ESP32.
Key Specifications
- Operating Voltage: 1.8V to 6.0V.
- Temperature Range: -40°C to +85°C with ±0.3°C typical accuracy.
- Humidity Range: 0% to 100% RH with ±2% typical accuracy.
- Resolution: 0.01°C for temperature and 0.024% for humidity.
- Communication: I²C (Default Address: 0x38).
Notable Features
- Fully Calibrated: It provides a calibrated digital signal directly, eliminating the need for complex external calibration.
- Internal Components: Equipped with a dedicated ASIC-specific chip and an improved MEMS semiconductor capacitive humidity sensor.
- Energy Efficiency: Extremely low power consumption (under 100 nA in sleep mode), making it ideal for battery-powered IoT devices.
Pinout Configuration
| Pin | Name | Function | Typical Connection |
|---|---|---|---|
| 1 | VIN / VCC | Power Supply (1.8V to 6.0V) | 3.3V or 5V pin |
| 2 | GND | Ground | GND pin |
| 3 | SCL | I²C Serial Clock | SCL / A5 (Arduino Uno) |
| 4 | SDA | I²C Serial Data | SDA / A4 (Arduino Uno) |
Wiring & Integration Details
- Voltage Levels: While the raw AHT10 chip operates at 1.8V–3.6V, most modules include an onboard voltage regulator (like the XC6206) and level shifters, making them safe for use with 5V systems like the Arduino Uno.
- Pull-up Resistors: Stable I²C communication requires pull-up resistors (typically 4.7kΩ or 10kΩ) on the SDA and SCL lines. Most pre-assembled modules already have these built-in.
- I²C Address: The default hardware address is 0x38.
Arduino example code
To use the AHT10 sensor with an Arduino, the most common and reliable method is using the Adafruit AHTX0 library.
This script initializes the sensor and prints temperature and humidity data to the Serial Monitor every 2 seconds.
#include <Wire.h> #include <Adafruit_AHTX0.h> Adafruit_AHTX0 aht; void setup() { Serial.begin(115200); Serial.println("AHT10 Sensor Test"); // Initialize I2C and the sensor if (!aht.begin()) { Serial.println("Could not find AHT10. Check wiring!"); while (1) delay(10); } Serial.println("AHT10 found and initialized."); } void loop() { sensors_event_t humidity, temp; // Get new sensor events with the latest data aht.getEvent(&humidity, &temp); // Print results to Serial Monitor Serial.print("Temperature: "); Serial.print(temp.temperature); Serial.println(" °C"); Serial.print("Humidity: "); Serial.print(humidity.relative_humidity); Serial.println(" % rH"); delay(2000); // Wait 2 seconds between readings }
Implementation Notes
- Baud Rate: Ensure your Serial Monitor is set to 115200 to match the Serial.begin(115200) command.
- Polling Frequency: While this code polls every 2 seconds, the manufacturer recommends a polling frequency of 8 to 30 seconds for long-term stability and to avoid sensor self-heating.
- Wiring: Connect SDA to A4 and SCL to A5 on an Arduino Uno (or the dedicated SDA/SCL pins on other boards).
I²C topics on lamaPLC
This page has been accessed for: Today: 8, Until now: 21