I’ve had a low cost carbon dioxide (CO2) sensor sitting on my desk for over a year! I thought why not get this thing recording, as I have already done a load of work sending data to MQTT feeds.
I did a quick search and found this overview for getting started with this sensor: https://www.hackster.io/kritch83/getting-started-with-the-mh-z14a-co2-detector-e96234. This had everything I needed to be able to connect via serial connection and get the CO2 data.
I connected the unit to my ‘Cheeseboard’ ESP8266 development board. The connections were for 5V power and for a 9600 baud rate serial connection for data.
|GND||GND – PIN 2, 3, 12, 16||GND|
|+5V||Power – PIN 1, 15, 17||Vin|
|Serial||Tx – PIN 10, 13, 19||Rx – PIN D2|
|Serial||Rx – PIN 11, 14, 18||Tx – PIN D1|
Using my workshop environment monitor code, I quickly had a template for sending some CO2 parts per million data to AdafruitIO (one of my last free feeds!). I have created a (hacky!) code here for you to upload and be able to send data to an AdafruitIO feed. You will need to create an account and link to it with you AdafruitIO Key.
Github Repository for the code is here: https://github.com/curiouselectric/CO2Monitor
So running the unit for a day or so, here is a graph of the CO2 level in my office room (ignore the very initial data before 8pm, as this was testing…).
I was not quite sure what was ‘normal’. I know that atmospheric CO2 levels are in the region of 400ppm (which is too much, by the way!). In an enclosed room then the level will always be higher than this and with occupancy then the CO2 level will rise, so you can tell when I was in and out of the room. I found some data here (from Velux, the window people) that says that a good reading would be around 1150 ppm, 1400 ppm would be adequate, but 1600 ppm or higher would be poor.
Obviously CO2 levels are only one factor within air quality. Particulates and other solvents are also important. I built this workshop environment monitor, which includes particulates, temperature, humidity and radiation levels!