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.
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.

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.
| Pin | Function | Type |
|---|---|---|
VIN VIN (3-5V) | Power | Power in |
3V3 3V3 (out) | Power | Power out |
GND GND | Power | Power in |
SCL SCL | I²C SCL | Bidirectional (GPIO) |
SDA SDA | I²C SDA | Bidirectional (GPIO) |
Verified from the Tinkered component library · Adafruit (Sensirion SGP40).
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.
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.
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.
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.
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.
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.
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.
Trigger a fan, exhaust, or air purifier when the VOC Index rises above the running baseline, then back off as the air clears.
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.
Publish the VOC Index from an ESP32 to Home Assistant or an MQTT dashboard to chart cooking, cleaning, and ventilation events over time.
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.