This side project was developed entirely using ChatGPT, along with basic knowledge of electronics, C programming, and front-end development. The current site is a dashboard hosted on GitHub that displays the internal environmental parameters of my apartment. All measurements are taken using an ESP32 board and a Bosch BME680 sensor. Data is recorded every minute and sent to a spreadsheet, where it is summarized in real time in other sections of this site.
BME680 Sensor Overview
The BME680 is an all-in-one sensor that integrates multiple sensing capabilities into a single compact package. Specifically, it includes a small Metal-Oxide (MOX) sensor. The heated metal oxide modifies its resistance based on the presence of Volatile Organic Compounds (VOCs) in the air, allowing it to detect gases and alcohols such as ethanol, methanol, and carbon monoxide. This feature makes the BME680 ideal for monitoring air quality.
The BME680 offers users the ability to individually adjust the sampling rates for each sensor component—temperature, humidity, pressure, and gas. Additionally, users can set the inter-measurement delay and the IIR filter sampling coefficient. This combination of settings provides precise control over measurement timing and accuracy, as well as effective energy management.
Sensor Capabilities
Temperature Detection
- Range: -40°C to +85°C
- Precision: ±0.5°C (within 0°C to +65°C)
- Resolution: 0.01°C
- Note: The onboard temperature sensor is attached to the PCB and experiences slight self-heating, typically resulting in temperature readings that are slightly higher than the ambient environment.
Humidity Detection
- Range: 0% to 100% Relative Humidity (non-condensing)
- Precision: ±3%
- Resolution: 0.008%
Pressure Detection
- Operating Temperature: -40°C to +85°C (optimal precision between 0°C and +65°C)
- Range: 300 hPa to 1100 hPa
- Precision: ±1.0 hPa
- Resolution: 0.2 Pa
Gas Detection
The gas sensor operates by internally heating a small surface and measuring the resistance of the gas layer. This resistance indicates the concentration of VOCs in the air, providing an indirect measure of air quality. It’s important to note that while the sensor provides a resistance value relative to the overall VOC content, it cannot differentiate between specific gases or alcohols.
Backend Architecture
The backend of this project employs a straightforward and "naive" solution that achieves the desired functionality with minimal effort and investment.
Data Transmission
The ESP32 microcontroller collects sensor data from the BME680 and sends it to a Google Spreadsheet. This is accomplished using a Google App Script, which serves as an intermediary to receive HTTP requests from the ESP32 and append the data to the spreadsheet.
Data Storage
Sensor readings are stored in a Google Spreadsheet each minute, providing an accessible and easily manageable repository for the collected data. This method eliminates the need for setting up and maintaining a dedicated database.
Data Retrieval and Processing
A JavaScript script reads the data from the Google Spreadsheet. This script organizes the data, making it ready for visualization on the dashboard.
Frontend Dashboard
- Summary Screen: Displays the most recent measurements from the last five minutes, allowing for quick and easy monitoring of current environmental conditions.
- Dedicated Pages: Each sensor metric (e.g., temperature, humidity, pressure, air quality) has its own dedicated page where users can view the complete historical data, enabling detailed analysis and trend tracking over time.
Arduino Integration
The Arduino code, freely accessible in the GitHub repository, integrates the use of the BSEC (Bosch Software Environmental Cluster) libraries. These libraries allow for calibrated readings from Bosch, providing offsets for temperature and humidity measurements. Additionally, the code processes gas sensor values to generate a final Indoor Air Quality (IAQ) value, offering a comprehensive overview of the environmental conditions within the apartment.