Air quality isn’t just an outdoor concern — indoor spaces can accumulate VOCs, CO₂, and pollutants that affect health and productivity. This project transforms the XIAO RP2040 and ENS160 sensor into a desktop air quality monitor. With a single NeoPixel RGB LED inside a JUSTWAY 3D‑printed enclosure, the device provides instant, color‑coded feedback on air quality while logging detailed sensor data.
- Health awareness: Monitor indoor air quality where you spend most of your time.
- Visual simplicity: A glowing LED communicates AQI levels at a glance.
- Compact design: Small enough to sit unobtrusively on a desk.
- Professional finish: A custom 3D‑printed enclosure makes it look like a consumer product, not a prototype.
- XIAO RP2040 microcontroller
- ENS160 Air Quality Sensor (AQI, TVOC, eCO₂)
- JUSTWAY 3D‑printed enclosure (desktop case with diffuser top)
- Jumper wires, soldering tools or breadboard USB cable for programming
The XIAO RP2040 is a compact yet powerful microcontroller board built around the Raspberry Pi RP2040 dual‑core ARM Cortex‑M0+ processor. Despite its tiny footprint, it offers rich features like multiple I²C, SPI, and UART interfaces, making it ideal for embedded projects where space is limited but performance matters. Its low power consumption and Arduino compatibility make it a favorite among makers for IoT and sensor‑driven applications.
Gravity: ENS160 Air Quality SensorThe ENS160 is a digital air quality sensor designed to measure indoor pollutants. It provides an Air Quality Index (AQI) along with TVOC (Total Volatile Organic Compounds) and eCO₂ (equivalent CO₂) readings. With built‑in compensation for temperature and humidity, the ENS160 delivers reliable data for health monitoring and smart ventilation systems. When paired with the XIAO RP2040, the sensor’s I²C interface ensures seamless integration, enabling projects like desktop air quality monitors that combine accurate sensing with expressive visual feedback.
WiringENS160 (I²C) to Xiao RP2040:
SDA → D4
SCL → D5
VCC → 3.3V
GND → GNDCodeThe sketch reads AQI, TVOC, and eCO₂ values from the ENS160 and lights the NeoPixel in a color that reflects AQI level:
#include <Wire.h>
#include <DFRobot_ENS160.h>
#include <Adafruit_NeoPixel.h>
DFRobot_ENS160_I2C ENS160(&Wire, 0x53);
int Power = 11;
int PIN = 12;
#define NUMPIXELS 1
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
Serial.begin(115200);
Wire.begin();
while (NO_ERR != ENS160.begin()) {
Serial.println("Communication with ENS160 failed, check wiring!");
delay(3000);
}
Serial.println("ENS160 ready!");
ENS160.setPWRMode(ENS160_STANDARD_MODE);
ENS160.setTempAndHum(25.0, 50.0);
pixels.begin();
pinMode(Power, OUTPUT);
digitalWrite(Power, HIGH);
}
void loop() {
uint8_t AQI = ENS160.getAQI();
uint16_t TVOC = ENS160.getTVOC();
uint16_t ECO2 = ENS160.getECO2();
Serial.print("AQI: "); Serial.print(AQI);
Serial.print(" | TVOC: "); Serial.print(TVOC); Serial.print(" ppb");
Serial.print(" | eCO2: "); Serial.print(ECO2); Serial.println(" ppm");
pixels.clear();
switch (AQI) {
case 1: pixels.setPixelColor(0, pixels.Color(0, 255, 0)); break; // Green
case 2: pixels.setPixelColor(0, pixels.Color(0, 0, 255)); break; // Blue
case 3: pixels.setPixelColor(0, pixels.Color(255, 255, 0)); break; // Yellow
case 4: pixels.setPixelColor(0, pixels.Color(255, 165, 0)); break; // Orange
case 5: pixels.setPixelColor(0, pixels.Color(255, 0, 0)); break; // Red
default: pixels.setPixelColor(0, pixels.Color(255, 255, 255)); break; // White
}
pixels.show();
delay(2000);
}Enclosure & JustwayA desktop monitor needs to look good enough to stay visible. Bare PCBs don’t cut it — so I used a JUSTWAY 3D‑printed enclosure to give the project a professional finish.
- Two‑part design: A translucent diffuser top softens the LED glow, paired with a matte base that hides electronics.
- Professional finish: Smooth print quality avoids visible layer lines, ensuring even light diffusion.
- Quick turnaround: Uploading STL files to Justway’s platform gave me a fast quote and delivery.
- Customization: Dual‑color prints make the device look intentional and product‑ready.
- Diffuser quality for clean, even light.
- Durability for daily desktop use.
- Ease of use with instant quotes and fast delivery.
The result is a compact, self‑contained desktop air quality station: a glowing indicator that looks at home on your desk, with no visible wiring. Justway’s enclosure service elevated the project from DIY to polished product.
Results- Serial Monitor shows AQI, TVOC, and eCO₂ values in real time.
- The NeoPixel provides instant visual feedback:
🟢 Green = Excellent
🔵 Blue = Good
🟡 Yellow = Moderate
🟠 Orange = Poor
🔴 Red = Unhealth
This desktop air quality monitor demonstrates how compact hardware like the XIAO RP2040 and the ENS160 sensor can be combined with expressive design elements to create a practical, everyday tool. By pairing accurate AQI, TVOC, and eCO₂ measurements with a simple NeoPixel LED indicator, the project makes air quality awareness immediate and intuitive. The addition of a JUSTWAY 3D‑printed enclosure transforms the build from a prototype into a polished desktop device that looks at home in any workspace.




Comments