====== 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. **Key Comparisons** {{anchor:sgp30}} {{anchor:sgp40}} {{anchor:sgp41}} ^Feature^Sensirion SGP30^Sensirion SGP40^Sensirion SGP41| | |{{:sensor:sgp30.png?100|SGP30}}|{{:sensor:sgp40.png?100|SGP40}}|{{:sensor:sgp41.png?100|SGP41}}| ^Primary Output|TVOC (ppb) & eCO₂ (ppm)|VOC Index (1-500)|VOC & NOx Index| ^Detection Focus|Broad VOCs & H₂|Volatile Organic Compounds|VOCs + Nitrogen Oxides| ^Power Consumption|~48 mA (active)|~2.6 mA (at 3.3V)|~3.2 mA (at 3.3V)| ^Stability|Excellent (siloxane resistant)|Enhanced long-term stability|Enhanced long-term stability| ^I²C Address|0x58|0x59|0x59| ^Supply Voltage (VDD)|1.62V – 1.98V (1.8V typ)|1.7V – 3.6V (3.3V typ)|1.7V – 3.6V (3.3V typ)| ^TVOC / VOC Output|0 – 60,000 ppb|1 – 500 Index|1 – 500 Index| ^eCO₂ Output|400 – 60,000 ppm|N/A|N/A| ^NOx Output|N/A|N/A|1 – 500 Index| ^Max Sampling Frequency|1 Hz|Up to 10 Hz (raw data)|Up to 10 Hz (raw data)| ^Moduls|{{:sensor:sgp30_modul.png?150|SGP30 modul}}|{{:sensor:sgp40_modul.png?150|SGP40 modul}}|{{:sensor:sgp40_modul.png?150|SGP40 modul}}| ^ |GY-SGP30|GY-SGP40|GY-SGP41| The SGP sensors can be integrated with the [[https://tasmota.github.io/docs/About/|Tasmota]] system. For more information, [[https://github.com/arendst/Tasmota/pull/18880|see here]]. {{page>:tarhal}} ==== 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 #include #include 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 } {{tag>SGP30 SGP40 SGP41 Sensirion gas-sensor i2c communication sensor arduino code eCO₂ VOC TVOC indoor_air_quality IAQ NOx hydrogen}} This page has been accessed for: Today: {{counter|today}}, Until now: {{counter|total}}