Final Project

Air Quality
Sensor

My final proyect consists on a indoor air quality management device that translates environmental sensor data into physical movement. The system helps users decide whether to open a window for natural ventilation or to activate an air purifier.

Developing process Documentation
Air quality sensor project sketches

Data

While exploring everyday environmental problems, I originally considered building an indoor air purifier. But as my research deepened, I identified a more fundamental issue: air purifiers are expensive, and once their filters are saturated with contaminants, they can release those pollutants back into the room, turning a solution into a new problem.

This made me rethink the real question. Before investing in a purifier, you first need to know if you actually need one. Most people have no way to compare the air they breathe indoors against what's outside. Without that comparison, you might ventilate when you shouldn't or keep a window shut when outdoor air is actually cleaner.

That gap is what I decided to address: an indoor–outdoor air quality sensor that gives you objective, real-time data to make an informed decision. During my research into why this matters, I found that:

99% of the population breathes air that exceeds the quality limits recommended by the WHO. On average, people spend approximately 90% of their time indoors, where concentrations of some pollutants are often 2 to 5 times higher than typical outdoor concentrations. Household air pollution was responsible for an estimated 2.9 million deaths per year in 2021, including over 309,000 deaths of children under the age of 5.

Factors that contribute to a more dangerous indoor environment:

  • Poor ventilation
  • Dust accumulation
  • Humidity
  • Fine particles
  • Cooking smoke
  • Textiles
  • Cleaning chemicals
  • Pets
  • Nearby traffic
  • Dense urban areas
Principal Air
Pollutants
Particulate
matter
(PM2.5 & PM10)
Nitrogen
dioxide
(NO₂)
Carbon
monoxide
(CO)
Sulfur
dioxide
(SO₂)
Tropospheric
ozone
(O₃)
Volatile organic
compounds
(VOC)
User

Young adults, students, and professionals who spend long days in closed rooms, studios, or home offices — and experience fatigue, heavy air, dust, or allergies — looking for an accessible way to understand their environment before taking action.

Effects of pollutants:

  • Respiratory system
  • Allergies
  • Asthma
  • Fatigue
  • Headache
  • Eye irritation
  • Mental concentration
  • Sleep quality

Indoor air pollution is not an isolated issue it's a constant condition in the spaces where people study, work, and spend most of their time. But addressing it blindly, without knowing whether opening a window would help or hurt, can make things worse. This confirmed the need for an accessible, portable air quality monitor that empowers users with real, actionable data before any ventilation or purification decision. After defining what I was going to do, I started brainstorming to make the system integration of the project. This helped me to have everything planned and to know elxactly how I was going to develop my project.

To start this project it was very helpfull to have everything planned, but to do that first it had to be clear what I was going to do. That's why I started with defining the concept of the product, which is:

Concept

Kinetic indoor Air Quality monitoring device

An indoor air quality management device that translates environmental sensor data into physical movement. The system helps users decide whether to open a window for natural ventilation or to activate an air purifier.


Objective

Design and build a modular air quality monitor that translates environmental data into physical movement through a kinetic origami panel. The system must integrate local sensor telemetry with external government data to intuitively guide the user on whether to ventilate the room naturally or use an air purifier, while allowing the sensor unit to be easily detached for portable testing across different rooms.


Problem

Lack of Intuitive, Actionable Air Quality Awareness

People often lack intuitive, real-time awareness of indoor air quality compared to outdoor conditions. In highly polluted or geographically unique areas, such as Mexico City (CDMX) with severe PM2.5 smog alerts, or Puebla with frequent volcanic ash fall. This lack of information becomes a critical health hazard. Users might open a window believing they are naturally ventilating their room, only to inadvertently draw in hazardous external pollutants, drastically worsening indoor air quality. Furthermore, traditional monitors rely on easily ignored numerical screens that lack actionable context, and being strictly tethered to a wall makes it difficult to evaluate an entire house without purchasing multiple units.


After I had a clear concept I started doing the requirements of the project, some of them were modifyed or added after the risk diagram:

Project Requirements

SYSTEM MUST:

  • 01 Measure local CO₂, TVOC, temperature, and humidity in real-time.
  • 02 Periodically fetch outdoor air quality data from a government API via Wi-Fi.
  • 03 Actuate a kinetic origami panel via a servo motor to physically represent environmental status.
  • 04 Include a fully detachable sensor module (Pod).
  • 05 Use pogo-pin connections to transfer power, ground, and data between the portable pod and the static base.
  • 06 Incorporate passive cross-flow ventilation (chimney effect) in the enclosure to prevent the microcontroller's heat from skewing sensor readings.
  • 07 Include an NeoPixel for immediate, color-coded visual feedback.
  • 08 Allow the internal gas sensor board to be swapped without soldering for long-term maintainability.
  • 09 Provide a local web interface on demand displaying real-time data, historical daily graphs, and actionable recommendations.

Proof of Concept Validations

Telemetry & Logic

Verify accurate execution of the decision matrix comparing local I2C sensor data with Wi-Fi API data without blocking the microcontroller.

Mechanical Actuation

Absence of material tearing, jamming, or servo stalling after repeated expansion and contraction cycles of the origami panel.

Modularity

Continuous system operation, stable I2C communication, and automatic battery switchover when detaching and reattaching the portable module.

Thermal Isolation

Temperature and humidity readings must remain consistent with ambient room conditions, entirely unaffected by the internal heat generated by the ESP32-C6.


Spiral Development Phases

The project is structured into four incremental phases, each building on the validated output of the previous one.

〜 PHASE 01 — CORE TELEMETRY & AMBIENT FEEDBACK

  • Make a PCB considering all the components that I will be using
  • Program the XIAO ESP32-C6 to read the ENS160 + AHT21 sensors via I2C.
  • Map CO₂/TVOC data to RGB color thresholds on the NeoPixel.
  • Figure out how I will translate environmental sensor data into physical movement

▣ PHASE 02 — KINETIC ACTUATION & ORIGAMI INTEGRATION

  • Create the kinetic origami panel.
  • Design and 3D print the mechanism for the MG995 servo.
  • Program safe servo rotation angles to prevent material tearing.
  • Test physical expansion and contraction of the Origami.

⎘ PHASE 03 — API CONNECTION & WEB DASHBOARD

  • Implement the Wi-Fi fetch protocol for the government AQI API (hourly checks).
  • Code the local web server triggered by an on-demand physical button.
  • Test dynamic data exchange between the browser and the ESP32-C6.

⚙ PHASE 04 — PACKAGING, MODULARITY & FULL SYSTEM INTEGRATION

  • 3D print the static Base and portable Pod with chimney-effect ventilation geometry.
  • Integrate internal and external pogo pins.
  • Assemble all components without adhesives using brass inserts and M4 screws.
  • Perform full system testing

Architecture & Components

Electronic Architecture

The core hardware stack and the connections planned between them.

COMPONENTS

  • Microcontroller: XIAO ESP32-C6
  • Sensor: ENS160 (VOC / CO₂) + AHT21 (Temperature / Humidity)
  • Power: 3.7 V LiPo Battery
  • Indicator: NeoPixel RGB LED
  • Controls: Push Button
  • Actuator: Servo Motor MG995
  • Optional: PM Sensor, Photoresistor (I didn't got the time to add these)
Electronic architecture diagram
Electronic architecture diagram: component connections and wiring overview.

Software Architecture

The firmware is divided into two logical layers: a backend running on the microcontroller, and a frontend served on demand to the user's browser.

BACKEND — FIRMWARE (ESP32-C6)

  • Telemetry & Status Reads the sensors (CO₂, TVOC) and monitors the sensor status: "Operating", "Warming Up", or "Read Error".
  • API Query (every hour) Connects briefly to the internet to download the government outdoor air quality index and stores it locally.
  • Historical Memory Calculates the average air quality every 5 minutes and stores it in a chart.

FRONTEND — LOCAL WEB INTERFACE

  • Main Panel — Live Data Displays room sensor data, external government data, and the current sensor status.
  • Data comparison It compares the data between the indoor and outdoor air quality and tells you whether to open the window or to turn on an air purifier.
  • Air quality Chart Takes every 5 minute readings and displays them in a chart.

Risk Diagram

I developed a risk diagram to anticipate everything that could go wrong, staying one step ahead to prevent issues before they occur (I based the information on the diagram on what AI told me it could happen since this is my first project and I only have a general idea of what could go wrong).

Risk diagram mapping potential failure points
Risk diagram: potential failure points and mitigation strategies across all subsystems.

System Integration Sketches

After the risk analysis, I began sketching how the entire system would be integrated, considering enclosure design and the points raised in the risk diagram. I explored several forms for the portable pod, ultimately selecting the shape that resembles the leaves of a flower.

Exploratory sketches of different pod form factors
Exploratory form studies for the portable pod.
Final system integration sketch
Final system sketch — base unit, detachable pod, and pogo-pin connection.

Packaging Integration

Materials & Fabrication Methods

The enclosure combines 3D-printed PLA for the portable pod and the actuator mechanism, with a CNC-cut rigid wood base. Joints rely on M3 screws and brass threaded inserts to ensure durability over repeated disassembly — no adhesives are used.

TWO LEVELS OF MODULARITY

  • Level 1 — Pod ↔ Base (External Pogo Pins) The portable sensor pod snaps into the main base magnetically using an external set of pogo pins. This allows the pod to be detached and used independently in any room.
  • Level 2 — Sensor Board ↔ Microcontroller (Internal Pogo Pins) Inside the pod, the ENS160 + AHT21 sensor board connects to the XIAO ESP32-C6 via an internal set of pogo pins. This solderless connection ensures that if the environmental sensor degrades due to constant air exposure, it can be swapped instantly without tools or soldering.

Thermal Isolation — Chimney Effect

The pod's geometry incorporates lower side intakes and upper exhaust vents to create passive cross-flow ventilation. This chimney effect successfully isolates the environmental sensors from the heat generated by the ESP32-C6 microcontroller.

What Will It Do?

Modular Active Air Quality Monitor (IoT)

An environmental monitoring system that measures indoor air quality, compares it with outdoor data, and generates both a physical and a visual response. The design is split into two attachable modules connected via pogo pins, which allows the main sensor to be portable without interrupting the system's operation.

TOP MODULE — SENSOR & TRANSMISSION

The portable "brain" of the project. Runs independently on a LiPo battery.

  • Uses a XIAO ESP32-C6 to read temperature and humidity from an AHT21 sensor.
  • Feeds data into an ENS160 sensor for precise, compensated gas readings.
  • Constantly transmits environmental measurements via Wi-Fi using the MQTT protocol.

BASE MODULE — ACTUATION & CHARGING

A wall-powered station that charges the top module and powers the high-current components.

  • Controls a servo motor attached to a kinetic origami structure that physically expands when air is good and contracts as a warning when quality worsens.
  • Features an RGB LED and a NeoPixel lamp that react to the air quality status.

Who Has Done What Beforehand?

My project merges concepts from kinetic art, modular electronics, and environmental monitoring. I drew inspiration from these projects:

REFERENCE PROJECTS

  • Origami Interactive Kinetic Art — vietbui20 (Instructables) Explores how origami structures can be actuated using parallel processing to create moving art.
  • Folding Origami Flasher Hexagon — BYU CMR (Printables) A mechanical reference for utilizing living hinges and folding mechanisms in 3D-printable or cut materials.
  • Orilum: Touch Sensitive Light Talker — Leticia (MIT CBA) An excellent reference for integrating soft materials, light, and capacitive sensing into a physical computing project.
  • Planter with CO₂ Sensor — Fab Lab FCT (2017) A Fab Academy past project that successfully integrated a CO₂ sensor into a functional household object to measure indoor environments.
Reference projects

What Will I Design?

I will design a two-part modular system across three layers:

3D / 2D ENCLOSURES & MECHANISMS

I will design the structural housing for both the base and the portable sensor module, ensuring they mate perfectly using pogo pins. I will also design the kinetic origami pattern that the servo will actuate.

Final system sketch

ELECTRONICS

I will design and manufacture two custom PCBs. The first PCB will house the XIAO ESP32-C6, the LiPo battery circuit, and the I2C sensors (ENS160 + AHT21). The second PCB will be located in the base to handle power distribution, servo motor connections, and LED/NeoPixel indicators — including pull-down safety resistors.

Electronic architecture

WEB INTERFACE

I will design a web interface hosted on Git using HTML, CSS, and JavaScript. This dashboard will use MQTT over WebSockets to graph real-time sensor data, and use fetch() to pull outdoor air quality data from a government API for comparison.

Dashboard sketch

Materials, Components & Costs

Prices are estimates and will be updated as purchases are made.

Category Item Details Qty Unit Price (USD) Source
Microcontroller XIAO ESP32-C6 Seeed Studio 1 $7.18 Unit Electronics
Air Quality Sensor ENS160 + AHT21 Module CO₂ + Temp/Hum 1 $11.49 Unit Electronics
Motor Servo MG995 1 $5.74 Fab Lab Inventory
Connectors Pogo Pins (Spring-loaded) 4 $16.03 Amazon MX
Power LiPo Battery 3.7 V 2000 mAh 1 $13.73 Amazon MX
Lighting NeoPixel Ring / RGB LEDs WS2812 1 $8.10 Amazon MX
Material PLA Filament 1 $20.00 InovaMarket
Switch Rocker Switch (SPST) 1-pole, 2-position 1 $1.15 Steren
Button Push Button (round metal) NO / NC 1 $5.69 Steren
Components SMD Resistors, Pin Headers, Copper Board Assorted 1 $5.00 Fab Lab Inventory

Estimated Total: $94.11 USD


What Parts & Systems Will Be Made?

STRUCTURAL SYSTEM

  • 3D-printed modular enclosures (top module)
  • 3D-printed kinetic origami mechanism
  • Wood-routed base

ELECTRONIC SYSTEM

  • Manufacturing, milling, and soldering of the main sensor PCB
  • Power and actuation base PCB

SOFTWARE & LOGIC SYSTEM

  • C++ firmware for the XIAO ESP32-C6
  • I2C sensor reading, threshold logic (eCO₂ & TVOC)
  • PWM servo control + MQTT data transmission

WEB SYSTEM

  • Front-end interface to visualize local WebSocket data alongside external API data

What Processes Will Be Used?

To demonstrate individual mastery of Fab Academy skills, this project integrates:

FAB ACADEMY SKILLS INTEGRATED

  • 01 2D & 3D Design: CAD modeling for the modular enclosures and vector design for the origami fold patterns.
  • 02 Additive & Subtractive Fabrication: 3D printing the housings and the origami material, and cutting the outer base with the router.
  • 03 Electronics Design & Production: Milling the custom PCBs on a precision router and soldering the SMD components.
  • 04 Embedded Microcontroller Interfacing: Programming the XIAO ESP32-C6 to handle I2C communication, PWM actuation, and MQTT Wi-Fi transmission.
  • 05 System Integration & Packaging: Combining the mechanical origami structure, the modular electronics via pogo pins, and the software logic into a cohesive, independently operable product.

What Questions Need to Be Answered?

Pogo Pin Reliability

Will the pogo pin connection be stable enough to reliably charge the LiPo battery and maintain signal integrity when the module is docked?

Material Durability

Can the origami structure withstand repeated physical expansion and contraction over time without the material wearing out or tearing?

Safety Response Speed

Will the pull-down resistor safety mechanism respond fast enough to prevent the servo and lights from acting erratically the exact moment the top module is detached?


How Will It Be Evaluated?

The project will be evaluated using a spiral development approach, establishing a Minimum Viable Product (MVP) to ensure core Fab Academy requirements are met first, with more complex integrations as secondary goals.

MVP — CORE SUCCESS

  • Sensing & Logic: The XIAO ESP32-C6 successfully reads eCO₂ and TVOC data from the sensors and applies the programmed threshold logic.
  • Basic Feedback: The base module provides clear visual feedback (e.g., LED or NeoPixel turning red) when air quality drops below acceptable limits.
  • System Integration: The 3D-printed enclosures successfully house the custom PCBs. If pogo-pin modularity proves unstable, a fixed wired connection will be considered a successful fallback.
  • Basic Interface: A web interface successfully displays local sensor data received via Wi-Fi/MQTT.

SECONDARY GOALS — SPIRAL 2 (IDEAL OPERATION)

  • Kinetic Actuation: The servo motor successfully actuates the origami structure — contracting and expanding based on air quality data without the paper tearing or the motor stalling.
  • True Portability: The top module successfully and safely runs on the LiPo battery when detached, and the pogo pins reliably recharge it when docked.
  • Data Contextualization: The web dashboard successfully fetches outdoor air quality data from the external government API to compare alongside the local MQTT data.