meta data for this page
LamaPLC: SGP Sensirion Gas-sensors with I²C communication
The Sensirion SGP sensor family includes high-performance, multi-pixel gas sensors tailored for indoor air quality monitoring. Using metal-oxide (MOx) technology on a single chip, these sensors detect multiple pollutants and remain stable against contamination.
Core Sensor Models
- SGP30 (Legacy standard): The first of its kind to offer multiple sensing elements on one chip. It provides calibrated signals for Total Volatile Organic Compounds (TVOC) in parts per billion (ppb) and a calculated CO₂ equivalent (eCO₂) based on hydrogen concentrations.
- SGP40 (VOC optimized): Designed specifically for VOC detection in indoor environments. It replaced the SGP30's raw ppb output with a more robust VOC Index (1–500) that automatically adapts to the surrounding environment.
- SGP41 (VOC + NOx): The current flagship for air treatment devices like purifiers. It includes all the VOC capabilities of the SGP40 but adds a dedicated sensor for Nitrogen Oxides (NOx), a common combustion byproduct from stoves and vehicle exhaust.
- SGPC3 (Ultra-low power): A variant optimized for mobile and battery-operated devices, offering reliable gas sensing with minimal power drain.
The SGP sensors can be integrated with the Tasmota system. For more information, see here.
If you'd like to support the development of the site with the price of a coffee — or a few — please do so here.
Here's a handy tip: you can quickly save this page as a PDF by clicking “export to PDF” in the menu on the right side of the screen.
Arduino & SGP41 Modul
The GY-SGP41 module operates on a flexible 3.3V to 5V DC power supply. The core SGP41 sensor chip, however, has a narrower supply voltage range of 1.7V to 3.6V.
- SCL: A5
- GND: GND
- SDA: A4
- Vdd: 5V
Arduino code
When interfacing the SGP41 VOC and NOx sensor with an Arduino, the most reliable approach is to use the official Sensirion I2C SGP41 library or the Adafruit SGP41 library.
This basic example initializes the sensor and retrieves raw VOC and NOx signals.
#include <Arduino.h> #include <SensirionI2CSgp41.h> #include <Wire.h> SensirionI2CSgp41 sgp41; void setup() { Serial.begin(115200); while (!Serial) { delay(100); } Wire.begin(); sgp41.begin(Wire); // Initial self-test uint16_t testResult; if (sgp41.executeSelfTest(testResult) || testResult != 0xD400) { Serial.println("SGP41 Self-test failed!"); } } void loop() { uint16_t error; uint16_t srawVoc = 0; uint16_t srawNox = 0; // Use default compensation (25°C, 50% RH) // For better accuracy, feed real T/RH from another sensor here error = sgp41.measureRawSignals(0x8000, 0x6666, srawVoc, srawNox); if (!error) { Serial.print("Raw VOC: "); Serial.print(srawVoc); Serial.print("\tRaw NOx: "); Serial.println(srawNox); } else { Serial.println("Measurement error!"); } delay(1000); // Wait 1 second }
This page has been accessed for: Today: 1, Until now: 22




