{"id":19738411,"url":"https://github.com/sensirion/raspberry-pi-i2c-sgp41","last_synced_at":"2026-05-19T05:43:48.031Z","repository":{"id":141774249,"uuid":"394710997","full_name":"Sensirion/raspberry-pi-i2c-sgp41","owner":"Sensirion","description":"The SGP41 is Sensirion’s new digital VOC (volatile organic compounds) and NOx sensor designed for easy integration into air purifiers or demand-controlled ventilation.","archived":false,"fork":false,"pushed_at":"2024-05-23T18:20:59.000Z","size":650,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-04T13:29:51.979Z","etag":null,"topics":["driver","i2csgp","nox","raspberry-pi","sensirion","sensor","sgp41","sgp4x","voc"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sensirion.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-10T16:31:21.000Z","updated_at":"2025-02-10T20:11:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"b7b3a57b-576e-4776-9cb5-60a8b0cb91c3","html_url":"https://github.com/Sensirion/raspberry-pi-i2c-sgp41","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Sensirion/raspberry-pi-i2c-sgp41","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fraspberry-pi-i2c-sgp41","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fraspberry-pi-i2c-sgp41/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fraspberry-pi-i2c-sgp41/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fraspberry-pi-i2c-sgp41/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sensirion","download_url":"https://codeload.github.com/Sensirion/raspberry-pi-i2c-sgp41/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fraspberry-pi-i2c-sgp41/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002367,"owners_count":26083355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["driver","i2csgp","nox","raspberry-pi","sensirion","sensor","sgp41","sgp4x","voc"],"created_at":"2024-11-12T01:14:07.880Z","updated_at":"2025-10-10T00:08:35.590Z","avatar_url":"https://github.com/Sensirion.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sensirion Raspberry Pi I2C SGP41 Driver\n\nThis document explains how to set up the SGP41 sensor to run on a Raspberry Pi\nusing the provided code.\n\n[\u003ccenter\u003e\u003cimg src=\"images/SGP41.png\" width=\"300px\"\u003e\u003c/center\u003e](https://www.sensirion.com/en/environmental-sensors/gas-sensors/sgp41)\n\nClick [here](https://www.sensirion.com/en/environmental-sensors/gas-sensors/sgp41) to learn more about the SGP41 Sensor.\n\n\n## Setup Guide\n\n### Connecting the Sensor\n\nYour sensor has the four different connectors: VCC, GND, SDA, SCL. Use\nthe following pins to connect your SGP41:\n\n *SGP41*  |    *Raspberry Pi*\n :------: | :------------------:\n   VCC    |        Pin 1 (3.3V)\n   GND    |        Pin 6\n   SDA    |        Pin 3\n   SCL    |        Pin 5\n\n\u003ccenter\u003e\u003cimg src=\"images/GPIO-Pinout-Diagram.png\" width=\"900px\"\u003e\u003c/center\u003e\n\n### Raspberry Pi\n\n- [Install the Raspberry Pi OS on to your Raspberry Pi](https://projects.raspberrypi.org/en/projects/raspberry-pi-setting-up)\n- [Enable the I2C interface in the raspi-config](https://www.raspberrypi.org/documentation/configuration/raspi-config.md)\n- Download the driver for the [Sensirion Github Page](https://github.com/Sensirion/raspberry-pi-i2c-sgp41) and extract the `.zip` on your Raspberry Pi\n- Compile the driver\n    1. Open a [terminal](https://www.raspberrypi.org/documentation/usage/terminal/?)\n    2. Navigate to the driver directory. E.g. `cd ~/raspberry-pi-i2c-sgp41`\n    3. Run the `make` command to compile the driver\n\n       Output:\n       ```\n       rm -f sgp41_i2c_example_usage\n       cc -Os -Wall -fstrict-aliasing -Wstrict-aliasing=1 -Wsign-conversion -fPIC -I. -o sgp41_i2c_example_usage  sgp41_i2c.h sgp41_i2c.c sensirion_i2c_hal.h sensirion_i2c.h sensirion_i2c.c \\\n           sensirion_i2c_hal.c sensirion_config.h sensirion_common.h sensirion_common.c sgp41_i2c_example_usage.c\n       ```\n- Test your connected sensor\n    - Run `./sgp41_i2c_example_usage` in the same directory you used to\n      compile the driver.\n\n      Output:\n      ```\n      SRAW VOC: 25720\n      SRAW NOx: conditioning\n      SRAW VOC: 25846\n      SRAW NOx: conditioning\n      ...\n      SRAW VOC: 25951\n      SRAW NOx: 15656\n      SRAW VOC: 26153\n      SRAW NOx: 15612\n      SRAW VOC: 26278\n      SRAW NOx: 15553\n      ...\n      ```\n\n## Conditioning\n\nAfter each restart of the sensor or when the hotplates have been switched off, the conditioning command must\nbe called from idle mode. The conditioning heats the hotplate of the NOx pixel to a different temperature compared\nto the measurement mode enabling a faster switch-on thereafter.\n\nIt is recommended to execute the conditioning for 10s, but **10s must not be exceeded** to avoid damage to the sensing material.\n\n## Troubleshooting\n\n### Initialization failed\n\n-   Ensure that you connected the sensor correctly: All cables are fully\n    plugged in and connected to the correct pin.\n-   Ensure that I2C is enabled on the Raspberry Pi. For this redo the steps on\n    \"Enable the I2C interface in the raspi-config\" in the guide above.\n-   Ensure that your user account has read and write access to the I2C device.\n    If it only works with user root (`sudo ./sgp41_i2c_example_usage`), it's\n    typically due to wrong permission settings.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensirion%2Fraspberry-pi-i2c-sgp41","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsensirion%2Fraspberry-pi-i2c-sgp41","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensirion%2Fraspberry-pi-i2c-sgp41/lists"}