SGP30 CO₂ and Volatile Organic Compound Sensor

Overview

 
NameSGP30
ManufacturerSensirion
Adafruit boardAdafruit SGP30 Air Quality Sensor Breakout
DatasheetSensirion_Gas_Sensors_Datasheet_SGP30.pdf
Infosheet (Adafruit)adafruit-sgp30-gas-tvoc-eco2-mox-sensor.pdf
ESPHome componentsgp30
InterfaceI²C
I²C address0x58
Supply voltageSensor:

Detects and reports (Total) Volatile Organic Compounds and -equivalent levels (calculated from measuring Ethanol and ).

Working principle

The sensing part (MEMS) of the SGP30 is based on a heated film of metal oxide (MOx) nanoparticles. The gas-sensitive material reacts the oxygen adsorbed on the metal oxide particles with the target gas, thus releasing electrons. This results in a change in the resistance of the metal oxide layer measured by the sensor.

In short, the presence of the reducing gas causes the oxygen concentration on the surface of the gas-sensitive material to decrease, changing the resistance (or conductivity) of the semiconductor. The subsequent detection of the resistance, signal processing and conversion are performed by the circuit (ASIC) section.

Headers

The sensor headers are detailed in the datasheet1, and are as follows:

SGP30 headers

HeaderNameDescription
1Supply voltage
2Ground
3SDAI²C SDA data
4Connected to ground
5Supply voltage (hotplate)
6SCLI²C SCL clock

The datasheet also provides a schematic of the sensor.

Breakout boards

The sensor chip itself is tiny, and different breakout boards are available.

All of the breakout boards listed here have an onboard voltage regulator, and cand handle both and supply voltages on VIN.

Adafruit SGP30 STEMMA QT/Qwiic

The breakout board has pins for all headers on the sensor. Then VIN pin is connected to a voltage regulator that converts to for the sensor and used on the breakout board2.

PinDescription
VINPower pin, (connected to voltage regulator).
1V8Connects to on SGP30 sensor. Can supply up to .
GNDGround / .
SCLI²C SCL clock.
SDAI²C SDA data.

Grove SGP30

This breakout board is larger than the Adafruit board, and also features a voltage regulator on the VIN pin3.

Grove SGP30 breakout board

Grove SGP30 breakout board

PinDescription
VINPower pin, (connected to voltage regulator).
GNDGround / .
SCLI²C SCL clock.
SDAI²C SDA data.

GY-SGP30

This breakout board has a very small form factor. There is not much info on it online, and it's mostly found on Amazon and various eBay stores. It also has an on-board voltage regulator on VIN that converts to the onboard 4.

PinDescription
VINPower pin, (connected to voltage regulator).
GNDGround / .
SCLI²C SCL clock.
SDAI²C SDA data.

ESPHome

Set up an an I²C bus:

i2c:
  - id: i2c_sgp30
    sda: ${gpio_sda}
    scl: ${gpio_scl}

And use the sgp30 component5:

sensor:
  - platform: sgp30
    i2c_id: i2c_sgp30
    address: 0x58
    eco2:
      id: co2eq
      name: "CO₂eq"
      accuracy_decimals: 1
      icon: "mdi:molecule-co2"
      device_class: carbon_dioxide
    tvoc:
      id: tvoc
      name: "TVOC"
      accuracy_decimals: 1
      icon: "mdi:air-filter"
      device_class: volatile_organic_compounds_parts
    eco2_baseline:
      id: baseline_value_ce2eq
      name: "Baseline CO₂eq"
      entity_category: ""
    tvoc_baseline:
      id: baseline_value_tvoc
      name: "Baseline TVOC"
      entity_category: ""
    update_interval: 1s

The tvoc sensor of the sgp30 component outputs values in PPB, use a copy6 sensor to get an entity values in PPM:

sensor:
  - platform: copy
    source_id: tvoc
    id: tvoc_ppm
    name: "Total volatile organic compounds"
    icon: "mdi:air-filter"
    unit_of_measurement: "ppm"
    accuracy_decimals: 3
    state_class: measurement
    device_class: volatile_organic_compounds_parts
    filters:
      - lambda: !lambda |-
          return x/1000;

The sensor needs an update_interval of 1s to work reliably (because it operates on 1 MHz cycles) so by default it's quite noisy and reports a lot of values, so you might want to use some filters on the sensors7.

References