All wiring guides

Free wiring guides

Wire the SGP30 air quality sensor to the ESP32-C3

Air quality sensor, SGP30, I2C. Estimates CO₂ and fumes in the air of a room.

Which pin goes where

On the partOn the ESP32-C3
VCC3V3
GNDGND
SCLGPIO 7
SDAGPIO 6

Wire it with the USB cable unplugged. Follow the names printed on your own part: makers sometimes reorder the pins.

In 3D

Example sketch

// Air quality sensor, SGP30, I2C
// on the ESP32-C3 Super Mini
// https://stem.manusignal.com/en/parts/sgp30-esp32-c3
#include <Wire.h>
#include <Adafruit_SGP30.h>

const int PIN_SDA = 6;
const int PIN_SCL = 7;

Adafruit_SGP30 sgp;

void setup() {
  Serial.begin(115200);
  Wire.begin(PIN_SDA, PIN_SCL);
  if (!sgp.begin(&Wire)) Serial.println("SGP30 not found");
}

void loop() {
  if (sgp.IAQmeasure()) {
    Serial.print(sgp.eCO2);
    Serial.print(" ppm CO2 (estimate)  ");
    Serial.print(sgp.TVOC);
    Serial.println(" ppb");
  }
  delay(1000);
}
  • Tools > Board > ESP32C3 Dev Module (USB CDC On Boot: Enabled), then Tools > Port and choose the board's port.
  • Adafruit SGP30 Sensor: install it from Sketch > Include Library > Manage Libraries.

This sketch is compiled for the board before the page is published. It has not been run on real hardware by us.

What you should see

Open the Serial Monitor at 115200. It prints 400 ppm for the first 15 seconds, then a reading that climbs when you breathe near it.

If it does not work

CO₂ reads exactly 400 for a long time.
Normal for the first 15 seconds, and slow to settle on the first day. Leave it running.

The same part on the ESP32-S3

More parts on the ESP32-C3