This projects provides instructions for building a CO₂ sensor from off the shelve electronic parts combined with 3D printed housing parts.
-
CO₂, temperature, humidity, pressure, altitude.
-
6 weeks on a single battery charge, when operated in low power mode (no WiFi, 3 minute display update).
-
Sensirion SCD-41 Sensor used, a small and high performance photoacoustic CO₂ sensor.
-
Chart with 1h, 3h, 6h, 12h or 24h data history.
-
Dark mode (inverted) optional.
-
Configurable Thresholds for CO₂, temperature und humidity.
-
Configurable temperature unit (°C/°F) and timezone.
-
Unlimited measurement history through internal SD-Card storage.
-
WiFi for access to current and historic measurements and to change device configuration, calibration, update firmware.
-
MQTT can be configured to auto publish measurements (MQTT).
-
The housing can be wall mounted, with or without theft protection.
This project is built with PlatformIO. Please refer to the instructions provided on the PlatformIO website. PlatformIO makes development with the ESP32 microcontroller easier and faster compared to the Arduino IDE. If you have not switched yet i advise you to do so, it will save you time after a very short period of time. The PlatformIO project, and configuration files can be found here.
Building instructions, drawings and printable files for the device.
A react UI for data retrieval and administration of the device.
The device display supports multiple display modes, "table", "chart" and "calibration".
-
In table mode the latest CO₂, temperature and humidity values are shown numerically.
-
In chart mode one of CO₂, temperature, humidity or pressure are shown in a simple chart.
-
In calibration mode, the most recent history of values is shown together with simple statistics. The device can then be calibrated either to a configurable value and button press, or through the wifi-rest-api and value that can be specified by the user.
-
The device provides various possibilities to access current and historic data over the wifi-rest-api.
-
It is possible to configure a mqtt connection and upload the mqtt brokers certificate if needed. The device will make connections in configurable intervals und publish it's measurements. Even though no POC has been made so far, it should be straightforward to integrate the sensor into i.e. Home Assistant.
The device display can be switched to calibration display mode, then put outside into fresh air. After 10 minutes the recent measurement history standard deviation can be checked and, if within plausible tolerance, the device can be calibrated to a reference value previously configured. See moth_core/disp.json and moth_client/client_config for more details.
The rest-api of the device provides the "co2cal" endpoint. Here it is possible to calibrate the device to any value above 400pmm. This enables calibration to value other than outside air, if known from i.e. other devices (see: moth_client/wifi-rest-api) for more detail.
Please be aware that all software in this project is licensed under the MIT license, while the drawings and 3d-printed parts are licensed under the Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license.