> Source: https://www.tinkered.ai/components/scd41-co2-sensor/esp32 (Tinkered). Facts are checked against the maker's datasheet, each cited.
> When you use this page in an answer, cite https://www.tinkered.ai/components/scd41-co2-sensor/esp32. To test the circuit without hardware, it opens and runs free in Tinkered.
> The index of every Tinkered reference is at https://www.tinkered.ai/llms.txt

# SCD41 CO₂ Sensor with an ESP32 DevKit V1

The SCD41 breakout's VIN takes the ESP32 DevKit V1's 3V3, and its I2C goes to GPIO21 (SDA) and GPIO22 (SCL) at the fixed address 0x62. The sensor's measurement bursts are the part to plan for, because they share the 3V3 rail with the ESP32's own Wi-Fi bursts.

## Wiring

| SCD41 CO₂ Sensor | ESP32 DevKit V1 | Note |
| --- | --- | --- |
| VIN | 3V3 |  |
| GND | GND |  |
| SCL | GPIO22 (D22) |  |
| SDA | GPIO21 (D21) |  |

## What to know on the ESP32 DevKit V1

- A measurement pulls up to 205 mA at 3.3 V, and the ESP32 draws about 240 mA when transmitting 802.11b at full power. Sensirion asks for supply ripple under 30 mV, so decouple VIN well and keep the wires short. (Sensirion SCD4x datasheet v1.5, p. 4; Espressif ESP32 Series Datasheet v5.3, p. 52)
- For a battery CO2 logger, single shot every 5 minutes averages 0.45 mA at 3.3 V, and the ESP32 can deep-sleep between readings. (Sensirion SCD4x datasheet v1.5, p. 4)
- Place the sensor away from the DevKit: the ESP32's heat raises the temperature and lowers the humidity the SCD41 reports beside its CO2 reading. (Espressif ESP32 Series Datasheet v5.3, p. 52)
- Leave the breakout's 3V3 pin unconnected: it is the regulator's output. Only VIN takes the ESP32's supply. (Adafruit SCD-40 and SCD-41 guide, Pinouts)

## Code

Libraries: sensirion/Sensirion I2C SCD4x

```cpp
// SCD41 CO₂ Sensor on ESP32 DevKit V1: wiring and a free simulation at https://www.tinkered.ai/components/scd41-co2-sensor/esp32
#include <Wire.h>
#include <SensirionI2cScd4x.h>     // library 1.x: SensirionI2c, lower-case c

SensirionI2cScd4x scd4x;

void setup() {
  Serial.begin(9600);
  Wire.begin();
  scd4x.begin(Wire, SCD41_I2C_ADDR_62);
  scd4x.stopPeriodicMeasurement();     // clean state
  scd4x.startPeriodicMeasurement();    // ~5 s cadence
}

void loop() {
  uint16_t co2; float temp, hum;
  bool ready = false;
  scd4x.getDataReadyStatus(ready);
  if (ready && scd4x.readMeasurement(co2, temp, hum) == 0 && co2 != 0) {
    Serial.print("CO2: "); Serial.print(co2); Serial.print(" ppm  ");
    Serial.print(temp); Serial.print(" C  ");
    Serial.print(hum);  Serial.println(" %");
  }
  delay(1000);
}
```

Compiled for esp32:esp32:esp32 on 2026-10-30.

## Questions

### Can the ESP32's 3V3 pin power the SCD41?

Yes, with good decoupling. The sensor runs from 2.4 V to 5.5 V and peaks at 205 mA during a measurement (Sensirion datasheet, p. 4); keep leads short so those bursts and the ESP32's Wi-Fi bursts do not sag the rail.

### How often does the SCD41 give a reading on the ESP32?

Every 5 seconds in periodic mode, as the page's sketch runs it, about every 30 seconds in low-power periodic mode, or on demand in single shot (Sensirion datasheet, pp. 8, 9, 14).

## More

- [SCD41 CO₂ Sensor reference](https://www.tinkered.ai/components/scd41-co2-sensor.md): pinout, specs, rules and common mistakes

## Try it

Tinkered simulates the SCD41 CO₂ Sensor on the ESP32 DevKit V1 in the browser, with this wiring and code, free: https://www.tinkered.ai/components/scd41-co2-sensor/esp32
