Mysensors-capable CO2-sensor

I have suspected for a while that the CO2 levels at night in my bedroom are quite high, and when there was a sale on Senseair S8 sensors a few weeks ago, I decided to get one.

The original intent was to use the ESPEasy-based controller I use to control the air conditioning, but the NodeMCU board runs on 3.3V and the Senseair S8 wants 5V so it was easier to do something based on my go-to solution for remote sensors, mysensors.org.

A quick breadboard-build confirmed that yes, CO2 indeed gets high during the night (the Y axis is PPM, and it falls well within the uncomfortable levels).

To mount the sensor in the room, I needed a well-vented enclosure, and since the sensor is anything but cheap, it had to be reasonably sturdy as well.

Hence, FreeCAD and 3D-printing!

The enclosure is made from three parts and kept together with hot glue. A vented dome encloses the sensor which is mounted on a plate. Glue the cables to the plate to avoid the sensor bouncing around. All files are available at thingiverse. 

Code

To get this working,  combine the code example from https://www.co2meter.com/blogs/news/35432257-arduino-code-for-k-30-co2-sensor-works-for-s8-sensor-too with the code example from https://forum.mysensors.org/topic/6528/mh-z19-co2-sensor/7 to enable CO2 level reporting to homeassistant.

Since the licensing for the first example from co2meter.com is unclear, I leave it as an exercise to the reader to combine the two (Hint: Use sendRequest() and getValue() + all related code from co2meter.com to read the CO2 PPM, then use the mysensors example to pass it on to the controller)

Then what?

The sensor readings will be used to control two fans connected to a normal Z-Wave relay (or similar) that will push in fresh air through the vents when the CO2 levels are too high.

Kommentera

Fyll i dina uppgifter nedan eller klicka på en ikon för att logga in:

WordPress.com Logo

Du kommenterar med ditt WordPress.com-konto. Logga ut /  Ändra )

Google-foto

Du kommenterar med ditt Google-konto. Logga ut /  Ändra )

Twitter-bild

Du kommenterar med ditt Twitter-konto. Logga ut /  Ändra )

Facebook-foto

Du kommenterar med ditt Facebook-konto. Logga ut /  Ändra )

Ansluter till %s

%d bloggare gillar detta: