Skip to main content

Grove - VOC Gas Sensor (SGP40)


The Grove - VOC Gas Sensor (SGP40) is an innovative environmental sensing module developed for a wide array of Volatile Organic Compound (VOC) detection applications. Based on the advanced Sensirion SGP40 sensor, it excels in transforming raw sensor signals into standardized digital signals for seamless integration into existing systems.

With its capability to perform high-quality VOC measurements in real-time, this sensor module provides a versatile solution for tracking and monitoring indoor air quality. Given the increasing awareness and need for monitoring air quality due to its direct correlation with health, the Grove - VOC Gas Sensor (SGP40) can be an essential component of systems targeted towards improving indoor air quality, personal environment monitoring, HVAC systems, industrial safety and any application where air quality assessment is pivotal.

Its compatibility with the Grove ecosystem facilitates an easy and straightforward setup process. The plug-and-play nature of Grove system allows developers to incorporate this module without needing to handle complicated wiring or intricate coding. This feature can significantly speed up development time and allows users to focus more on data interpretation and action steps based on the VOC measurements.

One of the key advantages of the Grove - VOC Gas Sensor (SGP40) is its communication protocol. The sensor module uses the I2C interface, a widely adopted protocol known for its simplicity and efficiency. This makes the data transfer process between the sensor and your main controller extremely smooth, enabling quick reaction times for applications where immediate actions based on VOC levels are crucial.

In sum, the Grove - VOC Gas Sensor (SGP40) is a compact, powerful, and easy-to-integrate module that makes the challenging task of VOC detection simpler and more accessible, opening doors for innovations and developments in environmental applications.


  • Utilizes the Sensirion SGP40 sensor for reliable VOC detection.
  • Easy integration into the Grove ecosystem, simplifying the wiring and coding process.
  • Provides real-time VOC measurements for accurate air quality assessment.
  • Communicates via I2C interface, allowing for efficient data transfer.
  • Compact and modular design, perfect for embedding in various applications.


  • Operating Voltage: 3.3/5V
  • Interface: I2C
  • Dimensions: 20x40mm


  • Indoor air quality monitoring system: The Grove - VOC Gas Sensor can be used in buildings to monitor the air quality and ensure a healthy living or working environment.
  • Personal environment monitoring device: The sensor can be used to create a portable device that allows individuals to monitor the air quality in their immediate environment.
  • HVAC systems: The sensor can help regulate air quality in heating, ventilation, and air conditioning systems.
  • Industrial safety: It can be used in factories and industrial sites to ensure worker safety by detecting harmful VOC levels.

Hardware Overview

Pin Map


Getting Started


If this is the first time you work with Arduino, we strongly recommend you to see Getting Started with Arduino before the start.

Play With Arduino


Materials required

Seeeduino V4.2Base ShieldGrove - VOC Gas Sensor (SGP40)




Get One NowGet One NowGet One Now

1. Please plug the USB cable gently, otherwise you may damage the port. Please use the USB cable with 4 wires inside, the 2 wires cable can't transfer data. If you are not sure about the wire you have, you can click here to buy

2. Each Grove module comes with a Grove cable when you buy. In case you lose the Grove cable, you can click here to buy.

  • Step 1. Connect Grove - VOC Gas Sensor (SGP40) to I2C port of Grove-Base Shield.

  • Step 2. Plug Grove - Base Shield into Seeeduino.

  • Step 3. Connect Seeeduino to PC via a USB cable.



If we don't have Grove Base Shield, We also can directly connect Grove - Smart Air Quality Sensor (SGP41) to Seeeduino as below.

SeeeduinoGrove - VOC Gas Sensor (SGP40)


  • Step 1. Download the SGP40 Arduino Library from Github.

  • Step 2. Refer to How to install library to install library for Arduino.

  • Step 3. After downloading and installing the library correctly, you can find an example program named exampleUsage.ino in the examples folder. This program is designed for the SGP40 sensor.

#include <Arduino.h>
#include <SensirionI2CSgp40.h>
#include <Wire.h>

SensirionI2CSgp40 sgp40;

void setup() {

while (!Serial) {


uint16_t error;
char errorMessage[256];


uint16_t serialNumber[3];
uint8_t serialNumberSize = 3;

error = sgp40.getSerialNumber(serialNumber, serialNumberSize);

if (error) {
Serial.print("Error trying to execute getSerialNumber(): ");
errorToString(error, errorMessage, 256);
} else {
for (size_t i = 0; i < serialNumberSize; i++) {
uint16_t value = serialNumber[i];
Serial.print(value < 4096 ? "0" : "");
Serial.print(value < 256 ? "0" : "");
Serial.print(value < 16 ? "0" : "");
Serial.print(value, HEX);

uint16_t testResult;
error = sgp40.executeSelfTest(testResult);
if (error) {
Serial.print("Error trying to execute executeSelfTest(): ");
errorToString(error, errorMessage, 256);
} else if (testResult != 0xD400) {
Serial.print("executeSelfTest failed with error: ");

void loop() {
uint16_t error;
char errorMessage[256];
uint16_t defaultRh = 0x8000;
uint16_t defaultT = 0x6666;
uint16_t srawVoc = 0;


error = sgp40.measureRawSignal(defaultRh, defaultT, srawVoc);
if (error) {
Serial.print("Error trying to execute measureRawSignal(): ");
errorToString(error, errorMessage, 256);
} else {
  • Step 4. Upload the demo. If you do not know how to upload the code, please check How to upload code.

  • Step 5. Open the Serial Monitor of Arduino IDE by click Tool-> Serial Monitor. Or tap the ++ctrl+shift+m++ key at the same time. if every thing goes well, you will get the result.


Schematic Online Viewer


Tech Support & Product Discussion

Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.

Loading Comments...