SGP40 VOC Sensor

The Sensirion SGP40 is an I2C metal-oxide gas sensor that reports a VOC Index (0-500) for total volatile organic compounds in indoor air.

SGP40 VOC Sensor: Volatile organic compounds

What is the SGP40 VOC Sensor?

The SGP40 is Sensirion's digital metal-oxide (MOx) gas sensor for indoor air quality applications. A temperature-controlled micro-hotplate exposes a tin-oxide sensing layer to the air, and its electrical resistance shifts in the presence of volatile organic compounds. The chip returns a 16-bit raw signal (SRAW) that is proportional to the logarithm of that resistance and is broadly sensitive to the mix of VOC gases typically found indoors.

Rather than reporting a concentration in ppm, the SGP40 is paired with Sensirion's VOC Gas Index Algorithm, which converts the raw signal into a relative VOC Index. On that scale 100 represents the typical recent average for the room, higher values indicate worsening air, and the range spans roughly 0 to 500. This makes the part well suited to triggering ventilation or air purification rather than measuring an absolute gas level. Its response time (tau 63%) is under 10 seconds and its limit of detection is below 0.05 ppm ethanol equivalent.

This Adafruit breakout carries the SGP40 on a board with an onboard 3.3V regulator and STEMMA QT / Qwiic connectors, so it runs from a 3-5V supply and talks over I2C at the fixed address 0x59. The bare SGP40 chip operates from 1.7-3.6V and draws around 2.6 mA average while measuring.

SGP40 VOC Sensor pinout

PinFunctionType
VIN VIN (3-5V)PowerPower in
3V3 3V3 (out)PowerPower out
GND GNDPowerPower in
SCL SCLI²C SCLBidirectional (GPIO)
SDA SDAI²C SDABidirectional (GPIO)

Specifications

Operating voltage
3.3 V (max 5 V)
Interface
I²C
I²C address
0x59
I²C pull-ups
On-board (no external resistors)
Dimensions
25.4 × 5 × 17.8 mm

Verified from the Tinkered component library · Adafruit (Sensirion SGP40).

Circuit requirements

  • Power VIN from 3-5V. An onboard regulator supplies the SGP40 (a 1.7-3.6V part), and the 3V3 pin can source the regulated rail to other 3.3V devices.
  • Interface is I2C only, at the fixed address 0x59 (decimal 89), supporting standard mode (100 kHz) and fast mode (400 kHz).
  • The board includes I2C pull-up resistors on SDA and SCL, so external pull-ups are not required on a short bus with one device.
  • SCL and SDA are 3.3V logic on the sensor; the board is designed to interface with common 3.3V and 5V microcontrollers over I2C.
  • Drive one raw measurement per second (1 Hz). The VOC Index algorithm needs roughly 60 seconds of continuous sampling to establish a baseline, and the datasheet lists a switch-on time of up to 1 hour for full specified performance.
  • For humidity-compensated readings, feed the measure-raw command real relative humidity and temperature values, typically from a companion sensor such as an SHT4x.

Board compatibility

The SGP40 VOC Sensor connects to any of the microcontrollers supported in Tinkered. Mind the 3.3 V logic level on 3.3 V boards.

Common SGP40 VOC Sensor mistakes

Expecting a ppm concentration

The SGP40 does not output a calibrated gas concentration. It provides a relative VOC Index (roughly 0-500, with 100 as the running average) meant for detecting changes and trends, not an absolute ppm reading.

Reading it once and trusting the number

The VOC Index is produced by an adaptive algorithm that needs continuous 1 Hz sampling and about 60 seconds to build its baseline. A single read right after power-on returns a conditioning placeholder, not a meaningful value.

Skipping humidity compensation

The measure-raw command accepts relative humidity and temperature inputs. If you leave them at the default (50% RH, 25C), readings drift with ambient humidity. Feed real values from a companion temperature/humidity sensor for accurate output.

Using the raw SRAW ticks directly

The 16-bit SRAW signal is proportional to the logarithm of the sensor resistance, not a usable air-quality number on its own. Run it through Sensirion's VOC Gas Index Algorithm to get the VOC Index.

Trying to change the I2C address

The SGP40 address is fixed at 0x59 and cannot be reconfigured. You cannot place two SGP40 sensors on the same bus; use an I2C multiplexer or separate buses if you need more than one.

SGP40 VOC Sensor datasheet

Official SGP40 VOC Sensor datasheetAdafruit (Sensirion SGP40)

Popular SGP40 VOC Sensor projects

Indoor air quality monitor

Sample the VOC Index once per second and show it on an OLED or LCD with color or word thresholds (good, moderate, poor) for a desk or room air monitor.

Demand-controlled ventilation

Trigger a fan, exhaust, or air purifier when the VOC Index rises above the running baseline, then back off as the air clears.

Humidity-compensated air station

Pair the SGP40 with an SHT4x or BME280 over the same I2C bus and feed live humidity and temperature into the algorithm for stable, compensated readings.

Smart home air-quality logging

Publish the VOC Index from an ESP32 to Home Assistant or an MQTT dashboard to chart cooking, cleaning, and ventilation events over time.

Build with the SGP40 VOC Sensor.

Drop the SGP40 VOC Sensor into a circuit, write firmware, and simulate it in your browser, then deploy to real hardware. All in one editable Tinkered project.