15. System
Integration

This week I developed the full integration of my final project. The process gave me clarity on everything I needed to build and allowed me to think through the complete product lifecycle, from concept to packaging before any physical fabrication began.

Task:

Design and document the system integration for your final project


Concept

Indoor Air Quality — Translated into Motion

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.


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) capable of running autonomously on an internal LiPo battery.
  • 05 Use a pogo-pin connection 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 RGB LED (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

  • Program the XIAO ESP32-C6 to read the ENS160 + AHT21 sensors via I2C.
  • Map CO₂/TVOC data to RGB color thresholds on the NeoPixel.
  • Establish a 10-second reading cycle to monitor the environment silently.
  • Test sensor stability on a breadboard.

▣ PHASE 02 — KINETIC ACTUATION & ORIGAMI INTEGRATION

  • Fold polymer-coated paper to 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 loops.

⎘ 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.
  • Develop the frontend interface — Live Data, Chart.js 24-hour history, Plant Calculator.
  • 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 for power transfer and sensor hot-swapping.
  • Assemble all components without adhesives using brass inserts and M3 screws.
  • Perform full system testing: thermal isolation, battery drain, and modular detachment.

System Integration

To begin, I identified all the components I would use and planned the connections between them. I also outlined the architecture of the interface. Below is the complete documentation of the system's electronic and software structure, risk analysis, design sketches, and packaging strategy.


Architecture & Components

Electronic Architecture

The core hardware stack and the connections planned between them.

COMPONENTS

  • Microcontroller: XIAO ESP32-C6
  • Sensors: ENS160 (VOC / CO₂) + AHT21 (Temperature / Humidity)
  • Power: 3.7 V LiPo Battery
  • Indicator: NeoPixel RGB LED
  • Controls: Switch + Push Button
  • Actuator: Servo Motor MG995
  • Optional: PM Sensor, Photoresistor
Electronic architecture diagram showing connections between the XIAO ESP32-C6, ENS160+AHT21 sensors, NeoPixel, servo motor, battery, switch, and button
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 (every 10 s) 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 of the last hour and stores it in a 24-slot list for full-day history tracking.
  • Web Server (on demand) Wi-Fi stays off to conserve battery. The web page is only served when the user presses the physical button on the module.

FRONTEND — LOCAL WEB INTERFACE

  • Main Panel — Live Data Displays room sensor data refreshing every 10 seconds, external government data, and the current sensor status.
  • Day Chart Takes the hourly averages from the XIAO and renders an interactive 24-hour history graph using the Chart.js library.
  • NeoPixel Mirror An on-screen color indicator that mirrors exactly what the physical device is currently showing — Green, Yellow, or Red.
  • Plant Calculator A web tool that recommends how many and which plants to place in the room based on the CO₂ level recorded by the board.

Risk Diagram

I developed a risk diagram to anticipate everything that could go wrong — staying one step ahead to prevent issues before they occur.

Risk diagram mapping potential failure points across electronics, software, mechanical actuation, modularity, and packaging for the air quality device
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, including the flower-leaf shape, junction mechanisms, and ventilation apertures
Exploratory form studies for the portable pod.
Final system integration sketch showing the static wood base with the servo and origami panel, and the detachable sensor pod connected via pogo pins
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.