{"id":19738427,"url":"https://github.com/sensirion/raspberry-pi-i2c-sts4x","last_synced_at":"2026-05-08T17:33:24.105Z","repository":{"id":141774223,"uuid":"457446032","full_name":"Sensirion/raspberry-pi-i2c-sts4x","owner":"Sensirion","description":"Raspberry Pi driver for Sensirions STS4x temperature sensor","archived":false,"fork":false,"pushed_at":"2024-05-23T18:19:55.000Z","size":525,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-10T19:29:48.008Z","etag":null,"topics":["driver","linux","raspberry-pi","raspi","sensirion","sensor","sts40","sts4x","temperature"],"latest_commit_sha":null,"homepage":"https://sensirion.com/products/catalog/SEK-STS40-CD1B/","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":"2022-02-09T16:48:30.000Z","updated_at":"2024-05-23T18:19:58.000Z","dependencies_parsed_at":"2024-05-13T14:12:44.544Z","dependency_job_id":"dde8071b-5dd9-4551-a5a4-7d5d63504c67","html_url":"https://github.com/Sensirion/raspberry-pi-i2c-sts4x","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fraspberry-pi-i2c-sts4x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fraspberry-pi-i2c-sts4x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fraspberry-pi-i2c-sts4x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fraspberry-pi-i2c-sts4x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sensirion","download_url":"https://codeload.github.com/Sensirion/raspberry-pi-i2c-sts4x/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241067936,"owners_count":19903920,"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","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","linux","raspberry-pi","raspi","sensirion","sensor","sts40","sts4x","temperature"],"created_at":"2024-11-12T01:14:09.973Z","updated_at":"2026-05-08T17:33:24.055Z","avatar_url":"https://github.com/Sensirion.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sensirion Raspberry Pi I2C STS4x Driver\n\nThis document explains how to set up the STS4x sensor to run on a Raspberry Pi\nusing the provided code.\n\n[\u003ccenter\u003e\u003cimg src=\"images/STS4x.png\" width=\"300px\"\u003e\u003c/center\u003e](https://www.sensirion.com)\n\nClick [here](https://www.sensirion.com) to learn more about the STS4x Sensor and Evaluation Kit.\n\n\nSetup Guide\n-----------\n\n### Connecting the Sensor\n\nYour sensor has the four different connectors: VCC, GND, SDA, SCL. Use\nthe following pins to connect your STS4x:\n\n *STS4x*  |    *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-sts4x) 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-sts4x`\n    3. Run the `make` command to compile the driver\n\n       Output:\n       ```\n       rm -f sts4x_i2c_example_usage\n       cc -Os -Wall -fstrict-aliasing -Wstrict-aliasing=1 -Wsign-conversion -fPIC -I. -o sts4x_i2c_example_usage  sts4x_i2c.h sts4x_i2c.c sensirion_i2c_hal.h sensirion_i2c.h sensirion_i2c.c \\\n       \tsensirion_i2c_hal.c sensirion_config.h sensirion_common.h sensirion_common.c sts4x_i2c_example_usage.c\n       ```\n- Test your connected sensor\n    - Run `./sts4x_i2c_example_usage` in the same directory you used to\n      compile the driver.\n\n      Output:\n      ```\n      Serial number: 272952127\n      Temperature: 25.09 °C\n      Temperature: 25.08 °C\n      Temperature: 25.08 °C\n      Temperature: 25.10 °C \n      Temperature: 25.08 °C\n      ...\n      ```\n\nTroubleshooting\n---------------\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 ./sts4x_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-sts4x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsensirion%2Fraspberry-pi-i2c-sts4x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensirion%2Fraspberry-pi-i2c-sts4x/lists"}