SCD40 CO2, temperature and humidity sensor
Sensirion SCD40 / SCD41 module pinout, I2C address 0x62, 3.3 V vs 5 V, the 5-second measurement cycle, current peaks and automatic self-calibration.
Community draft — report a mistake
3.3 V or 5 V? The SCD40 runs from 2.4–5.5 V and its I2C pins work at the supply level, so power it from 3.3 V on ESP32/Pico and 5 V on Uno. Breakouts pull SDA/SCL up to their supply — don’t power it from 5 V when your board is 3.3 V.
Unlike cheap “eCO2” chips, the SCD40 actually measures CO2 with a tiny photoacoustic NDIR cell: it shines infrared light through the air and detects the CO2 molecules absorbing it. The SCD40 is specified for 400–2000 ppm (±50 ppm + 5 %); the SCD41 extends that to 5000 ppm and adds a low-power single-shot mode. Both also report temperature and humidity.
CO2 is the best simple measure of ventilation — classrooms, bedrooms and offices above about 1000 ppm feel stuffy and make people drowsy. In periodic mode a new value arrives every 5 seconds.
Calibration: automatic self-calibration (on by default) treats the lowest value of the past week as fresh air. That works in homes with open windows; for sealed rooms take the sensor outside for a few minutes and call performForcedRecalibration(420). Pass your altitude with setSensorAltitude() for best accuracy.
Prices are indicative (Nov 2026) and vary by seller.
Pinout
| Pin | What it does |
|---|---|
VCC | Supply, 2.4–5.5 V (VDD or VIN on some boards). About 15 mA average, with short peaks near 200 mA during each measurement |
GND | Ground |
SCL | I2C clock |
SDA | I2C data |
I2C address:0x62
Library
Sensirion I2C SCD4x by Sensirion
Arduino IDE → Library Manager → search the name above. Each guide lists the exact version we compile against.
Use it with
Common errors
Every read returns an error or “data not ready”
Call startPeriodicMeasurement() once in setup(), then read no faster than every 5 seconds and check getDataReadyStatus() first. The first value takes 5 seconds to appear.
CO2 reads 1000+ ppm and slowly creeps down over days
Automatic self-calibration assumes the sensor sees fresh outdoor air (about 420 ppm) at least once a week. In a room that never airs out, turn ASC off and do a forced recalibration outdoors instead.
Resets or I2C errors on a long cable or weak supply
Each measurement pulls a current spike. Add a 10–100 µF capacitor across the module’s VCC and GND and keep the I2C cable short (under 50 cm).