Firmware Overview
Welcome
The CICERONE AirLink firmware is an embedded system designed for continuous indoor air quality monitoring with remote telemonitoring capabilities. Built on the Arduino framework for the Nano 33 BLE Sense Rev2, it implements a non-blocking, timer-based architecture that ensures reliable data collection and transmission.
Key Features
-
Non-Blocking Architecture
Dual-timer system with 5-second sensor sampling and 10-minute data averaging cycles.
-
Multi-Sensor Integration
SEN54 (PM/VOC), T6793-5K (CO₂), and DS3231M RTC for comprehensive air quality monitoring.
-
NB-IoT Connectivity
Optional wireless data transmission via SIM7020G module with HTTP POST.
-
Modular Design
Clean separation of concerns with dedicated APIs for each component.
-
Debug System
Multi-level logging framework with per-module configuration.
-
Memory Efficient
Static allocation, minimal dynamic strings, optimized for long-term deployment.
Documentation Sections
Architecture
Learn about the system architecture, modular component structure, data flow pipeline, and memory management strategies.
Topics covered:
- Non-blocking timer system (5s and 10min)
- Module organization and dependencies
- Data accumulation and averaging
- Conditional compilation for feature control
Read Architecture Documentation
Program Flow
Understand the detailed execution flow from device startup through continuous operation.
Topics covered:
- Setup phase initialization sequence
- Main loop structure and timing
- 5-second data acquisition cycle
- 10-minute averaging and transmission cycle
Read Program Flow Documentation
Sensor Interfaces
Explore sensor communication protocols, specifications, and calibration procedures.
Topics covered:
- SEN54 particulate matter and VOC sensor
- T6793-5K CO₂ sensor with ABC algorithm
- DS3231M real-time clock with battery backup
- I2C bus configuration and troubleshooting
Data Transmission
Discover how data is formatted and transmitted via NB-IoT cellular connectivity.
Topics covered:
- JSON packet format and generation
- NB-IoT communication protocol (SIM7020G)
- AT command sequences
- Power consumption optimization
Read Transmission Documentation
Quick Start
Building and Uploading
# Compile firmware
arduino-cli compile --profile nano33ble --build-path firmware/build firmware/
# Upload to board
arduino-cli upload --profile nano33ble --input-dir firmware/build
# Monitor serial output
arduino-cli monitor -p COM3 -c baudrate=115200
See the project README for detailed build instructions.
Configuration
Before uploading, configure the device in firmware/Configuracion.h:
#define ID_USUARIO "AIRLINK_01" // Device ID
#define HABILITAR_NBIOT 1 // Enable NB-IoT
#define SERVIDOR_IP "http://example.com" // Server URL
#define APN_NBIOT "iot.1nce.net" // Network APN
See Firmware Configuration Guide for detailed configuration options.
Debug Output
Enable debug output in firmware/Debug.h:
#define DEBUG_LEVEL 3 // 0-4 (0=disabled, 3=recommended)
#define DEBUG_SEN5X 3 // Per-module debug levels
#define DEBUG_NBIOT 3
See Debug Configuration Guide for debugging options.
Technical Specifications
| Parameter | Value | Notes |
|---|---|---|
| Platform | Arduino Mbed OS Nano | Nano 33 BLE Sense Rev2 |
| Language | C/C++ | Arduino framework |
| Compiler | GCC ARM | Via Arduino CLI |
| Flash Memory | ~100-150 KB | Depends on enabled modules |
| RAM Usage | ~20-30 KB | Dynamic allocation minimal |
| Sampling Rate | 5 seconds | Configurable in code |
| Averaging Period | 10 minutes | 120 samples per average |
| Transmission Interval | 10 minutes | 144 transmissions/day |
| Power Consumption | ~120-180 mA | Average (5V input) |
| Battery Life | ~5 hours | With 900 mAh battery + NB-IoT |
API Reference
Complete API documentation is available through Doxygen-generated references:
API Documentation - Generated from firmware/
source code
The API documentation includes:
- Function prototypes and parameters
- Variable definitions and usage
- Module dependencies
- Code examples
- Implementation notes
Additional Resources
Configuration Guides
- Firmware Configuration - Configure device settings
- Debug Configuration - Debug system setup
Hardware Documentation
- Hardware Description - PCB design and electronics
- Enclosure Design - 3D model and assembly
- Assembly Guide - Physical device assembly
Project Resources
License
The firmware is licensed under the GNU General Public License v3.0 or later.
See LICENSE.md for full license text.