Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Sensors
  4. ›Sensirion STC31 Thermal Conductivity CO2 Sensor

Component guide · Advanced · 3 min read

Sensirion STC31 Thermal Conductivity CO2 Sensor

0 to 100% vol) and DFRobot Gravity STCC4

By Geekobot Learning Team · Updated 29 Oct 2026

I'm using
Wiring, code and the Run it panels follow your board.
On this page
Short answerWhat the Sensirion STC31 and STCC4 CO2 sensors isSensirion STC31 and STCC4 CO2 sensors pinoutWiring the Sensirion STC31 and STCC4 CO2 sensorsExample codeSetup and tuningWhat you needAlternatives and when to choose themCommon mistakesFAQsParts and next steps
Short answer

The Sensirion STC31 measures CO2 by how well a gas mixture conducts heat. It covers 0 to 100 percent volume in nitrogen or air, which suits fermentation, incubators, food packaging and CO2 supply lines rather than room air. It needs temperature, humidity and pressure compensation for accuracy. The DFRobot Gravity STCC4 board uses Sensirion's newer thermal-conductivity CO2 sensor for indoor ranges.

Key specs at a glance

Principle
Thermal conductivity
Range
0 to 25% or 0 to 100% vol (STC31 mode setting)
Interface
I2C, address 0x29 by default (STC31)
Supply
2.7 to 5.5 V (STC31)
Compensation
Feed in RH, temperature and pressure
Size
Tiny DFN package

Models in this guide

These are alternatives. Pick the one that fits your project; you only need one.

  • Option 1Sensirion STC31-C-R3 CO2 Concentration Sensor 0-100% vol – I2C Output₹3,715
  • Option 2Sensirion STC31-R3 Gas Concentration Sensor 0-100% CO2, I2C Output₹6,129
  • Option 3DFRobot Gravity STCC4 True Carbon Dioxide Sensor (3-in-1 Air Quality Monitoring, 400-5000ppm) – Gravity I2C₹1,899
01

What the Sensirion STC31 and STCC4 CO2 sensors is

The Sensirion STC31 and STCC4 are tiny thermal-conductivity CO2 sensors; the STC31 measures high CO2 concentrations in gas mixes, and the STCC4 is a low-cost indoor CO2 sensor.

Thermal conductivity sensing works best on two-gas mixtures (CO2 in nitrogen or CO2 in air). Other gases such as helium or hydrogen upset it.

Sensirion's STC3x Arduino library handles the measurement and compensation commands.

02

Sensirion STC31 and STCC4 CO2 sensors pinout

The pins on the Sensirion STC31 and STCC4 CO2 sensors and what each one does.

PinFunction
VDD, GNDPower
SDA, SCLI2C
ADDRAddress select
PinFunction
VDD, GND
Power
SDA, SCL
I2C
ADDR
Address select
03

Wiring the Sensirion STC31 and STCC4 CO2 sensors

Connect the Sensirion STC31 and STCC4 CO2 sensors like this.

Sensirion STC31 and STCC4 CO2 sensors pinArduino UnoESP32
VDD3.3 V3.3 V
GNDGNDGND
SDAA4 (level shifted)GPIO 21
SCLA5 (level shifted)GPIO 22
VDD
Arduino Uno:
3.3 V
ESP32:
3.3 V
GND
Arduino Uno:
GND
ESP32:
GND
SDA
Arduino Uno:
A4 (level shifted)
ESP32:
GPIO 21
SCL
Arduino Uno:
A5 (level shifted)
ESP32:
GPIO 22
04

Example code

Check the library version for exact function names; send humidity and pressure for best accuracy.

Read the STC31 (Sensirion STC3x library) · Arduino C++Verify & upload in Electrolark
#include <SensirionI2CStc3x.h>

SensirionI2CStc3x stc;

void setup() {
  Serial.begin(115200);
  Wire.begin();
  stc.begin(Wire);
  stc.setBinaryGas(0x0001);   // CO2 in air, 0 to 100% vol
}

void loop() {
  uint16_t gasTicks, tempTicks;
  if (!stc.measureGasConcentration(gasTicks, tempTicks)) {
    float co2 = 100.0 * ((float)gasTicks - 16384.0) / 32768.0;
    Serial.print(co2, 2); Serial.println(" % vol CO2");
  }
  delay(1000);
}
05

Setup and tuning

Wiring

VDD (2.7 to 5.5 V on STC31), GND, SDA and SCL with pull-ups.

Library

use the Sensirion STC3x or STCC4 Arduino library.

Compensation

feed temperature, humidity and pressure for accurate results.

Range

STC31 versions measure up to 25 % or 100 % CO2 in N2 or air.

Placement

keep the sensor in the gas stream but protected from condensation.

06

What you need

Shop this list6 of 6 found in our store · ₹12,291

  • Sensirion STC31-C-R3 CO2 Concentration Sensor 0-100% vol – I2C Output: the part this guide coversSensirion STC31-C-R3 CO2 Concentration Sensor 0-100% vol – I2C Output₹3,715
  • Sensirion STC31-R3 Gas Concentration Sensor 0-100% CO2, I2C Output: another version this guide coversSensirion STC31-R3 Gas Concentration Sensor 0-100% CO2, I2C Output₹6,129
  • DFRobot Gravity STCC4 True Carbon Dioxide Sensor (3-in-1 Air Quality Monitoring, 400-5000ppm) – Gravity I2C: another version this guide coversDFRobot Gravity STCC4 True Carbon Dioxide Sensor (3-in-1 Air Quality Monitoring, 400-5000ppm) – Gravity I2C₹1,899
  • ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389
  • 4-channel logic level converter (BSS138): to connect 5 V and 3.3 V signals safely4-Channel Logic Level Converter (BSS138)₹20
  • 0.96 inch OLED display 128x64: to show readings without a computer0.96" OLED Display 128x64₹139Closest match, check the specs
07

Alternatives and when to choose them

  • ✓SCD4x: room air CO2.
  • ✓MH-Z14A and MH-Z16: NDIR up to 10% vol.
  • ✓CO2 NDIR sensors: overview.
08

Common mistakes to avoid

  • !Skipping compensation.
  • !Using STC31 for indoor ppm.
  • !Condensation on the sensor.
  • !Missing pull-ups.
09

Frequently asked questions

What is the STC31 used for?

Measuring high CO2 levels in gas mixtures, such as fermentation and breath analysis.

Can the STC31 measure room CO2?

It is better for high concentrations; use the STCC4 or SCD4x for rooms.

Why are readings off?

Temperature, humidity or pressure compensation has not been set.

Is it an NDIR sensor?

No. It measures CO2 by thermal conductivity, not infrared.

Which library should I use?

Use Sensirion's official STC3x or STCC4 Arduino library.

Parts for this guide

  • Sensirion STC31-C-R3 CO2 Concentration Sensor 0-100% vol – I2C Output
    ₹3,715View
  • Sensirion STC31-R3 Gas Concentration Sensor 0-100% CO2, I2C Output
    ₹6,129View
  • DFRobot Gravity STCC4 True Carbon Dioxide Sensor (3-in-1 Air Quality Monitoring, 400-5000ppm) – Gravity I2C
    ₹1,899View
  • ESP32-WROOM-32 38-Pin Development Board
    ₹389View
  • 4-Channel Logic Level Converter (BSS138)
    ₹20View
  • 0.96" OLED Display 128x64
    ₹139View
Shop Gas, Air Quality & CO2 Sensors

Keep learning

Component guideIntermediateSCD40 and SCD41 CO2 SensorsThe SCD40 and SCD41 from Sensirion are small CO2 sensors that measure real carbon dioxide with photoacoustic NDIR, plus temperature and humidity.3 min read · SensorsComparisonIntermediateCO2 SensorsCO2 sensors tell you when a room needs fresh air: outdoors is about 420 ppm, under 1000 ppm indoors is good and above 1500 ppm calls for ventilation.3 min read · SensorsComponent guideIntermediateWinsen MH-Z14A, MH-Z16 and MH-410D NDIR CO2 SensorsThe MH-Z14A and MH-Z16 are Winsen NDIR CO2 sensors that use the same UART commands as the MH-Z19.3 min read · SensorsConcept explainerIntermediateI2C ExplainedI2C is a two-wire bus that lets one microcontroller talk to many sensors and displays using a data line (SDA) and a clock line (SCL).4 min read · Electronics Fundamentals

Sources

  • Sensirion STC31 datasheet

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerWhat the Sensirion STC31 and STCC4 CO2 sensors isSensirion STC31 and STCC4 CO2 sensors pinoutWiring the Sensirion STC31 and STCC4 CO2 sensorsExample codeSetup and tuningWhat you needAlternatives and when to choose themCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide (Arduino Uno)4 items · ₹5,838

Sensirion STC31-C-R3 CO2 Concentration Sensor 0-100% vol – I2C Output · DFRobot Gravity STCC4 True Carbon Dioxide Sensor (3-in-1 Air Quality Monitoring, 400-5000ppm) – Gravity I2C · 4-Channel Logic Level Converter (BSS138) · Uno R3 CH340G ATmega328p Compatible Development Board

Run itChange the inputs and watch the output

Binary gas mode 0x0001: CO2 in nitrogen, 0 to 100 % volume. Not for room-air ppm.

Serial monitor115200 baud
4.18 % vol CO2

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question