Cognitive Function-Maxxing with Smart Home Tech
An introduction to human engineering through my journey with CO2 monitoring.
Have you ever noticed yourself getting sleepy after sitting in an office for a while? Have you ever felt unable to concentrate while taking an exam in a large lecture hall?
Of course we all get tired at work and nervous during tests. But otherwise imperceptible environmental factors could also be at play.
Ever since I watched this Tom Scott video seven years ago, I’ve been acutely aware of the effects carbon dioxide levels can have on cognition and concentration. If you go outside, you’re likely to measure a nominal CO2 level of 400ppm (much to climate change scientists’ concern !!). But if you take a reading in your bedroom after you’ve been working with the door shut for a few hours, levels can quickly rise to > 2000ppm.
The bad news is that cognitive function has been shown to be inversely correlated to CO2 concentration. At 1400ppm, cognitive function on demanding tasks (like your physics exam, or my software engineering job) can decline by up to 50%.
I wasn’t going to accept the fact that my brain could be slowing down due to invisible particles in the air. So $30 and one Amazon purchase later, I got my hands on a portable CO2 monitor.
This handheld monitor provided great value to my life. Every hour or so, I would check the reading, and if it was over 1000ppm, I’d get up and open a window (or turn on the central HVAC fan).
When I tell people about my interest in “biohacking,” I get the sense that they usually have the wrong idea. The word might conjure images of cyborgs, implants, and brain-machine interfaces. Admittedly, I do have a microchip in my hand, but that’s beside the point. The definition of biohacking that I subscribe to is:
Using technology to enhance the human condition through biological interfaces.
Under this definition, something as simple as buying a CO2 monitor counts as biohacking! You’re improving a biological factor by using technology. Nothing about this is invasive—you’ve just introduced another metric into your life!
Due to the weird reaction the term “biohacking” gets, I’ve started trying to popularize the term human engineering. Bringing a CO2 monitor to work is just as much human engineering as inserting a magnet into your finger is.
Anyways, back to the story. I brought my handheld CO2 monitor to my office. At the beginning of the day, levels started out pretty normal (around 600ppm), but by lunch time, they had risen all the way to 1500ppm. Obviously, this was due to about 15 humans performing respiration; or, alternatively, 500 trillion human cells performing cellular respiration.
Now, I must admit, having the CO2 monitor subjected me to the possibility of the nocebo effect. Watching the number rise potentially had psychological effects that made me actually feel less focused, or at the very least, attribute my tiredness to the CO2 concentration. However, when the solution is as simple as opening up a window, such downsides are miniscule.
This system worked great for a few days, but as a software developer who loves to over-engineer systems, I couldn’t just stop here.
Despite probably costing me time in the long run, I’ve always loved automation! Checking the handheld monitor every few hours was a mental burden and one more thing to distract me. What if I could be automatically alerted when the CO2 levels rose to unacceptable levels?
After a bit of research, I landed on the Netatmo Weather Station, which is a consumer smart home device that constantly monitors your environment for factors like temperature, humidity, air pressure, and of course CO2 concentration. Luckily, this device connected to the Netatmo cloud, which has a convenient developer API! This API meant that I could ingest CO2 data into a simple Python or Node server running on my cloud VM, and send it anywhere I wanted.
The company I was interning for at the time was big into observability, meaning I had to learn how to use a system called Grafana. Grafana was indeed used for Official Company Business to monitor the health of the app, but I had other purposes in mind. I quickly set up some server code to forward data from the Netatmo API to Grafana, and the result was this beautiful graph!
The next step was to create automated alerts. Grafana can be used to ping oncall engineers when request traffic drops below normal levels, so there’s no reason it couldn’t ping me when CO2 levels rose too high!
Alerts, straight to the company Slack channel.
And with that, I had arrived at a pretty good solution. Even after my internship ended, I took the system back to my dorm room to monitor levels at home. I’d like to remark on some next steps I could take to make the system more robust and extensible (as any good software engineer should).
First, to my delight, the smart home world has been moving away from the old model of devices talking to 3rd-party servers. Besides being a privacy risk, commands and data having to go through multiple hops in the cloud is less than ideal. Instead of this, standards like Matter (over Wifi or Thread) have seen great participation from big tech and small manufacturers alike. Matter would allow your Google Home voice-activated speaker to talk to your lights, buttons, and CO2 monitors without any requests leaving your private LAN. Unfortunately, there are no commercial Matter-enabled CO2 monitors yet, but more devices are being added by the day—and you could even make your own using an Arduino Nano Matter!
Second, my Netatmo-to-Grafana forwarding code was pretty hacky. There are more robust solutions such as Home Assistant, used by the top 1% of smart home enthusiasts.
Finally, it would be awesome to make all of this data available to AI agents! This is completely within the realm of possibility given software like the Home Assistant MCP server.
In conclusion, I hope I’ve broadened your sense of what biohacking/human engineering constitute. You can make quite drastic improvements to your life with a little bit of technology. And even if you’re not big into smart home or aren’t the best with code, something as simple as a handheld monitor can make your day-to-day experience so much better.
View my open-source Netatmo + Grafana server repository to build your own monitoring system, or check out my other work at yoonicode.com. Cheers!





