This project reads and displays environmental data using the ENS160 digital air quality sensor and the AHT21 temperature & humidity sensor, both connected via I2C to an Arduino Uno.
- Arduino Uno
- ENS160 (Air Quality Sensor)
- AHT21 (Temperature & Humidity Sensor)
- I2C Wiring
| Arduino Uno | I2C Function | Sensor Pin |
|---|---|---|
| A4 | SDA | SDA |
| A5 | SCL | SCL |
| 5V | VCC | VCC |
| GND | GND | GND |
ENS160 default I2C address used:
0x53
AHT21 is auto-detected by the Adafruit library.
Install these libraries via the Arduino Library Manager:
Adafruit AHTX0ScioSense_ENS160Wire(built-in)
- Initializes both sensors.
- Reads temperature and humidity from the AHT21.
- Passes that data to the ENS160 to improve air quality readings.
- Prints Temperature, Humidity, AQI, TVOC, and eCO2 to the Serial Monitor.
- Toggles the onboard LED every second.