An ESP8266/nodemcu based CCS811 eCO2/eTVOC sensor plus BME680 temperature/humidity/air pressure sensor + case, for MQTT publication goodness. Disassembly-friendly.
This repo has submodules, notably nodemcu-scaffold, and chained therefrom, nodemcu-libs.
You should thus clone with git's --recursive
flag.
It's a case which (using Dupont cables and enough spacing) fits an ESP8266 NodeMCU devkit v1.0 together with a CCS811 and BME680 sensor breakout board.
Wiring-wise, the two sensors share an i2c bus. This unfortunately necessitates a bit of Dupont cable soldering to create a female-female-female cable. It strikes me as a firmware bug, but I cannot seem to set up two separate i2c busses—which I would otherwise have preferred; the soldering is actually the most time-consuming part of building a new one of these.
Firmware-wise, the thing connects to an MQTT broker, and publishes datapoints every minute for each sensor. I also implemented the CCS811 sensor's ability to receive temperature/humidity for its calibration purposes.
In my setup, these MQTT messages get picked up elsewhere and pumped into InfluxDB and thus allows me to render Grafana dashboards like these:
The spiking to eCO2 around ~8k (the max reading) happens every time the gas stove where I live is used—ventilation is important!
The .scad
is under the openscad folder. I've also put in an STL file for convenience.
It's meant to be printed in the orientation of the model. The strips across the bottom provide print bed adhesion as well as a platform for attaching this to a wall. Double-adhesive tape is a fairly permanent (and wallpaper-damaging!) way to do it, but mine generally hold up with just poster adhesive putty or similar.
It should be possible to simply run make upload
and issue a node.flashreload("lfs.img")
from within the serial console. Really, the nodemcu-scaffold project's README is the best place to start—in fact, you'd be best off attempting an upload of that project first.
Of course, once this builds and uploads, it'll fail horribly at connecting to my MQTT setup, etc.
A couple of things I've picked up along the way:
-
CO₂ is heavier than your average air. In a room with little circulation, this will matter a bit. To the extent aesthetics allow, measure at expected head height, like the UK standards for schools.
-
The CCS811's eCO2 and eTVOC readouts are apparently always proportional. I suspect the sensor comes up with the two "equivalent" numbers based on the same actual measurement. I tend to ignore eTVOC.
-
The CCS811 in particular seems very sensitive to gusts of wind. Thus, the case might even be too open for its own good.
-
The BME680 supposedly supports a proprietary algorithm provided by Bosch's SDK which would compute an IAQ index. I have little interest for proprietary algorithms, so I merely log the "gas resistance."
Credit to kstobbe's projects. Both the CCS811 based one (which I pursued here) and the subsequent build where that sensor is replaced by MICS6814.
Next step for me would be to attempt using this PM1.0+PM2.5+PM10 sensor in this same project. That'll require a redesign at some point.