I came across the topic of air quality measurement several times within the last couple of years (mainly on scientific or technical podcasts). As a developer I’m aware of the problem of bad air quality in the office without noticing it. If you’re busy problem solving, you might not have time to care about unimportant things like oxygen.
On a second though oxygen might help your brain solving the problem faster and keeps you awake. I came to the conclusion that a simple device which changes it’s color from green over yellow to red in order to signalize “hey dude, it’s time to open the window” would be the best for my use case.
I liked the idea that the device should fit nice on a desk and looks somewhat friendly (and maybe a bit nerdy). So an 8-bit ghost was the obvious solution.
The design has been added to the printables.com “Educational Tools” contest because I think it is a great way to do experiments with CO² levels in poorly ventilated classrooms. Using the Arduino IDE the functionality can be easily extended by students.
I wanted the device to be reproducible (as christmas presents), so I decided to design a custom PCB. Nothing fancy, just a controller, an LDO, some pixel LEDs and passives. I used four layers because it doesn’t cost much more and it speeds up the process. If somebody wants to I’m sure it can be reduced to 2-layers.
In order to allow expansion of the functionality and maybe some kind of integration into a smart home setup, the ESP32-C6 seemed like a good fit for the project. It offers the whole range of 2.4GHz standards (WiFi, Bluetooth, 802.15.4 –> ZigBee, Thread).
I tested some sensors (including VOC sensors) and came to the conclusion that only a real CO2-sensor delivers reliable results. The smallest and “cheapest” solution which is widely available is the Sensirion SCD40. You can get it for around 30$ from DigiKey.
The sensor is attached to the board using spring loaded pins in order to avoid damaging it or heat it up to much in the soldering process. Besides the spring loaded pin option, there is also a header which fits the boards available from ebay or aliexpress. I didn’t design any 3D parts for this, so you have to design it yourself.
The device uses 17 WS2812B RGB LEDs which should be driven on a low brightness level in order to avoid heat (and dazzling).
It doesn’t take expert level skills to solder the board, but a beginner might run into problems soldering the smaller components and finer pitch parts, especially the USB-C connector.
I still don’t like the Arduino IDE and the “Arduino Sketch” style of programming. But I get the point that it should be easy for beginners and it allows non programmers to “get shit done”.
Anyways, I decided to write a basic firmware using Arduino to allow more people to have fun with the project.
The sketch should have enough comments and a sufficient naming scheme to make it understandable. In good Arduino style, a maximum of external libraries have to be imported:
Partlist
You can order the board from anywhere you like. Gerbers are provided with the project files. The boards includes a holder for the springs. Before doing anything else you should remove it and put it aside. If you want to connect the ground pad of the ESP module, you should solder it first. I recommend to solder all LEDs and their decoupling caps afterwards. Remaining SMD components can be soldered in a small to large manner. As a last step the spring loaded pin assembly needs to be put together. It’s a bit tricky, so take your time. Make sure you dont solder the “springy” part. I provide some detail pictures as a reference.
For easy assembly you can use the “Interactive BOM” provided in the download archive.
Remember that you also have to buy the CO2 sensor: Sensirion SCD40-D-R2 which is seen as an external component and is therefore not part of the BOM.
Nothing special about this. I used a .4mm nozzle and a .2mm layer hight with 15% infill. My print was a bit stringy because of the slightly older PETG filament. PLA might be the better option here.
First screw the sensor to the board and slide the M3 nuts into the front cover. Continue with the eye assembly. Place the board into the case and add the sensor cover and the button cover. Add the back cover and tight it shut with the countersunk screws.
Download a recent version of the Arduino IDE and install the following libraries (Tools -> Manage Libraries):
As well as the board support package (Tools -> Board -> Boards manager)
Select the board “esp32 -> ESP32C6 Dev Module” and make sure to enable “USB CDC On Boot” in order to get the println outputs on the serial monitor. It might also be neccessary to install pyserial (serial libraries for python) in order to get the ESP32 tools running.
Within the provided ZIP file you will find:
The author marked this model as their own original creation.