Component guide · Intermediate · 3 min read
SGP30 VOC and eCO2 Sensor

Pinout, Wiring and Code
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
The SGP30 from Sensirion is a metal-oxide gas sensor that reports TVOC (ppb) and an estimated CO2 equivalent (eCO2, ppm) over I2C at address 0x58. Read it once a second so its baseline algorithm works, and save the baseline for a quick restart. Use it in indoor air quality monitors alongside a humidity sensor for compensation.
Key specs at a glance
- Outputs
- TVOC 0 to 60,000 ppb, eCO2 400 to 60,000 ppm
- Method
- Multi-pixel metal-oxide sensor with on-chip processing
- Interface
- I2C, address 0x58
- Supply
- Chip 1.8 V; modules regulate from 3.3 or 5 V
- Measurement
- Once per second for the dynamic baseline
- Warm-up
- 15 s initialisation; 12 hours for the first baseline
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
Option 1Adafruit SGP30 Air Quality Sensor Module VOC/eCO2 – STEMMA QT/Qwiic I2C₹3,099
Option 2Pimoroni SGP30 VOC & eCO2 Air Quality Sensor Breakout – I2C Interface₹1,983
Option 3Seeed Studio Grove SGP30 VOC & eCO2 Gas Sensor Module – I2C Interface₹1,919
Option 4Mikroe Air Quality 4 Click (Mikroe-2896) – SGP30 Air Quality Sensor Board, I²C, mikroBUS₹3,219
Option 5Sensirion SGP30 TVOC & CO2eq Gas Sensor Module – White Shell w/ Built-in Cotton Core & Card Holder, 1m Cable₹1,469
Option 6Sensirion SGP30 Digital Gas Sensor Probe – 1m Stainless Steel Wire, I2C Interface₹1,409
What the SGP30 is
The Sensirion SGP30 is a metal-oxide gas sensor that reports TVOC and an estimated eCO2 over I2C for indoor air quality monitors.
The SGP30 has four sensing elements on one chip and calculates TVOC and eCO2 itself. Like other VOC sensors, eCO2 is estimated, not measured.
Its baseline algorithm learns what clean air looks like; that only works if you call the measure command once per second. Saving the baseline values and writing them back after a restart avoids waiting 12 hours again.
SGP30 pinout
The pins on the SGP30 and what each one does.
| Pin | Function |
|---|---|
| VIN / VCC | Supply, 3.3 or 5 V on modules with a regulator |
| GND | Ground |
| SDA | I2C data |
| SCL | I2C clock |
| 1V8 | 1.8 V output from the regulator (Adafruit board) |
- VIN / VCC
- Supply, 3.3 or 5 V on modules with a regulator
- GND
- Ground
- SDA
- I2C data
- SCL
- I2C clock
- 1V8
- 1.8 V output from the regulator (Adafruit board)
Wiring the SGP30
Adafruit, Pimoroni and Seeed boards include the 1.8 V regulator and level shifting, so they connect to 3.3 or 5 V boards directly.
| SGP30 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 "Adafruit SGP30 Sensor". The first 15 seconds return 400 ppm eCO2 and 0 ppb TVOC while it initialises.
#include "Adafruit_SGP30.h"
Adafruit_SGP30 sgp;
void setup() {
Serial.begin(115200);
if (!sgp.begin()) { Serial.println("No SGP30 found"); while (1); }
}
void loop() {
if (sgp.IAQmeasure()) {
Serial.print("TVOC "); Serial.print(sgp.TVOC);
Serial.print(" ppb eCO2 "); Serial.print(sgp.eCO2); Serial.println(" ppm");
}
delay(1000); // keep the 1 s rhythm for the baseline algorithm
}Setup and tuning
VCC 3.3 V (breakouts accept 5 V), GND, SDA and SCL.
use the Adafruit SGP30 library.
read once per second for the baseline algorithm to work.
save the baseline after 12 hours and restore it on start-up.
feed absolute humidity from another sensor for better accuracy.
What you need
Shop this list9 of 10 found in our store · ₹13,675
Adafruit SGP30 air quality sensor: the sensor this guide coversAdafruit SGP30 Air Quality Sensor Module VOC/eCO2 – STEMMA QT/Qwiic I2C₹3,099Closest match, check the specs
Pimoroni SGP30 VOC & eCO2 Air Quality Sensor Breakout – I2C Interface: another version this guide coversPimoroni SGP30 VOC & eCO2 Air Quality Sensor Breakout – I2C Interface₹1,983
Seeed Studio Studio Grove SGP30 VOC & eCO2 Gas Sensor Module – I2C Interface: another version this guide coversSeeed Studio Grove SGP30 VOC & eCO2 Gas Sensor Module – I2C Interface₹1,919Closest match, check the specs
Mikroe Air Quality 4 Click (Mikroe-2896) – SGP30 Air Quality Sensor Board, I²C, mikroBUS: another version this guide coversMikroe Air Quality 4 Click (Mikroe-2896) – SGP30 Air Quality Sensor Board, I²C, mikroBUS₹3,219
Sensirion SGP30 TVOC & CO2eq Gas Sensor Module – White Shell w/ Built-in Cotton Core & Card Holder, 1m Cable: another version this guide coversSensirion SGP30 TVOC & CO2eq Gas Sensor Module – White Shell w/ Built-in Cotton Core & Card Holder, 1m Cable₹1,469
Sensirion SGP30 Digital Gas Sensor Probe – 1m Stainless Steel Wire, I2C Interface: another version this guide coversSensirion SGP30 Digital Gas Sensor Probe – 1m Stainless Steel Wire, I2C Interface₹1,409
ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389- Uno R3 development board: the controller used in the wiring tableFind this part
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
- ENS160: gives an air quality index directly.
- CCS811: similar outputs, discontinued.
- SCD40 and SCD41: real CO2.
Try it: I2c pullup calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Treating eCO2 as real CO2.
- Reading slower than once per second.
- Not saving the baseline.
- Ignoring humidity compensation.
Frequently asked questions
Is eCO2 from the SGP30 real CO2?
No. It is estimated from VOCs; use an NDIR sensor for real CO2.
Why does eCO2 read 400 for the first 15 seconds?
The sensor is initialising and reports fixed values until it is ready.
Why do I need to save the baseline?
Restoring it avoids a 12-hour relearning period after power cycles.
Can I read it every 10 seconds?
No. The baseline algorithm needs a reading every second to work properly.
Is the SGP30 still recommended?
It works, but the newer SGP40/41 give better VOC indexes.
Parts for this guide
Calculators
Terms in this guide
Projects that use it
Put this into practice: 10 step-by-step builds in our project library use parts from 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.

