{"id":19738486,"url":"https://github.com/sensirion/raspberry-pi-uart-svm4x","last_synced_at":"2026-06-14T21:32:12.563Z","repository":{"id":149346085,"uuid":"429113156","full_name":"Sensirion/raspberry-pi-uart-svm4x","owner":"Sensirion","description":"C driver to work with the Sensirion's SVM41 sensor modules via UART on Raspberry-Pi","archived":false,"fork":false,"pushed_at":"2024-05-10T09:56:25.000Z","size":2578,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-04T03:48:09.981Z","etag":null,"topics":["driver","evaluation-kit","humidity","nox","raspberry-pi","sek","sensirion","svm41","svm4x","temperature","uart","voc"],"latest_commit_sha":null,"homepage":null,"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-11-17T16:06:54.000Z","updated_at":"2024-05-10T09:56:28.000Z","dependencies_parsed_at":"2023-11-15T10:47:07.802Z","dependency_job_id":"1e5769e1-fa5f-40d4-9b1d-8dd98bb5f6d9","html_url":"https://github.com/Sensirion/raspberry-pi-uart-svm4x","commit_stats":null,"previous_names":["sensirion/raspberry-pi-uart-svm4x"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Sensirion/raspberry-pi-uart-svm4x","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fraspberry-pi-uart-svm4x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fraspberry-pi-uart-svm4x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fraspberry-pi-uart-svm4x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fraspberry-pi-uart-svm4x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sensirion","download_url":"https://codeload.github.com/Sensirion/raspberry-pi-uart-svm4x/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fraspberry-pi-uart-svm4x/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34339194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"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","evaluation-kit","humidity","nox","raspberry-pi","sek","sensirion","svm41","svm4x","temperature","uart","voc"],"created_at":"2024-11-12T01:14:20.831Z","updated_at":"2026-06-14T21:32:12.541Z","avatar_url":"https://github.com/Sensirion.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sensirion Raspberry Pi UART SVM4X Driver\n\nThe repository provides a driver for setting up a SVM4X evaluation kit to run on a Raspberry Pi over UART using the SHDLC protocol. \n\n\u003cimg src=\"images/svm4x.png\" width=\"300px\"\u003e\n\nClick [here](https://www.sensirion.com/my-sgp-ek/) to learn more about the Sensirion SVM4X evaluation kit.\n\n\nThe SVM4x evaluation kit covers evaluation of the SGP40 and SGP41 sensors.\nThis driver supports SVM4x firmware version 3.1.0 and above.\n\n\n## Connect the sensor\n\n\u003cdetails\u003e\u003csummary\u003eConnecting the Sensor over USB\u003c/summary\u003e\n\u003cp\u003e\nThis is the recommended way to connect your sensor. \nPlug the provided USB cable into your Raspberry Pi and sensor.\n\u003c/p\u003e\u003c/details\u003e\n\n\n\u003cdetails\u003e\u003csummary\u003eConnecting the Sensor over UART Pins\u003c/summary\u003e\n\u003cp\u003e\n\nUse the following pins to connect your SVM4X to your Raspberry Pi:\n\n\u003cimg src=\"images/svm41-pinout-uart.png\" width=\"300px\"\u003e\n\n| *Pin SVM4X* | *Cable Color* | *Name* | *Pin Raspberry Pi* | *Description*  | *Comments* |\n|---|---|:---:|---|---|---|\n| 1 | red | VDD | Pin 2 | Supply Voltage | 3.3 or 5V |\n| 2 | black | GND | Pin 6 | Ground |  |\n| 3 | green | RX | Pin 8 | UART: Transmission pin for communication |  |\n| 4 | yellow | TX | Pin 10 | UART: Receiving pin for communication |  |\n| 5 | blue | SEL | Pin 4 | Interface select | Leave floating or pull to VDD to select UART |\n\n\u003cimg src=\"images/raspi-uart-pinout-5V.png\" width=\"400px\"\u003e\n\n\u003e **Note:** Make sure to [configure your hardware serial interface](https://www.raspberrypi.com/documentation/computers/configuration.html#disabling-the-linux-serial-console) on your Raspberry Pi.\n\n\u003e **Note:** Make sure to connect serial pins as cross-over (RX pin of sensor -\u003e TX on Raspberry Pi; TX pin of sensor -\u003e RX pin of Raspberry Pi)\n\n\u003c/p\u003e\u003c/details\u003e\n\n## Quick start example\n\n- [Install the Raspberry Pi OS on to your Raspberry Pi](https://projects.raspberrypi.org/en/projects/raspberry-pi-setting-up)\n- Download the SVM4X driver from [Github](https://github.com/Sensirion/raspberry-pi-uart-svm4x) and extract the `.zip`\n  on your Raspberry Pi\n- Connect the SVM4X sensor as explained in the [section above](#connect-the-sensor)\n- Check that the correct serial port is set in the define in `sensirion_uart_portdescriptor.h`\n   - For connection over USB (in case you have other devices connected check the USB number)\n\n     `#define SERIAL_0 \"/dev/ttyUSB0\"`\n\n   - For connection over UART Pins \n\n     `#define SERIAL_0 \"/dev/serial0\"`\n\n- Compile the driver\n    1. Open a [terminal](https://projects.raspberrypi.org/en/projects/raspberry-pi-using/8)\n    2. Navigate to the driver directory. E.g. `cd ~/raspberry-pi-uart-svm4x`\n    3. Navigate to the subdirectory example-usage.\n    4. Run the `make` command to compile the driver\n\n       Output:\n       ```\n       rm -f svm4x_uart_example_usage\n       cc -Os -Wall -fstrict-aliasing -Wstrict-aliasing=1 -Wsign-conversion -fPIC -I. -o svm4x_uart_example_usage svm4x_uart.h svm4x_uart.c sensirion_uart_hal.h sensirion_shdlc.h sensirion_shdlc.c \\ \n           sensirion_uart_hal.c sensirion_config.h sensirion_common.h sensirion_common.c svm4x_uart_example_usage.c\n       ```\n- Test your connected sensor\n    - Run `./svm4x_uart_example_usage` in the same directory you used to compile the driver. You should see the\n      measurement values in the console.\n\n## Troubleshooting\n\n### Building driver failed\n\nIf the execution of `make` in the compilation step 3 fails with something like\n\n```bash\n make: command not found\n```\n\nyour RaspberryPi likely does not have the build tools installed. Proceed as follows:\n\n```\n$ sudo apt-get update\n$ sudo apt-get upgrade\n$ sudo apt-get install build-essential\n```\n\n\n\n## Contributing\n\n**Contributions are welcome!**\n\nWe develop and test this driver using our company internal tools (version\ncontrol, continuous integration, code review etc.) and automatically\nsynchronize the master branch with GitHub. But this doesn't mean that we don't\nrespond to issues or don't accept pull requests on GitHub. In fact, you're very\nwelcome to open issues or create pull requests :)\n\nThis Sensirion library uses\n[`clang-format`](https://releases.llvm.org/download.html) to standardize the\nformatting of all our `.c` and `.h` files. Make sure your contributions are\nformatted accordingly:\n\nThe `-i` flag will apply the format changes to the files listed.\n\n```bash\nclang-format -i *.c *.h\n```\n\nNote that differences from this formatting will result in a failed build until\nthey are fixed.\n\n\n## License\n\nSee [LICENSE](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensirion%2Fraspberry-pi-uart-svm4x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsensirion%2Fraspberry-pi-uart-svm4x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensirion%2Fraspberry-pi-uart-svm4x/lists"}