CO₂ sensor for Home Assistant
Intro #
A good friend of mine go a hold of a few SCD-41 CO₂ sensors from Sensirion for a very good price.
He had plans to make something with them, but never got around to it.
Because of this I made him the proposal, that I will make him a custom circuit board in return for a few of these sensors.
EDA tool #
Since I constantly use Altium Designer for work, I’ve designed most of my own circuit boards also in there.
It always bothered me, that I needed to use the company license and that the software seems to constantly getting worse over time.
Ideally I wanted to do my designs in a tool that I own and don’t just rent for a limited time and at some point don’t have access to anymore.
Eagle was quite nice in that regard, but Autodesk bought that and drove it against a wall.
A while ago I got to know the lead developer behind LibrePCB.
I took a look at it and was amazed on what he managed to create as a mostly solo project.
It is still a bit rough in places, but has a solid foundation and I wanted to give it a shot.
Testing out the sensors #
Before making a board I wanted to make sure that that sensor is working how I expect it and that I didn’t overlook anything important. For testing I used an arduino nano, a breadboard and a little bit of Claude spaghetti.
Use case #
Since a while now I have a Home Assistant instance running on my server and have been slowly adding sensors and gadgets to it. Some of them I added with ESPHome, which required little programming and resulted in a working device rather quickly.
Since the last time I used an ESP32 Espressif has released many new variants of that family.
One of them being the ESP32-S3.
As a module these are very easy to integrate in a custom circuit board (as are the others).
Design #
My friend had the idea to shape the board similar to a USB stick. Like this it could simply be plugged into a phone charger.
I liked that idea, but wanted to keep a second option open to place it somewhere and have a cable going to it.
After checking in the layout editor I decided to include a USB-A plug and also a USB-C socket as an assembly variant.
Like this, one or the other can be used depending on preference.
Assmbly #
Soldering it together was very straight forward using a solder stencil, tweezers and a steady hand.
While designing this board, I decided to use my new 0402 assortment of resistors and capacitors.
This was not at all needed to fit on the board and only made the soldering more fiddly, but oh well you’re always smarter I hindsight.
Home Assistant integration #
The integration with ESPHome was very easy.
I mostly copied the configuration from a previously added sensor, adjusted the names and replaced the sensor section with the example from ESPHome for this exact sensor.
Sources #
The whole pcb design, housings and a config example for ESPHome can be found here: https://github.com/lbarbisch/CO2-Sensor-Node