Developing a Free and Open Source CO2 Sensor System
Developing an Free and Open Source end-to-end system for CO2 monitoring.
Ongoing notes on development are posted here.
Update 05 Feb 2021
- Pi screen display
- RTC to keep track of time
- LoRa gateway setup
- Jupyter install on Pi
- Forced calibration procedure
- Set interval from Pi
Update 30 Jan 2021
Bayou-CO2 up and running.
Feedmaps prototyped. Backend needs work.
Pi set up as Bridge. Can store data locally on Pi without internet connection.
Heltec version, REV_F working.
MicroSD seen as most reliable and accessible way to set up wifi + Bayou credentials on device. Heltec difficult to set up this way. Pivoting to FeatherESP32 in next PCB design.
Next design: Feather ESP32-based, and designed as 'bottom plate' for a clear plastic enclosure (1591BT). Right-angle USB pointing down and buttons on bottom. (MicroSD on bottom too? Would allow for header to use Adafruit board if useful / option). Stand-offs for mounting on wall. If doing this, could also put LoRa on bottom, too. That way the SMT parts get soldered on one side, and can conserve space on other side.)
Lending library design is main focus. System that can collect data on-site. Can also think about 'sync', with replication of feeds into the cloud.
Pi as bridge allows for local data storage, and optional sync to cloud. Can use hotspot with ethernet jack (widely avail).
Same design could accomodate a Feather M0 LoRA as a remote node, with different firmware, taking credentials from microSD. Or the codebase could use ESP32 + LoRa. Might be easier to do that, with a software 'switch'. Not sure. Can prototype both ways.
Goals for Version 1
(Updated: 2020-12-09 08:31:32)
Key to assessment of work items:
- [X] -- "Done"
- [EASY] -- Won't take much additional effort or time. A day or two or work.
- [MEDIUM] -- Straightforward, but could take up to a week of work.
- [HARD] -- Will take a lot of time / effort. May need to reconsider.
Hardware + firmware
- Ability to turn of autocalibration [X]
- Ability to trigger calibration value in firmware [X]
- Http PUT/POST to online server [X]
- Gardware for pressure compensation [X]
- Firmware compensation using pressure input [SHORT]
- 'Calibrate' button that works on interrupt & is debounced [MEDIUM]
- Reasonable first pass at enclosure that respects the scd30 design guidelines [MEDIUM]
- Initial prototype using 'nosql' data server with simple public key / private key design for accessing / posting to feeds [X]
- Redo initial prototype using Node + Express + Postgresql server + database backend [MEDIUM]
- Add simple user login to permit data feed creation [HARD]
Client data viz / analysis
- Initial simple graphing and location of sensors on a floorplan [X]
- Feed graphs can be show in summary graphical form in a 'list' [X]
- Client that takes in multiple data feeds from Bayou [HARD]
- Client can choose which available parameters to display [HARD]
- Feed location on a floorplan / map can be display and 'highlighted' by clicking on / hovering over feed list [MEDIUM]
- Thresholds can be displayed on the graph as lines or bands [SHORT]
- User can define / select thresholds on a per-graph basis [MEDIUM]
- Demo of using Jupyter to download and analyze data [EASY]
- Demo of using R to download and analyze data [MEDIUM]
Science / calibration / validation
- Demonstrate calibration with 'fresh air' [EASY]
- Demonstrate calibration with CO2 cannister (and then matching fresh air on later measurement) [HARD]
- Comparison of scd30 modules against one another [EASY]
- Comparison of scd30 modules with k30, z19 [MEDIUM]
Goals for Version 2
User data viz / analysis workflow
- Client that takes in data feeds from multiple data feed sources (e.g. Adafruit.io)
- Data feed parameters can be overlaid on same graph and compared
Hardware + firmware
- bluetooth configuration of parameters
- lora gateway + lora remote nodes
- MQTT functionality
Science / calibration / validation
- Import parameters from various air / infection 'models' and apply as thresholds to graph
Hardware and Firmware
- Several working hardware designs, incorporating variously the Feather M0 LoRa, Feather ESP32, and Heltec Wifi 32 LoRa V2. Focus is on the Sensiron SCD30 CO2 module, as it is well-reviewed, has straightforward power requirements (3.3V), and is well-documented.
- Current hardware designs incorporate pressure sensor for ambient pressure compensation, and an OLED display.
- Experiments with an electret microphone (using MAX466 amplifier) have been promising.
- Preliminary light sensor experiment failed due to (we think) to protocol conflicts; may pause on this until a later version.
- Captured data for overnight, morning and evening activities, and simultaneous deployment of two side-by-side SCD30 sensors, and in process of analyzing / reviewing.
- Working to incoroprate an interrupt-based button activation for 'forced calibration'. Debouncing code will be necessary for this. SCD30 library from Sparkfun includes the force calibration code.
- Currently reviewing best practices around enclosure design, sensor placement, and field calibration for SCD30.
- Currently out ESP32 micro workflow; a fully-custom PCB based on the ESP32 will be designed to reduce overall costs.
- Deciding on pin breakouts / interfaces. i2c (including qwiic connector), serial, analog.
- Implementing wifi and feed configuration via local wifi / Bluetooth.
- Backup battery management. Battery will be useful in cases where sensor must be brought outdoors temporarily for calibration purposes.
- Comparison of 'force calibrated' SCD30 (x2), K30, and Z19 sensors, co-deployed.
- Bayou data storage is operation and working solidly. Uses 'nosql' / 'flat' database scheme (pouchdb / leveldb), and fastify for server.
- Looking to replace Bayou backend with a node + express + Postgresql alternative.
- Beginning to experiment with a React-based front-end.
- Working on demonstration of Reach-based mapping of sensor location (on map / floorplan) with most recent values and associated historical graphs.
- Have begun experimenting with workflows in Jupyter.
- Basic analysis / workflow leading to identification of peak values, averages, baseline.
- Reproducing the workflow in R.
REV_E Parts list