Skip to the content
2 layers95.3 × 34 mmGasSensor, the printed circuit board in 3D

Create an ESP32-C6 based air quality sensor for Matter. Grab CO2 concentration in real time and update in any Matter compatible app.

Size
95.3 × 34 mm
Copper layers
2
Thickness
1.6 mm
Parts
22
Nets
49
Pads
130
Tracks, vias
231, 20
Pours
2
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
19 Oct 2025
Updated
20 Oct 2025

Overview

GasSensor is an open-source printed circuit board by Daniel-Abdi, from the Daniel-Abdi/Matter-CO2-AirQuality-Sensor repository on GitHub. It is a 2-layer board of 95.3 × 34 mm with 22 parts on 49 nets, routed with 231 tracks and 20 vias.

It is built around the ESP32-C6-WROOM-1-N8, SCD40-D-R2 and TLV75533PDBV. Its parts include 6 resistors, 5 connectors, 4 capacitors, 4 ICs and 2 switches. It belongs with the sensors and measurement boards and the ESP32 and RISC-V boards of this library.

Main components

3

README

README.md

Author: Daniel Abdi

Introduction

This repo contains code and design files for building your own Matter-based CO2 air quality monitor. The design is based on an ESP32-C6 and SCD40 CO2 sensor, though you can probably replace the SCD40 with any of its cousins in the SCD4x family. It's capable of measuring CO2 in PPM, relative humidity, and the current temperature. Though I only make use of the CO2 measurement in this code. Modifications to add in that functionality are left as an excercise for the reader 😁. Please note that I'm using ESP-IDF v5.4 and esp-matter at release/v1.4 when compiling. Also note that my code is frankly quite messy and it's doubtful that it adheres to best practices for setting these attributes. Might be worth it to fix later, but this whole project has been more for a fun excercise than anything else.

PCB design, no 3D models for my main components unfortunately

I don't have 3D models of the C6 or the SCD40 so you'll have to use your imagination for those 😆

How to use it

I make use of a custom board that I designed specifically for this project, so if you'd like to follow my example, you would either have to order a set of boards using the included KiCAD design files, or set up your own example using an ESP32-C6 devkit and a SCD4X breakout board. If you choose to go with your own solution, make sure you change the I2C pins set up within the Sensirion driver folder. I'm going to assume you're somewhat familiar with Matter, esp-matter, ESP-IDF, and KiCAD. Regardless, you should just be able to compile, flash, and pair using a Matter controller you have nearby (I use an Aeotec smart hub).

Caution with ESP-Matter

You should also note that depending on which commit of esp-matter you're using, you may run into issues using esp-matter to set the Air Quality value of the Air Quality cluster that is mandatory for the device. Currently, this cluster has a flag of MANAGED_INTERNALLY, which means that you need to use the underlying Attribute Accessor Interface (AAI) to set it. That's why those other air-quality-sensor-manager files are included in the repository. Those files are pulled straight from the example in the CHIP repository. If you find that you see an error message where you can't set the value of that attribute using the esp-matter APIs, uncomment the lines in app_main.cpp that represent AAI, and use those functions instead. You can still use esp-matter to set the CO2 concentration. There is also a patch here that you can try and use as well. This should remove that flag and allow you to use esp-matter. You will also need to enable the Air Quality and Carbon Dioxide Concentration clusters in menuconfig for esp-matter.

Menuconfig

Pairing

To pair, please use the information at the esp-matter docs. You can use the QR code there to pair to any esp-matter device you create. I've also included the pairing code here for your use.

Pairing Code

Here's what it'll look like after pairing:

SmartThings

The Details

The main components of this project are the SCD4X drivers from Sensirion, included in the /drivers directory, and app_main.cpp, which contains all the code that we really care about. The Sensiron drivers are cloned from Here (Github), with some modifications from my side to work with my custom code (basically adding in the I2C implementation and setting the right pins). I've also included some code from the CHIP repository that represents a way to access attributes using the Attribute Accessor Interface (AAI). Read above on when you might need to use this code, otherwise you can feel free to leave it alone.

Clusters

Currently, the device contains 2 clusters of importance to us: The Air Quality cluster, which is mandatory for an Air Quality device, and the CO2 concentration cluster. I've also added the CO2 concentration feature flag, instead of using a level-approach (Like a bad-moderate-good-etc scale) read more in the cluster definitions from the CSA to understand these feature flags and which might work for your use case. Upon commissioning into the Matter fabric, these values are updated every ~5 seconds. SmartThings will be helpful and show you an hourly average of the readings going back 24 hours, so you can see how the CO2 in a space changes over the course of a day or so, even when you aren't looking at the app.

CO2 Graph

If you make a change to the features or clusters on the device, make sure to erase-flash, delete from your Matter app, and re-pair, otherwise they may not show up.

Using Thread

If you have a Thread border router, you can also enable Thread support and use Matter over Thread with the C6. I haven't done that because I'm not sure if my controller supports Thread and frankly in my use case it doesn't matter as it'd be the only Thread device on the network anyways.

If you have any questions about my implementation or need help setting up your own, feel free to open an issue and I will try and help.

Parts

22
QtyValueFootprintReferences
310kResistor_SMD:R_1206_3216MetricR1, R2, R3
310uFCapacitor_SMD:C_1206_3216MetricC1, C2, C3
3PINHD_1x4_MaleConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ2, J3, J4
25.1kResistor_SMD:R_1206_3216MetricR7, R8
2SW_PushButton_Switch_SMD:SW_Tactile_SPST_NO_Straight_CK_PTS636Sx25SMTRLFSSW1, SW2
2TLV75533PDBVPackage_TO_SOT_SMD:SOT-23-5U3, U4
11uFCapacitor_SMD:C_1206_3216MetricC4
1220Resistor_SMD:R_1206_3216MetricR4
1ESP32-C6-WROOM-1Espressif:ESP32-C6-WROOM-1U5
1LEDLED_SMD:LED_0805_2012MetricD1
1PINHD_1x2_MaleConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ5
1SCD40-D-R2SCD40-D-R2:XDCR_SCD40-D-R2U1
1USB_C_Receptacle_USB2.0_16PConnector_USB:USB_C_Receptacle_G-Switch_GT-USB-7010ASVJ1

Similar boards

  • 2 layers60 × 40 mmGas sensor breakout, the printed circuit board in 3D

    Gas sensor breakout

    ginomcfino/gas-sensor-breakout

    PIC16F18344 gas-sensor board with CO2, oxygen, and air-quality sensing, protected power input, programming, and expansion interfaces. Designed in KiCad.

    33 parts
  • 2 layers50 × 50 mmBf-021, the printed circuit board in 3D

    Bf-021

    smoca-ag/m5stack_co2_sensor

    Build your own portable, graphing CO₂ sensor

    12 parts49
  • 4 layers13.6 × 19.4 mmMiniCO2, the printed circuit board in 3D

    MiniCO2

    nup002/miniCO2

    A miniature USB CO2 sensor

    25 parts40
  • 4 layers100 × 75 mmOpenAirScope, the printed circuit board in 3D

    OpenAirScope

    emertcakir/OpenAirScope

    Open-source air quality and environmental monitoring node with STM32H743 + ESP32-C3, LoRaWAN, RS485, USB-C, Li-ion charging, and multi-sensor support.

    282 parts26MIT
  • 2 layers10.3 × 17 mmWatchy scd40, the printed circuit board in 3D

    Watchy scd40

    cscott/watchy-co2-pcb

    Simple PCB to mount the Sensirion SCD40 CO2 sensor next to Watchy

    12 parts13
  • 2 layers42.4 × 94 mmSoWeSta, the printed circuit board in 3D

    SoWeSta

    wir-mo/SoWeSta

    Solar powered Weather Station using an ESP32-C3

    106 parts7
  • 2 layers106 × 58.5 mmCO2 Monitor SMD, the printed circuit board in 3D

    CO2 Monitor SMD

    romkey/pdxhackerspace-portable-co2-monitor

    Open source hardware and software portable CO2/air quality monitor

    28 parts3MIT
  • 4 layers19.8 × 50.9 mmZigbee air quality monitor, the printed circuit board in 3D

    Zigbee air quality monitor

    nobodyguy/zigbee_air_quality_monitor_hardware

    Opensource HA compatible air quality monitor with CO2, temperature and humidity measurements

    35 parts2Apache-2.0

Questions

How big is the GasSensor PCB?

It measures 95.3 × 34 mm and has 2 copper layers, 1.6 mm thick.

What parts does the GasSensor use?

22 parts, built around the ESP32-C6-WROOM-1-N8, SCD40-D-R2 and TLV75533PDBV. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the GasSensor KiCad files?

From the Daniel-Abdi/Matter-CO2-AirQuality-Sensor repository on GitHub, at the commit this page was made from: the board is PCB files/GasSensor.kicad_pcb and its schematic PCB files/GasSensor.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the GasSensor design in my own project?

Its repository states no licence, so its author keeps all rights: ask Daniel-Abdi before reusing the design.