I’m making my own Smart Home Sensors!

In part because I can’t help myself, and in part because I wanted something better than what’s out there already, I’m making my own smart home sensors. Specifically, I’m making this, a Zigbee CO2, temperature and humidity sensor, with the option to add in both a particulate matter sensor, and even a volatile organic compound sensor, and all of this is (importantly for me) Zigbee. It’s all offline, not connected over WiFi. Let me explain a bit more.

First, the problem. Most existing air quality monitors are big, bulky, often require an external power supply, aren’t silent thanks to the built in fan and my cardinal sin – connect over WiFi. Check my other smart home videos if you want to know why I have a pathological hatred of WiFi smart devices. So, I started making my own Zigbee devices. If you want a Matter over Thread device, IKEA’s ALPSTUGA is your best bet. For Zigbee, this is all you need! My board just takes a USB C cable, isn’t bulky, and is silent thanks to the distinct lack of a fan. How? Let’s talk parts.

One of the main stars of the show is this, the Sensirion STCC4. This is a practically microscopic little CO2 sensor that kind of redefines what a CO2 sensor looks like, and functions. The old style CO2 sensors have a kind of big chamber, an infrared LED, and a light sensor that is specific to the 4.26 micrometre wavelength of light that CO2 produces. The more of that specific wavelength, the more CO2 that light must be bouncing off of. The downside to this style of sensor is its size, and some even require a small fan to move the ambient air through the sensor’s internal volume. This little guy absolutely doesn’t. This is a silicon sensor that uses the thermal conductivity of CO2 to determine the amount of it in the air, which means it can be an insanely small package, and still decently accurate. Sensirion quotes plus/minus 100 ppm, plus 10 percent of the reading for accuracy. That isn’t quite as sharp as some of the larger sensor packages, but it’s more than good enough for home use. It can also report anywhere between 380 and 32000 ppm – although anything over 1500 is considered pretty bad for you, at 32000… I dunno, I’m no doctor, but I think you’re dead at that point. Anyway, the key thing for this sensor is that since it uses the thermal conductivity of the CO2 to measure amount, it needs to know the ambient temperature and humidity, and therefore is designed to have a Sensirion’s SHT4x strapped right to it. That is an all in one temperature and humidity sensor, and it connects directly to the STCC4 to give instant readings – and happily the STCC4 will return those temperature and humidity readings too, which means we get three results for the price of one! This thing gives you readings at least every ten seconds (although I’ve set it to 30 seconds), and it is remarkably sensitive. This is a great bit of kit! 

As for why it’s so important to monitor the CO2 level especially indoors, the higher the CO2, the less oxygen you and your brain can get, and funnily enough your brain kinda needs oxygen. Outdoor levels are around 400 parts per million, or PPM, and indoor levels tend to sit between 400 and 1000 ppm – that’s just the effect of trapping air in a box and us humans (and any pets you have) exchanging the oxygen (O2) in the air, for CO2. Assuming you have good circulation – and ideally a heat-exchanging fresh air ventilation system – indoor CO2 sitting between 400 and 1000 is perfectly fine. Above 1000 you generally start to feel it. At 1500 ppm or so you are likely to feel a little drowsy and if you are particularly sensitive to a lack of oxygen (like me), you’ll start feeling more symptoms too. At over 2000 most people will start getting headaches, nauseous, increased heartrate, and you’ll begin the ADHD simulator (loss of attention and poor concentration). For people without fancy air exchangers, having a CO2 monitor like this is really useful so you know when to open a window and flush out the bad air. It’s also a great datapoint on how your environment can affect you and your health, something I care an awful lot about these days.

The next magic bit of kit is this, the Bosch BMV080. This is another bit of pure magic that shrinks a palm-sized block into the thinnest ribbon cable known to man. This is a particulate matter sensor that measures the concentration of three different particle sizes. Particulate matter concentration can be bad for mostly your lungs – if like me you’ve got asthma it’s extra bad – with the EPA listing these as the acceptable, and unacceptable, ranges. Most particulate sensors absolutely use a fan – that’s a necessity – and they also only measure one size of particles, generally PM2.5, or 2.5 micrometre in diameter. That is the most pertinent for us humans and our lungs, but having access to both one size larger, PM10, and one step smaller, PM1, can be really helpful too. Luckily, the BMV080 does all three, and it does it all without a fan too! This uses a class one laser to measure the light scattered by the particles in the air, and report back their findings. The fact that this thing can do it with nothing but 3.3V power and no fan is incredible – although the fact this thing costs £25 a pop kinda makes sense once you realise just how complex this thing is, despite its size. Since this is just a little ribbon cable you clip onto the board, my intention is (assuming I end up making these available for sale anyway) to offer you the option to get the board with or without it. 

There is a complication with Zigbee and this thing, which is that at least on the Espressif front, their Zigbee library doesn’t support PM1 or PM10, so I’m having to write custom code to make it work. While I hope they make it official at some point, for now the default way for this to work right now is CO2, temperature, humidity, and PM2.5. That also means the VOC sensor I want to include also doesn’t work over Zigbee yet either – again, something I’m working on. When it comes to that VOC sensor, the plan is to use the Bosch BME690. This thing uses a real fancy gas sensor that can detect not only VOCs, VSCs (volatile sulfur compounds), and other gases like carbon monoxide and hydrogen. This also has pressure, humidity and temperature sensors, which is handy to compare to the Sensirion one. The sensor reports an index for air quality (IAQ), which is basically a score for how clean the air is. 0 to 50 is perfect, 50 to 100 is fine, 100 to 150 is mid, 150 to 200 is likely to be an irritant to your throat and breathing, and really anything over 200 is pretty damn bad. This sensor actually reports kinda a lot of data, including even a CO2 equivalent figure which is fun to compare to the actual CO2 sensor, and direct VOC measurements in parts per million. This one is even more optional for the moment, as none of these measurements are currently supported over Zigbee. 

The fun thing about this board is that the Zigbee microcontroller I’m using here is an ESP32-C6, which supports both Zigbee AND WiFi, so if you want all the data this setup can offer, you can just flash it with ESPHome and connect over WiFi instead. I much prefer Zigbee, obviously, but it’s really nice that it’s an option. That ESP32-C6 is a tiny little all-in-one board that has its antenna built in, it’s pretty low power, it’s a RISC-V chip, and just so, so small. This is kinda the ideal choice – the H2 is smaller and lower power, but only supports Zigbee, not WiFi – so this C6 is where it’s at. 

That’s what I’m aiming for with this thing anyway, I don’t know when I might have this thing ready for myself let alone anyone else, but it’s in the works. I’d love to hear what you think about this, and if you’d be interested in one.