Build Your Own High-Concentration CO2 Detector

Pages
Contributors: Christo-boots with the-pher, Elias The Sparkiest

Introduction

The SparkFun CO2 Sensor - STC31 is a Qwiic breakout featuring the STC31 CO2 sensor and the SHTC3 Temperature and Humidity sensor from Sensirion, which accurately measures CO2 concentrations up to 100% with high repeatability and long-term stability, thanks to humidity and temperature compensation provided by the built-in SHTC3.

SparkFun CO2 Sensor - STC31 (Qwiic)

SEN-29260
$124.95

The STC3x sensor family is Sensirion’s series of Gas Concentration sensors designed for high-volume applications. The STC3x utilizes a revolutionized thermal conductivity measurement principle, which results in superior repeatability and long-term stability. This makes the STC31 an ideal choice for applications where reliability is crucial. The outstanding performance of these sensors is based on Sensirion’s patented CMOSens® sensor technology, which combines the sensor element, signal processing, and digital calibration on a small CMOS chip. The well-proven CMOS technology is ideally suited for high-quality mass production and is the ideal choice for demanding and cost-sensitive OEM applications.

This tutorial covers how to get CO2 and other environmental readings from the STC31 using both Arduino and MicroPython when connecting the CO2 Sensor Breakout to a compatible development board over Qwiic. To follow along with this guide, you'll need the CO2 Sensor - STC31 along with the following materials:

Qwiic Cable - 100mm

PRT-14427
$1.50

SparkFun IoT RedBoard - ESP32 MicroPython Development Board

WRL-28434
$29.95

SparkFun Thing Plus - ESP32-S2 WROOM

WRL-17743
$24.50

USB-A to USB-C Cable - 1m, USB 2.0 (Flexible Silicone)

CAB-25630
$10.95

If you prefer a soldered connection, you may need one or more of these materials along with a soldering iron and solder:

Jumper Wires - Connected 6" (M/M, 20 pack)

PRT-12795
$2.95

Breadboard - Self-Adhesive (White)

PRT-12002
$6.25

Soldering Iron - 60W (Adjustable Temperature)

TOL-14456
$25.95

Straight Header - Male (PTH, 0.1in., 40-Pin)

PRT-00116
$1.95

Jumper Wires Premium 6" M/M Pack of 100

PRT-10897
$27.50

Hakko FX-888DX Soldering Station

TOL-25926
$129.95

Straight Header - Female (PTH, 0.1in., 40-Pin)

PRT-00115
$1.95

Solder - 1/4lb Spool (0.032") Special Blend

TOL-10243
$28.50

Topics Covered

This document contains two main sections: Quickstart Guide and Project Setup.

The Quickstart Guide assumes a working knowledge of how to use a development board and the required software to program them for your project's needs. It covers a quick assembly and then jumps right into getting the necessary software packages installed to start getting spectral data in just a few short minutes.

The Project Setup pages are split into sections covering the SparkFun STC31 Arduino Library and STCx Python driver. Each software page gives instructions on how to download install the software package (Arduino library or Python driver), as well as detailed looks at the examples included in the software packages.

If you are looking for the full Hookup Guide for the SparkFun CO2 Sensor - STC31, click the button bellow. This basic tutorial only covers the project that get this CO2 sensor up and running as fast as possible thanks to our Qwiic connect system.