Wednesday, September 8, 2021

Indoor Carbon Dioxide Monitor

 One might ask why someone would want to monitor the levels of carbon dioxide (CO2) in his or her indoor environment. Well, let me tell you about an article that I read in Make Magazine makezine.com.

The article was written by Dale Dougherty and Guido Burger. The essence is that the concentration of CO2 can have a significant effect on the transmissibility of disease. Further, it can have an impact on people's mental acuity. 

Let's look at these in turn. The authors cited an article titled effect of ventilation improvement during a tuberculosis outbreak in underventilated university buildings  ncbi.nlm.nih.gov/pmc/articles/PMC7217216/  While I encourage you to read the article or at least the abstract, the conclusion was that some poorly ventilated rooms at the university were registering CO2 levels above 3,000 parts per million (ppm). When the levels were reduced to under 600 ppm the transmission of tuberculosis from the environment ceased. Of course this doesn't have anything directly to do with CO2 but rather measuring the concentration of CO2 is an easy way to determine how effectively the air is being turned over in an indoor environment. The concentration of CO2 in outdoor air is about 430 ppm.

The second article referenced was Impact of CO2 on decision-making Usha Satish, Mark j. Mendell, et al. 2012. doi.org/10.1289/ehp.1104789  This article found negative impacts on mental acuity that were caused apparently by the higher concentrations of CO2 found in some office environments.

Well, that's enough of that. I encourage you to read the papers but I found this interesting given the current discussions concerning school reopenings with high levels of Covid infections. One of my daughters is a teacher and I thought it would be interesting to build a CO2 monitor that she could place in her classroom. The article in Make Magazine that I mentioned above describes a wonderful assortment of form factors and displays for this type of device. I wanted to build something quickly for my daughter to use and made the device shown on the right. It shows the current CO2 concentration and every 15 seconds adds a bar to the graph. 


Simple is the key word here. There is a microcontroller, a TFT display, a CO2 sensor, and connector to hook them together. Adafruit developed a standard for microcontroller shapes and pinouts such that anything that meets the "feather" standard can be plugged together. I happened to have a Sparkfun esp32 Thing Plus, which adheres to the feather standard. This is a more powerful processor than that required for this project but, as I said I had it just sitting around. From Adafruit I ordered a "TFT FeatherWing 2.4in." display, an "SCD-40 True CO2" sensor and a "STEMMA QT / Qwiic" connector cable.

Once the parts arrived it literally took less than a minute to connect them together. The processor plugs into the back of the screen.






And they look like this when they're put together.











Then it was just a matter of plugging one end of the cable into the processor and the other end into the sensor.






I wrote the software in an afternoon with the help of the example program in the library that supports the sensor and the detailed Adafruit document that supports the display. Then I printed a case on my 3D printer and it was done. In the picture of the case you can see the little cage on the lower edge of the case back on the right in the picture. This is where the sensor sits so it is exposed to the air.


I sent it off to my daughter and will post an update after she has had a chance to try it out.