{"id":19738404,"url":"https://github.com/sensirion/embedded-i2c-scd30","last_synced_at":"2025-04-30T05:31:23.066Z","repository":{"id":53443561,"uuid":"481148781","full_name":"Sensirion/embedded-i2c-scd30","owner":"Sensirion","description":"Sensirion I2C driver for embedded platforms for sensor SCD30","archived":false,"fork":false,"pushed_at":"2024-07-23T12:01:48.000Z","size":93,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-07-23T14:04:37.269Z","etag":null,"topics":["co2","co2-sensor","driver","embedded","humidity","i2c","sensirion","temperature"],"latest_commit_sha":null,"homepage":"https://sensirion.com/products/catalog/SCD30/","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-04-13T09:15:35.000Z","updated_at":"2024-07-23T12:01:51.000Z","dependencies_parsed_at":"2024-05-13T14:28:13.511Z","dependency_job_id":"59d692bb-4de1-4bcb-b158-6454b6f1e0fd","html_url":"https://github.com/Sensirion/embedded-i2c-scd30","commit_stats":{"total_commits":9,"total_committers":2,"mean_commits":4.5,"dds":0.2222222222222222,"last_synced_commit":"73ef7689ca773d48bf4044fec4f8e5bdd35427c7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fembedded-i2c-scd30","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fembedded-i2c-scd30/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fembedded-i2c-scd30/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Fembedded-i2c-scd30/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sensirion","download_url":"https://codeload.github.com/Sensirion/embedded-i2c-scd30/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224197821,"owners_count":17271999,"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":["co2","co2-sensor","driver","embedded","humidity","i2c","sensirion","temperature"],"created_at":"2024-11-12T01:14:07.421Z","updated_at":"2024-11-12T01:14:08.023Z","avatar_url":"https://github.com/Sensirion.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sensirion I2C SCD30 embedded Library\n\nThis document explains how to set up a  SCD30 sensor to run on a embedded device\nusing the provided code.\n\n\u003ccenter\u003e\u003cimg src=\"images/sensor_scd30_image.jpg\" width=\"300px\"\u003e\u003c/center\u003e\n\nClick [here](https://sensirion.com/products/catalog/SCD30/) to learn more about the Sensirion SCD30 sensor.\n\n\n\nThe default I²C address of [SCD30](https://sensirion.com/products/catalog/SCD30/) is **0x61**.\n\n\n\n## Setup Guide\n\n### Connecting the Sensor\n\nYour sensor has 5 different signals that need to be connected to your board: VDD, GND, SCL, SDA, SEL.\nUse the following pins to connect your SCD30:\n\n\u003cimg src=\"images/scd30_pinout.jpg\" width=\"300px\"\u003e\n\n| *Pin* | *Cable Color* | *Name* | *Description*  | *Comments* |\n|-------|---------------|:------:|----------------|------------|\n| 1 | red |VDD | Supply Voltage | 3.3 to 5.5V\n| 2 | black |GND | Ground | \n| 3 | yellow |SCL | I2C: Serial clock input | \n| 4 | green |SDA | I2C: Serial data input / output | \n| 5 |  |RDY | High when data is available | do not connect\n| 6 |  |PWM |  | do not connect\n| 7 | blue |SEL | Interface select | Pull to ground or floating for I2C\n\nThe recommended voltage is 3.3V.\n\n### Configure the code\n\nIn order to use the provided code we need to adjust two files according to your platform.\n\n### Edit `sensirion_i2c_hal.c`\n\nThis file contains the implementation of the sensor communication, which\ndepends on your hardware platform. We provide function stubs for your\nhardware's own implementation.\nSample implementations are available for some platforms:\n[`sample-implementations`](sample-implementations). For Linux based platforms\nlike Raspberry Pi you can just replace the unimplemented HAL template with the\nimplementation in `sample-implementations/linux_user_space/`:\n\n```\ncp sample-implementations/linux_user_space/sensirion_i2c_hal.c ./\n```\n\n### Edit `sensirion_config.h`\n\nSkip this part for Linux based platforms since everything is already setup for\nthis case.\n\nOtherwise you need to check if the libraries `\u003cstdint.h\u003e` and `\u003cstdlib.h\u003e` are\nprovided by your toolchain, compiler or system. If you have no idea on how to\ndo that you can skip this step for now and come back when you get errors\nrelated to these names when compiling the driver.\nThe features we use from those libraries are type definitions for integer sizes\nfrom `\u003cstdint.h\u003e` and `NULL` from `\u003cstdlib.h\u003e`. If they are not available you\nneed to specify the following integer types yourself:\n\n* `int64_t` = signed 64bit integer\n* `uint64_t` = unsigned 64bit integer\n* `int32_t` = signed 32bit integer\n* `uint32_t` = unsigned 32bit integer\n* `int16_t` = signed 16bit integer\n* `uint16_t` = unsigned 16bit integer\n* `int8_t` = signed 8bit integer\n* `uint8_t` = unsigned 8bit integer\n\nIn addition to that you will need to specify `NULL`. For both we have a\ndetailed template where you just need to fill in your system specific values.\n\n\n\nNow we are ready to compile and run the example usage for your sensor.\n\n## Compile and Run\n\nPass the source `.c` and header `.h` files in this folder into your C compiler\nand run the resulting binary. This step may vary, depending on your platform.\nHere we demonstrate the procedure for Linux based platforms:\n\n1. Open up a terminal.\n2. Navigate to the directory where this README is located.\n3. Run `make` (this compiles the example code into one executable binary).\n4. Run the compiled executable with `./scd30_i2c_example_usage`\n5. Now you should see the first measurement values appear in your terminal. As\n   a next step you can adjust the example usage file or write your own main\n   function to use the sensor.\n\n# Background\n\n## Files\n\n### sensirion\\_i2c.[ch]\n\nIn these files you can find the implementation of the I2C protocol used by\nSensirion sensors. The functions in these files are used by the embedded driver\nto build the correct frame out of data to be sent to the sensor or receive a\nframe of data from the sensor and convert it back to data readable by your\nmachine. The functions in here calculate and check CRCs, reorder bytes for\ndifferent byte orders and build the correct formatted frame for your sensor.\n\n### sensirion\\_i2c\\_hal.[ch]\n\nThese files contain the implementation of the hardware abstraction layer used\nby Sensirion's I2C embedded drivers. This part of the code is specific to the\nunderlying hardware platform. This is an unimplemented template for the user to\nimplement. In the `sample-implementations/` folder we provide implementations\nfor the most common platforms.\n\n### sensirion\\_config.h\n\nIn this file we keep all the included libraries for our drivers and global\ndefines. Next to `sensirion_i2c_hal.c` *it's the only file you should need to\nedit to get your driver working.*\n\n### sensirion\\_common.[ch]\n\nIn these files you can find some helper functions used by Sensirion's embedded\ndrivers. It mostly contains byte order conversions for different variable\ntypes. These functions are also used by the UART embedded drivers therefore\nthey are kept in their own file.\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%2Fembedded-i2c-scd30","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsensirion%2Fembedded-i2c-scd30","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensirion%2Fembedded-i2c-scd30/lists"}