This is the Sensirion SGP43 library for Arduino allowing you to communicate with a SGP43 sensor over I²C.
Click here to learn more about the Sensirion SGP43 sensor.
Air Quality Sensor for VOC and NOx Measurements.
The default I²C address of SGP43 is 0x59.
This library can be installed using the Arduino Library manager: Start the Arduino IDE and open the Library Manager via
Sketch ➔ Include Library ➔ Manage Libraries...
Search for the Sensirion I2C SGP43 library in the Filter your search... field and install it by clicking the install button.
If you cannot find it in the library manager, download the latest release as .zip file and add it to your Arduino IDE via
Sketch ➔ Include Library ➔ Add .ZIP Library...
Don't forget to install the dependencies listed below the same way via library
manager or Add .ZIP Library
Use the following pin description to connect your SGP43 to the standard I²C bus of your Arduino board:
| Pin | Cable Color | Name | Description | Comments |
|---|---|---|---|---|
| 1 | red | VDD | Supply Voltage | 1.7V to 3.6V |
| 2 | black | GND | Ground | |
| 3 | green | SDA | I2C: Serial data input / output | |
| 4 | blue | NC | Do not connect | |
| 5 | VDDH | Supply voltage hotplate; see data sheet on how to connect. | ||
| 6 | yellow | SCL | I2C: Serial clock input |
The recommended voltage is 3.3V.
You will find pinout schematics for recommended board models below:
SparkFun ESP32-C6 Qwiic Pocket
Qwiic connection (no soldering):
- The SparkFun ESP32-C6 Qwiic Pocket has a 4-pin Qwiic connector (JST-SH) that is wired to the I²C bus at 3.3V. The SGP43 sensor uses I²C at address 0x59.
- Simply plug a Qwiic cable between the board and the SGP43 eval kit. Power the board over USB-C. No additional wiring is required.
- If your SGP43 board exposes a STEMMA QT/Qwiic port, use a standard Qwiic-to-Qwiic cable. If it only exposes header pins, use a Qwiic adapter cable to break out to 3.3V, GND, SDA and SCL.
Notes:
- The Pocket board provides the required pull-ups on the I²C lines.
- The default Wire instance is used by this library; the Qwiic connector is on the default I²C pins, so no pin configuration is needed in code.
Arduino IDE board support (Espressif) and board selection:
-
Install ESP32 boards by Espressif Systems
- Open Arduino IDE ➔ File ➔ Preferences ➔ Additional Boards Manager URLs and add: https://espressif.github.io/arduino-esp32/package_esp32_index.json
- Then go to Tools ➔ Board ➔ Boards Manager…, search for “esp32” by “Espressif Systems” and click Install.
-
Select the correct board
- Once you have installed the Espressif ESP32 board package, choose: Tools ➔ Board ➔ esp32 ➔ “SparkFun ESP32-C6 Qwiic Pocket”.
- Optionally you can also use the generic Espressif definition: Tools ➔ Board ➔ esp32 ➔ “ESP32C6 Dev Module”. This works well for the examples in this library.
After selecting the board, set the upload port under Tools ➔ Port, open File ➔ Examples ➔ Sensirion I2C SGP43 ➔ exampleSGP43Classifier, and upload. Open Tools ➔ Serial Monitor at 115200 baud to see readings.
Arduino Uno
| SGP43 | SGP43 Pin | Cable Color | Board Pin |
|---|---|---|---|
| VDD | 1 | red | 3.3V |
| GND | 2 | black | GND |
| SDA | 3 | green | D18/SDA |
| VDDH | 5 | ||
| SCL | 6 | yellow | D19/SCL |
Arduino Nano
| SGP43 | SGP43 Pin | Cable Color | Board Pin |
|---|---|---|---|
| VDD | 1 | red | 3.3V |
| GND | 2 | black | GND |
| SDA | 3 | green | A4 |
| VDDH | 5 | ||
| SCL | 6 | yellow | A5 |
Arduino Micro
| SGP43 | SGP43 Pin | Cable Color | Board Pin |
|---|---|---|---|
| VDD | 1 | red | 3.3V |
| GND | 2 | black | GND |
| SDA | 3 | green | D2/SDA |
| VDDH | 5 | ||
| SCL | 6 | yellow | ~D3/SCL |
Arduino Mega 2560
| SGP43 | SGP43 Pin | Cable Color | Board Pin |
|---|---|---|---|
| VDD | 1 | red | 3.3V |
| GND | 2 | black | GND |
| SDA | 3 | green | D20/SDA |
| VDDH | 5 | ||
| SCL | 6 | yellow | D21/SCL |
ESP32 DevKitC
| SGP43 | SGP43 Pin | Cable Color | Board Pin |
|---|---|---|---|
| VDD | 1 | red | 3V3 |
| GND | 2 | black | GND |
| SDA | 3 | green | GPIO 21 |
| VDDH | 5 | ||
| SCL | 6 | yellow | GPIO 22 |
For instructions on using the SEK-SGP4x evaluation board for machine learning-based smell detection, please read application note GAS_AN_SGP43 in combination with the documentation of the dedicated example.
Contributions are welcome!
This Sensirion library uses
clang-format to standardize the
formatting of all our .cpp and .h files. Make sure your contributions are
formatted accordingly:
The -i flag will apply the format changes to the files listed.
clang-format -i src/*.cpp src/*.hNote that differences from this formatting will result in a failed build until they are fixed. :
See LICENSE.


