The Air in Our Homes: An Overlooked Issue
You spend on average 90% of your time indoors. Yet, indoor air quality is often neglected. Carbon dioxide (CO2) accumulates in poorly ventilated rooms, affecting concentration, sleep, and health. With a simple Raspberry Pi board and a few sensors, it is possible to measure this gas in real time and even consider local capture.
This guide is aimed at IT professionals and makers who wish to combine technical skills with practical ecology. We will see how to assemble a domestic CO2 monitoring and capture system, using accessible components and open source projects.
Why Capture CO2 at Home?
Indoor CO2 regularly exceeds 1000 ppm, the threshold at which symptoms like headaches or fatigue appear. Above 2026 ppm, cognitive performance drops significantly. Capturing this CO2 not only improves air quality but also reduces individual carbon footprint.
While industrial systems exist, their cost and complexity make them inaccessible. A DIY approach with Raspberry Pi offers an economical and educational alternative. According to Raspberrypi.com, boards like the Raspberry Pi 5 or Compute Module 5 provide enough power to handle sensors and actuators.
The Heart of the System: Raspberry Pi and Sensors
Choosing the CO2 Sensor
For amateur use, the MH-Z19B sensor is a good compromise: it measures CO2 via infrared absorption (NDIR), with an accuracy of ±50 ppm. It communicates via UART or PWM, making it compatible with any Raspberry Pi model.
Minimal Assembly
- Raspberry Pi (model 3B+ or newer)
- MH-Z19B sensor (or SCD30 for higher precision)
- Dupont wires female-to-female
- 5V 2.5A power supply
- 3D printed case (optional)
Wiring is simple: connect the sensor to 5V power, ground, and GPIO pins (RX/TX). A Python script using the `pyserial` library reads the data.
import serial
ser = serial.Serial('/dev/ttyS0', 9600, timeout=1)
while True:
data = ser.read(9)
if len(data) == 9 and data[0] == 0xFF:
co2 = data[2]*256 + data[3]
print(f"CO2: {co2} ppm")
From Measurement to Action: Triggering Capture
Measuring is not enough: the goal is to capture excess CO2. A simple method is to use a fan that draws air through an activated carbon filter or a soda lime bed. Soda lime chemically absorbs CO2.
The Raspberry Pi controls a relay that activates the fan when the 1000 ppm threshold is exceeded. This system can be enhanced with an OLED display to show real-time values, as proposed in Seeedstudio's tutorial on creating an environmental monitoring system.
Concrete Example: The "PiCO2Capture" Project
A French maker shared on Instructables his system: a Raspberry Pi 4, an MH-Z19B sensor, a 12V fan, and a container filled with 500 g of soda lime. The code, written in Python, records data in a SQLite database and displays it on a web dashboard.
Results: in one day, the CO2 concentration in a 20 m² room dropped from 1800 ppm to 600 ppm in less than two hours. The total cost was about €80 (excluding Raspberry Pi).
Comparison: DIY vs Commercial Solutions
| Criteria | DIY Raspberry Pi | Professional Air Purifier |
|---------|------------------|----------------------------------|
| Cost | ~€80-120 | €300-600 |
| Measurement accuracy | ±50 ppm | ±30 ppm |
| CO2 capture | Yes (via soda lime) | No (HEPA filter only) |
| Customization | Total (open source software) | Limited |
| Power consumption | 10-15 W | 30-60 W |
| Maintenance | Replace soda lime every 2 months | Replace filters every 6 months |
DIY wins on cost and customization but requires more frequent maintenance.
What This Means for You
If you are a developer, data scientist, or simply a tech enthusiast, this project allows you to:
- Learn hands-on sensor interfacing and automation.
- Contribute to open source by sharing your improvements.
- Reduce your carbon footprint in a tangible way.
- Inspire those around you to do the same.
You can start with an existing Raspberry Pi and a €20 sensor. The code is available on GitHub. The impact is immediate: you will see the CO2 curve drop in real time.
Going Further: Home Automation Integration
Once the basic system is operational, you can integrate it into a home automation solution like Home Assistant. A connected CO2 sensor can automatically trigger mechanical ventilation or send alerts to your smartphone. Projects listed on Reddit show how makers have connected their system to Home Assistant to manage overall air quality.
Challenges and Perspectives
Chemical capture via soda lime is not regenerative: the material must be replaced regularly. Alternative solutions like zeolites or MOFs (Metal-Organic Frameworks) could be considered, but their cost remains high for amateur use.
From a regulatory standpoint, the EN 13779 standard recommends sufficient ventilation to keep CO2 below 1000 ppm. A DIY system does not replace a mechanical ventilation system (VMC) but can optimize its operation.
Conclusion
Building a CO2 capture system with Raspberry Pi is an accessible, educational, and useful project. It turns a global problem into a local solution while strengthening your technical skills. As air quality becomes a public health issue, every action counts.
Ready to measure and capture your CO2? Plug in your Raspberry Pi, order a sensor, and get started. The air in your home will thank you.
Further Reading
- Seeedstudio - Arduino Environmental Monitoring System using Grove Sensors - Tutorial on environmental monitoring with Grove.
- Raspberrypi.com - Raspberry Pi Products - Official range of boards and modules.
- Instructables - The Ultimate Guide to Building a Quadcopter From Scratch - Detailed drone building guide, transferable.
- Reddit - List of HomeAssistant Projects - Home automation projects with Home Assistant.
- Learn Adafruit - Adafruit IO Home Security - Home security project.
- Nutsvolts - Keep Your Home Secure with Raspberry Pi - Article on security with Raspberry Pi.
- Besjournals Onlinelibrary Wiley - Broad‐scale applications of the Raspberry Pi: A review and guide - Review of Raspberry Pi applications.
- Store Rakwireless - WisMesh RP2026 Starter Kit for Meshtastic - LoRa kit for mesh networks.
