The ENS160 + AHT21 Air Quality Module is a combined environmental sensor board that measures indoor air pollutants (VOCs, eCO2, AQI) and climate conditions (Temperature, Humidity). It is a popular upgrade for older sensors like the CCS811 due to its integrated sensor fusion and automatic calibration.
Key Capabilities
Technical Specifications
| Feature | Specification |
|---|---|
| Supply Voltage (VIN) | 2.0V to 5.5V DC (Breakout boards often regulate to 3.3V) |
| Interface | I²C (Standard) or SPI (ENS160 only) |
| I2C Addresses | ENS160: 0x53 (default) or 0x52; AHT21: 0x38 |
| Warm-up Time | < 1 minute for immediate use; up to 1 An hour for full accuracy |
| Power Use | 1.2 to 46 mW depending on operating mode |
| Pin Name | Type | Description |
|---|---|---|
| VIN / VCC | Power | Power supply input. Usually supports 3.3V to 5V due to onboard regulators. |
| GND | Power | Ground connection. |
| SCL | I²C | Serial Clock line for both ENS160 and AHT21. |
| SDA | I²C | Serial Data line for both ENS160 and AHT21. |
| ADDR / ADO | Control | (Optional) I²C address selection for ENS160. Connect to GND for 0x52 or VCC for 0x53. |
| INT | Output | (Optional) Interrupt pin; can signal when new data is ready. |
To use the ENS160 + AHT21 module with Arduino, you'll typically need two libraries from the Arduino Library Manager: Adafruit ENS160 and Adafruit AHTX0.
Install Required Libraries
Open the Arduino IDE and install the following:
This code initializes both sensors via I²C and prints climate and air quality data to the Serial Monitor every two seconds.
#include <Wire.h> #include <Adafruit_ENS160.h> #include <Adafruit_AHTX0.h> Adafruit_ENS160 ens160; Adafruit_AHTX0 aht; void setup() { Serial.begin(115200); while (!Serial) delay(10); // Wait for Serial Monitor Serial.println("ENS160 + AHT21 Test"); // Initialize AHT21 (Address 0x38) if (!aht.begin()) { Serial.println("Could not find AHT21 sensor!"); while (1) delay(10); } Serial.println("AHT21 initialized."); // Initialize ENS160 (Address 0x53 or 0x52) // Most combo boards default to 0x53 if (!ens160.begin(0x53)) { Serial.println("Could not find ENS160 sensor!"); while (1) delay(10); } // Set operating mode: Standard (detecting) ens160.setMode(ENS160_OPMODE_STD); Serial.println("ENS160 initialized."); } void loop() { // 1. Read Climate Data from AHT21 sensors_event_t humidity, temp; aht.getEvent(&humidity, &temp); // 2. Feed Temperature/Humidity to ENS160 for better accuracy ens160.setTempRH(temp.temperature, humidity.relative_humidity); // 3. Read Air Quality Data from ENS160 if (ens160.available()) { Serial.print("Temp: "); Serial.print(temp.temperature); Serial.println(" C"); Serial.print("Humidity: "); Serial.print(humidity.relative_humidity); Serial.println(" %"); Serial.print("AQI: "); Serial.println(ens160.getAQI()); Serial.print("TVOC: "); Serial.print(ens160.getTVOC()); Serial.println(" ppb"); Serial.print("eCO2: "); Serial.print(ens160.getECO2()); Serial.println(" ppm"); Serial.println("-----------------------"); } delay(2000); }
Usage Tips
This page has been accessed for: Today: 7, Until now: 18