

The SGP30 is a digital gas sensor designed to measure indoor air quality by detecting a range of volatile organic compounds (VOCs) and equivalent CO2 (eCO2) levels. It is based on Sensirion's CMOSens® technology, which ensures high accuracy and long-term stability. The sensor outputs air quality data digitally via an I2C interface, making it easy to integrate into various systems.








The SGP30 sensor is compact and highly efficient, with the following key specifications:
| Parameter | Value |
|---|---|
| Supply Voltage | 1.8V to 3.6V |
| Typical Operating Voltage | 3.3V |
| Current Consumption | 48 mA (average during measurement) |
| Communication Interface | I2C |
| I2C Address | 0x58 |
| Measurement Range (eCO2) | 400 ppm to 60,000 ppm |
| Measurement Range (TVOC) | 0 ppb to 60,000 ppb |
| Operating Temperature Range | -40°C to +85°C |
| Humidity Compensation | Supported (requires external RH sensor) |
The SGP30 sensor typically comes in a 4-pin package. Below is the pinout description:
| Pin | Name | Description |
|---|---|---|
| 1 | VDD | Power supply (1.8V to 3.6V) |
| 2 | GND | Ground |
| 3 | SDA | I2C data line |
| 4 | SCL | I2C clock line |
Below is an example of how to interface the SGP30 with an Arduino UNO using the Adafruit SGP30 library:
#include <Wire.h>
#include "Adafruit_SGP30.h"
// Create an SGP30 object
Adafruit_SGP30 sgp;
// Setup function runs once when the program starts
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
while (!Serial) {
delay(10); // Wait for the serial monitor to open
}
Serial.println("SGP30 Air Quality Sensor Test");
// Initialize the SGP30 sensor
if (!sgp.begin()) {
Serial.println("Sensor not found. Check wiring!");
while (1); // Halt execution if sensor initialization fails
}
Serial.println("SGP30 initialized successfully!");
// Print sensor serial number
Serial.print("Sensor Serial Number: ");
Serial.print(sgp.serialnumber[0], HEX);
Serial.print(sgp.serialnumber[1], HEX);
Serial.println(sgp.serialnumber[2], HEX);
}
// Loop function runs repeatedly after setup
void loop() {
// Measure air quality
if (!sgp.IAQmeasure()) {
Serial.println("Measurement failed!");
return;
}
// Print eCO2 and TVOC values
Serial.print("eCO2: ");
Serial.print(sgp.eCO2);
Serial.print(" ppm, TVOC: ");
Serial.print(sgp.TVOC);
Serial.println(" ppb");
delay(1000); // Wait 1 second before the next measurement
}
Sensor Not Detected
Inaccurate Readings
Measurement Fails
Q: Can the SGP30 measure CO2 directly?
A: No, the SGP30 estimates equivalent CO2 (eCO2) levels based on VOC measurements. For direct CO2 measurement, a dedicated CO2 sensor is required.
Q: How often should I read data from the sensor?
A: The recommended measurement interval is 1 second for optimal performance.
Q: Can I use the SGP30 outdoors?
A: The SGP30 is designed for indoor air quality monitoring. Outdoor use may expose it to extreme conditions and contaminants, reducing its accuracy and lifespan.