https://github.com/arvage/envcube
mart modular environmental monitor — replaces smoke/CO detectors with always-on, voice-alert, WiFi-connected cubes
https://github.com/arvage/envcube
air-quality esp32-c6 espnow home-assistant iot mqtt platformio smart-home
Last synced: about 1 month ago
JSON representation
mart modular environmental monitor — replaces smoke/CO detectors with always-on, voice-alert, WiFi-connected cubes
- Host: GitHub
- URL: https://github.com/arvage/envcube
- Owner: arvage
- License: other
- Created: 2026-05-29T18:42:55.000Z (about 1 month ago)
- Default Branch: master
- Last Pushed: 2026-05-29T20:15:43.000Z (about 1 month ago)
- Last Synced: 2026-05-29T20:19:03.923Z (about 1 month ago)
- Topics: air-quality, esp32-c6, espnow, home-assistant, iot, mqtt, platformio, smart-home
- Language: C++
- Homepage:
- Size: 67.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# EnvCube 🟢🟡🔴
> Smart modular environmental monitor — replaces every smoke and CO detector in your home with an always-on, mains-powered, voice-alert cube.
[](docs/firmware/PHASE1.md)
[](docs/hardware/BOM.md)
[](LICENSE)
---
## What is EnvCube?
EnvCube is a modular, offline-first environmental monitor designed to replace the smoke detectors and CO alarms that every US home is legally required to have — but that everyone hates because they beep at 3am when the battery dies.
**Key differentiators:**
- **Mains powered** via USB-C with silent LiPo backup — no batteries, no 3am beeping, ever
- **Voice alerts** — speaker says *"Smoke detected in Kitchen"*, not just a generic beep
- **Location-aware mesh** — ESP-NOW broadcasts room name to all cubes simultaneously
- **Offline-first** — all alerts, LED, buzzer, and speaker work with zero internet
- **Modular pods** — snap on extra sensors with pogo pin + magnetic connectors
- **Cloud watchdog** — alerts your phone if a cube goes silent or offline
---
## Hardware
| Component | Details |
|---|---|
| MCU | ESP32-C6 (WiFi 6, Thread, Zigbee, ESP-NOW, BLE) |
| Power | USB-C 5V mains + LiPo backup cell |
| Status | WS2812B RGB LED (Green / Amber / Red) |
| Alert | Passive piezo buzzer + DFPlayer Mini + 28mm speaker |
| Display | SSD1306 0.96" OLED 128×64 |
| Pod interface | 4× pogo pin + magnetic connector (I²C + power + 1-Wire ID) |
### Sensor Pods
| Pod | Sensors | Interface |
|---|---|---|
| Thermal | SHT40 (temp/hum) + BMP280 (pressure) | I²C |
| Smoke + CO₂ | MQ-2 (smoke) + SCD41 (NDIR CO₂) | ADC + I²C |
| Air Quality | SGP41 (VOC/NOx) + VEML7700 (lux) | I²C |
| Presence | HLK-LD2410C (24GHz mmWave) | UART |
| Particulate | PMSA003I (PM1/2.5/10) | I²C |
| Noise | ICS-43434 MEMS mic (dB SPL) | I²S |
See [BOM](docs/hardware/BOM.md) for full component list with part numbers and suppliers.
---
## Firmware
Built with **Arduino framework on ESP32-C6** via PlatformIO (espressif32 @ 6.10.0).
### Phase 1 — Prototype ✅ COMPLETE
- [x] Project scaffold + PlatformIO config (pioarduino, ESP32-C6)
- [x] NVS config (room name, thresholds, credentials)
- [x] WiFi manager + captive portal provisioning
- [x] 9 sensor drivers (SHT40, BMP280, SCD41, SGP41, VEML7700, MQ-2, LD2410C, PMSA003I, ICS-43434)
- [x] Alert state machine (Green → Amber → Red → Critical)
- [x] LED animations + buzzer patterns + DFPlayer voice alerts
- [x] OLED display (3 screens, auto-dim, OTA progress)
- [x] ESP-NOW encrypted mesh (AES-128, auto peer discovery)
- [x] MQTT + Home Assistant auto-discovery (13 entities, LWT watchdog)
- [x] OTA firmware update (ArduinoOTA, LED/OLED feedback)
- [x] Weather fetch (Open-Meteo HTTPS, outdoor conditions)
- [x] Integration test checklist + HA dashboard guide
See [PHASE1.md](docs/firmware/PHASE1.md) for detailed step-by-step plan.
---
## Getting Started
### Prerequisites
- [VS Code](https://code.visualstudio.com/) + [PlatformIO extension](https://platformio.org/install/ide?install=vscode)
- ESP32-C6-DevKitC-1 board
- USB-C cable
### Clone and build
```bash
git clone https://github.com/YOUR_USERNAME/envcube.git
cd envcube
```
Open in VS Code → PlatformIO will auto-install dependencies.
Flash:
```bash
pio run --target upload --environment esp32c6
```
Monitor serial:
```bash
pio device monitor --environment esp32c6
```
### First-time provisioning
1. Power the cube — RGB LED pulses **blue** (provisioning mode)
2. Connect your phone to WiFi network **`EnvCube-Setup`**
3. Browser opens automatically → enter your WiFi credentials + room name
4. Cube reboots, LED turns **green** when connected
---
## Repository structure
```
envcube/
├── firmware/
│ ├── main/
│ │ ├── main.cpp # Boot, task launch
│ │ ├── sensors/ # One driver per sensor
│ │ ├── alerts/ # Threshold engine + ESP-NOW mesh
│ │ ├── outputs/ # LED, buzzer, DFPlayer
│ │ ├── display/ # OLED layouts
│ │ ├── connectivity/ # WiFi, MQTT, OTA, weather
│ │ ├── storage/ # NVS config wrapper
│ │ └── power/ # Sleep modes, LiPo monitor
│ ├── test/ # Unit tests
│ ├── platformio.ini
│ └── partitions.csv
├── docs/
│ ├── hardware/
│ │ ├── BOM.md # Full bill of materials
│ │ ├── PINOUT.md # ESP32-C6 pin assignments
│ │ └── POD_DESIGN.md # Pod enclosure + sensor placement
│ └── firmware/
│ ├── PHASE1.md # Phase 1 step-by-step plan
│ ├── ARCHITECTURE.md # Firmware module overview
│ ├── MQTT_TOPICS.md # Full MQTT topic reference
│ └── THRESHOLDS.md # Alert threshold values
└── tools/
└── audio/ # Voice clip source files
```
---
## Contributing
This is a private product development repository. See [CONTRIBUTING.md](CONTRIBUTING.md) for internal workflow guidelines.
---
## License
MIT — see [LICENSE](LICENSE)