Imported hardware project from GitHub.
Loading README and project media…
AirCube is an ESP32-H2 based environmental monitoring device that measures air quality, temperature, and humidity. It provides real-time visual feedback through an RGB LED and communicates sensor data via serial interface.
Watch the AirCube in action: YouTube Demo
Clone the repository:
git clone https://github.com/yourusername/AirCube.git
cd AirCube
Build and flash the firmware:
cd firmware
idf.py build
idf.py -p COM3 flash monitor # Replace COM3 with your port
Run the desktop app:
cd scripts
pip install -r requirements.txt
python aircube_app.py
The AirCube app will open. Select your serial port from the dropdown, click Connect, and you're live!
That's it! Your AirCube should now be running and showing live data.
Air Quality Monitoring
Environmental Sensors
Visual Feedback
Communication
Power Management
PCB design files are located in the kicad/ directory:
3D printed enclosure files are located in the mechanical/ directory:
The firmware is built using ESP-IDF and is located in the firmware/ directory.
Install ESP-IDF:
get_idf or export.sh/export.bat)Install USB drivers (if needed):
dialout groupNavigate to firmware directory:
cd firmware
Set the target (ESP32-H2):
idf.py set-target esp32h2
Configure the project (optional):
idf.py menuconfig
Build the project:
idf.py build
Flash to device:
# Windows
idf.py -p COM3 flash
# Linux/macOS
idf.py -p /dev/ttyUSB0 flash
Replace COM3 or /dev/ttyUSB0 with your actual serial port.
Monitor serial output:
idf.py -p COM3 monitor # or /dev/ttyUSB0 on Linux/macOS
Press Ctrl+] to exit the monitor.
Flash and monitor in one command:
idf.py -p COM3 flash monitor
firmware/
├── main/
│ ├── main.c # Main application code
│ ├── ens210.c/h # ENS210 temperature/humidity sensor driver
│ ├── ens16x_driver.c/h # ENS16X air quality sensor driver
│ ├── i2c_driver.c/h # I2C communication driver
│ ├── led.c/h # LED control
│ ├── led_color_lib.c/h # Color conversion utilities
│ ├── ws2812_control.c/h # WS2812 LED driver
│ ├── button.c/h # Button input handling
│ └── serial_protocol.c/h # Serial communication protocol
├── CMakeLists.txt
└── sdkconfig # ESP-IDF configuration
Python utilities for connecting to the AirCube, logging, and visualization are in the scripts/ directory.
scripts/ directory):
cd scripts
pip install -r requirements.txt
aircube_app.py - Desktop Application (recommended)
A full graphical application for monitoring your AirCube in real-time.
Usage:
cd scripts
python aircube_app.py
Features:
aircube_tray.py - System Tray Monitor
A lightweight app that displays the AQI directly in your Windows taskbar/system tray.
Usage:
cd scripts
python aircube_tray.py
Features:
Controls:
aircube_logger.py - Headless data logger
Logs sensor data from serial to CSV only (no display). Use when matplotlib is not available or you only need a file. The standalone app with --csv replaces this for most use cases.
Configuration: Edit the script to set , , .
You can build standalone .exe files (Windows) that don't require Python:
Install PyInstaller:
pip install pyinstaller
Build the main desktop app:
cd scripts
python build_exe.py
Output: dist/AirCube.exe - Full GUI application with charts
Build the system tray app:
python build_tray.py
Output: dist/AirCubeTray.exe - Lightweight taskbar monitor
Both executables are fully self-contained and can be distributed to users without Python.
Optional: Add aircube.ico or aircube_tray.ico to the scripts/ folder before building for custom icons.
The device communicates via UART at 115200 baud using JSON messages.
The device periodically sends sensor data as JSON (default: every 1000ms, configurable):
{
"timestamp": 1234567890,
"ens210": {
"status": 0,
"temperature_c": 22.5,
"temperature_f": 72.5,
"humidity": 45.2
},
"ens16x": {
"status": "OK",
"etvoc": 50,
"eco2": 400,
"aqi": 5
}
}
Commands can be sent to the device via serial (JSON format). See firmware/main/serial_protocol.c for available commands and implementation details.
Example: To change the sensor readout period, send a JSON command via serial.
The RGB LED provides real-time visual feedback based on air quality:
Brightness Control: Press the button on the device to cycle through brightness levels.
kicad/gerbers/ to order from your preferred PCB manufacturerkicad/AirCube v1.0 BOM.csv to order componentskicad/AirCube.kicad_sch for assemblymechanical/ directoryAirCube/
├── firmware/ # ESP-IDF firmware source code
│ ├── main/ # Main application code
│ └── CMakeLists.txt # Build configuration
├── kicad/ # PCB design files (KiCad)
│ ├── gerbers/ # Manufacturing files
│ └── *.kicad_* # KiCad project files
├── mechanical/ # 3D enclosure files
│ └── *.step # CAD files for 3D printing
├── scripts/ # Python utilities
│ ├── aircube_app.py # Desktop application (full GUI with charts)
│ ├── aircube_tray.py # System tray monitor (lightweight)
│ ├── build_exe.py # Build script for desktop app
│ ├── build_tray.py # Build script for tray app
│ ├── aircube.spec # PyInstaller spec file
│ ├── requirements.txt
│ ├── aircube_logger.py
│ ├── aircube_data_visualizer.py
│ └── aircube_replay_script.py
└── README.md # This file
Device not detected:
dialout group)Build errors:
idf.py fullclean and rebuildidf.py set-target esp32h2Flash errors:
menuconfig → Serial flasher configNo sensor data:
LED not working:
Serial port not found:
COM3, Linux: /dev/ttyUSB0)Import errors:
pip install -r scripts/requirements.txtpython -m venv venvContributions are welcome! Here's how you can help:
git checkout -b feature/amazing-featuregit commit -m 'Add amazing feature'git push origin feature/amazing-featureThis project is licensed under the Apache License 2.0 - see the LICENSE file for details.
PORTBAUDCSV_FILEUsage:
python aircube_logger.py
aircube_data_visualizer.py - CSV-only live viewer
Watches a CSV file and displays live plots (no serial connection). Use when the cube is not connected but you have a CSV being written by another process.
Configuration: Edit the script to set CSV_FILE, MAX_POINTS, UPDATE_INTERVAL_MS.
Usage:
python aircube_data_visualizer.py
aircube_replay_script.py - Data replay
Replays logged sensor data from a CSV with timestamp-based timing for analysis.
Configuration: Edit the script to set CSV_FILE, SPEED, MAX_POINTS.
Usage:
python aircube_replay_script.py
The script will load the CSV, replay at the specified speed, and show the same three-panel visualization.