Reducing infections by keeping aerosol concentration low via a CO2 monitor

Hi everybody,

after a first post in the "Project Guidance" section, I have the feeling that my project is mature enough to be presented here.

Discussing if it's possible to keep class rooms and lecture halls safe in terms of keeping the probability for a corona-infection low, we came up with the idea to measure the CO2 concentration as this is proportional to the aerosol concentration in exhaled air (and aerosols are currently discussed to be responsible for further infections).

First of all, the project is hosted on GitHub: GitHub - alfkoehn/CO2_monitor: An open-source CO2 monitor helping to ensure a healthy environment in a class room and slowing down the spread of the corona SARS-CoV-2 virus.

To give a brief overview here, it is based on the following hardware:

  • ESP8266
  • SCD30 (CO2 detector)
  • OLED or LCD display (code has support for both)

The CO2 concentration is measured with the SCD30 sensor (including temperature and humidity). The measured values are shown on an OLED or LCD display, with some reaction based on the CO2 concentration. The idea is that if the CO2 concentration is too high, ventilation is required (open a window) and that is either indicated by a sad emoji or some text on the display.

In addition, the data can be accessed via a website: the esp8266 requires to be logged into your wifi and then shows time-traces for all three values measured. The graphs are made with Chart.js. Furthermore, the data is logged in a table and can be downloaded as a csv via clicking a button such that you can further process it. An example is shown in the screenshot.

At the moment, I have reduced the number of datapoints to 1000, so only the last 1000 points are stored.

My question now: since I have already a few functions in the .ino file, I was wondering what the general policy or rather recommendation about sub-files or libraries is: can I simply put the "helper" functions into separate library files which I include in the .ino file ? And are these files automatically copied to the esp8266 when compiling and transferring the ino file with the Arduino IDE?


You will have to make your library and import it into the custom library section in the Web Editor. Then just do the "#include" function thingy and you're set. (I didn't really understand about what you're talking about, but hopefully this matches at least part of what you're talking about.)