Component guide · Intermediate · 3 min read
SCD40 and SCD41 CO2 Sensors

Pinout, Wiring and Code
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
The SCD40 and SCD41 from Sensirion are small CO2 sensors that measure real carbon dioxide with photoacoustic NDIR, plus temperature and humidity. They talk I2C at address 0x62 and run from 2.4 to 5.5 V. The SCD40 covers 400 to 2,000 ppm; the SCD41 covers 400 to 5,000 ppm and adds a low-power single-shot mode for battery monitors.
Key specs at a glance
- Measures
- CO2, temperature, relative humidity
- CO2 range
- SCD40: 400 to 2,000 ppm; SCD41: 400 to 5,000 ppm
- Accuracy
- SCD40 ±(50 ppm + 5 %); SCD41 ±(40 ppm + 5 %)
- Interface
- I2C, address 0x62
- Supply
- 2.4 to 5.5 V
- Measurement interval
- 5 s periodic; SCD41 also single shot
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
Option 1Sensirion SCD41 CO2, Temperature & Humidity Sensor Module – I2C Interface, Blue PCB₹2,459
Option 2Sensirion SCD40 Gas Sensor Module Purple – CO2, Temperature, Humidity, I2C Interface₹1,919
Option 3DFRobot Gravity SCD41 Infrared CO2 Sensor Module (400–5000 ppm) – I2C Interface₹6,539
Option 4Sensirion SCD40-D-R1 CO₂ Gas Detection Sensor, I²C Output, Integrated Temp & Humidity, 2.4~5.5 VDC, SCD4x Series₹2,029
Option 5Sensirion SCD40-D-R2 CO₂ Gas Sensor, Range: 400 ppm~2000 ppm, I2C Interface₹1,539
Option 6Sensirion SCD41-D-R2 CO₂ Gas Sensor, Range: 400 ppm~5000 ppm, I2C Interface, LGA-20 Package₹1,949
What the SCD40 / SCD41 is
These sensors use photoacoustics: an infrared source pulses inside a tiny chamber, CO2 absorbs the light and warms slightly, and a microphone hears the resulting pressure waves. This lets the sensor be far smaller than a classic NDIR chamber.
They also report temperature and humidity and use them to compensate the CO2 reading. Bare SCD40-D and SCD41-D parts are surface-mount components; the modules add pull-ups and a connector.
SCD40 / SCD41 pinout
The pins on the SCD40 / SCD41 and what each one does.
| Pin | Function |
|---|---|
| VDD / VIN | Supply, 2.4 to 5.5 V |
| GND | Ground |
| SDA | I2C data |
| SCL | I2C clock |
- VDD / VIN
- Supply, 2.4 to 5.5 V
- GND
- Ground
- SDA
- I2C data
- SCL
- I2C clock
Wiring the SCD40 / SCD41
The SCD4x accepts 3.3 or 5 V on modules. Keep the sensor out of direct sunlight and airflow; the module's own heat can raise the temperature reading slightly.
| SCD40 / SCD41 pin | Arduino Uno | ESP32 |
|---|---|---|
| VCC | 5V (or 3.3V) | 3V3 |
| GND | GND | GND |
| SDA | A4 | GPIO 21 |
| SCL | A5 | GPIO 22 |
- VCC
- Arduino Uno:
- 5V (or 3.3V)
- ESP32:
- 3V3
- GND
- Arduino Uno:
- GND
- ESP32:
- GND
- SDA
- Arduino Uno:
- A4
- ESP32:
- GPIO 21
- SCL
- Arduino Uno:
- A5
- ESP32:
- GPIO 22
Example code
Install "SparkFun SCD4x Arduino Library" from the Library Manager. begin() starts periodic measurement automatically.
#include <Wire.h>
#include "SparkFun_SCD4x_Arduino_Library.h"
SCD4x scd;
void setup() {
Serial.begin(115200);
Wire.begin();
if (!scd.begin()) { Serial.println("No SCD4x at 0x62"); while (1); }
}
void loop() {
if (scd.readMeasurement()) { // true when a new reading is ready (every 5 s)
Serial.print(scd.getCO2()); Serial.print(" ppm ");
Serial.print(scd.getTemperature(), 1); Serial.print(" C ");
Serial.print(scd.getHumidity(), 1); Serial.println(" %RH");
}
delay(500);
}Setup and tuning
is on by default and expects fresh air (about 400 ppm) at least weekly. In sealed rooms, turn it off and use forced recalibration outdoors.
set the sensor altitude or ambient pressure for better accuracy.
set an offset if the enclosure warms the sensor.
use the SCD41 in single-shot mode every few minutes.
What you need
Shop this list9 of 9 found in our store · ₹16,631
Sensirion SCD41 CO2, temperature and humidity module: the sensor this guide coversSensirion SCD41 CO2, Temperature & Humidity Sensor Module – I2C Interface, Blue PCB₹2,459Closest match, check the specs
Sensirion SCD40 module: the lower-range versionSensirion SCD40-D-R2 CO₂ Gas Sensor, Range: 400 ppm~2000 ppm, I2C Interface₹1,539Closest match, check the specs
DFRobot Gravity SCD41 Infrared CO2 Sensor Module (400–5000 ppm) – I2C Interface: another version this guide coversDFRobot Gravity SCD41 Infrared CO2 Sensor Module (400–5000 ppm) – I2C Interface₹6,539
Sensirion SCD40-D-R1 CO₂ Gas Detection Sensor, I²C Output, Integrated Temp & Humidity, 2.4~5.5 VDC, SCD4x Series: another version this guide coversSensirion SCD40-D-R1 CO₂ Gas Detection Sensor, I²C Output, Integrated Temp & Humidity, 2.4~5.5 VDC, SCD4x Series₹2,029
Sensirion SCD40-D-R2 CO₂ Gas Sensor, Range: 400 ppm~2000 ppm, I2C Interface: another version this guide coversSensirion SCD40-D-R2 CO₂ Gas Sensor, Range: 400 ppm~2000 ppm, I2C Interface₹1,539
Sensirion SCD41-D-R2 CO₂ Gas Sensor, Range: 400 ppm~5000 ppm, I2C Interface, LGA-20 Package: another version this guide coversSensirion SCD41-D-R2 CO₂ Gas Sensor, Range: 400 ppm~5000 ppm, I2C Interface, LGA-20 Package₹1,949
ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389
0.96 inch OLED display 128x64: to show readings without a computer0.96" OLED Display 128x64₹139Closest match, check the specs
Dupont jumper wires: for the connectionsDupont Jumper Wires (40 pcs)₹49Closest match, check the specs
Alternatives and when to choose them
- MH-Z19: larger NDIR sensor on UART.
- CO2 sensors compared.
- ENS160: VOC-based estimate, not real CO2.
Try it: I2c pullup calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Leaving self-calibration on in a room that never gets fresh air.
- Expecting the SCD40 to read above 2,000 ppm accurately.
- Mounting it in a closed box with no air exchange.
- Polling faster than the 5 s measurement interval.
Frequently asked questions
What is the SCD40's I2C address?
0x62, fixed (same for the SCD41).
SCD40 or SCD41?
The SCD41 has a wider range (to 5,000 ppm), better accuracy and a low-power single-shot mode.
Is it a real CO2 sensor?
Yes, it measures CO2 with photoacoustic NDIR.
Does it work at 5 V?
Yes, the supply range is 2.4 to 5.5 V.
How often does it measure?
Every 5 seconds in periodic mode.
Parts for this guide
Calculators
Terms in this guide
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.
