{"id":19738518,"url":"https://github.com/sensirion/arduino-gas-index-algorithm","last_synced_at":"2025-04-30T05:31:34.507Z","repository":{"id":42076623,"uuid":"429827659","full_name":"Sensirion/arduino-gas-index-algorithm","owner":"Sensirion","description":"Arduino Library for Sensirion's Gas Index Algorithm, providing a VOC and NOx Index output signal calculated from the SGP40/41 raw signals","archived":false,"fork":false,"pushed_at":"2024-03-13T08:10:36.000Z","size":104,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-03-13T09:31:06.755Z","etag":null,"topics":["algorithm","arduino","arduino-library","example","example-usage","gas","gas-index","nox","nox-representation","sensirion","sgp","sgp40","sgp41","sgp4x","voc","voc-representation"],"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}},"created_at":"2021-11-19T14:32:06.000Z","updated_at":"2023-08-11T07:43:42.000Z","dependencies_parsed_at":"2023-01-24T04:31:08.189Z","dependency_job_id":null,"html_url":"https://github.com/Sensirion/arduino-gas-index-algorithm","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Farduino-gas-index-algorithm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Farduino-gas-index-algorithm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Farduino-gas-index-algorithm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sensirion%2Farduino-gas-index-algorithm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sensirion","download_url":"https://codeload.github.com/Sensirion/arduino-gas-index-algorithm/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":["algorithm","arduino","arduino-library","example","example-usage","gas","gas-index","nox","nox-representation","sensirion","sgp","sgp40","sgp41","sgp4x","voc","voc-representation"],"created_at":"2024-11-12T01:14:25.173Z","updated_at":"2024-11-12T01:14:25.693Z","avatar_url":"https://github.com/Sensirion.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sensirion Gas Index Algorithm Arduino Library\n\nSensirion's Gas Index Algorithm software provides a VOC and an NOx Index output signal calculated from the SGP40/41 raw\nsignal inputs `SRAW_VOC` and `SRAW_NOX`. Note: for SGP40, only `SRAW_VOC` is available. This algorithm enables robust detection of\nambient changes of VOCs and NOx with minimal sensor-to-sensor variation. The algorithm is based on a statistical gain-offset\nnormalization and adapts both parameters constantly applying an exponentially decaying function of the learned parameters to\nbe able to adapt to changing environments.\n\nFor the VOC Index output, the software must be instanced as VOC Algorithm while for the NOx Index output, the software must\nbe instanced as NOx Algorithm. It is important to feed the raw signals to the corresponding algorithm (i.e., `SRAW_VOC` to the\nVOC Algorithm and `SRAW_NOX` to the NOx Algorithm) at a constant sampling interval which must coincide with the sampling\ninterval that is used to read out the raw signals from the SGP40/41 sensor. The default sampling interval applied in the\nalgorithm is 1 s. If your sampling interval is different, please use the constructor variant allowing you to pass the \nsampling interval. The VOC algorithm is tested for a sampling interval of 1s and 10s. \n\nThe algorithm calculates the VOC and NOx Index signals recursively from a single raw tick value of `SRAW_VOC` and `SRAW_NOX`,\nrespectively, which are both measured by the SGP40/41 sensor at each time step, as well as internal states that are updated\nat each time step. These internal states are most importantly the recursively estimated mean and variance of the\ncorresponding `SRAW` signal as well as some additional internal states such as uptime and other counters. After estimating the\nstates, the algorithm converts the raw signals in ticks into either VOC or NOx Index, respectively, and applies an adaptive\nlow-pass filter.\n\n# Installation\n\nTo install, download the latest release as .zip file and add it to your\n[Arduino IDE](http://www.arduino.cc/en/main/software) via\n\n\tSketch =\u003e Include Library =\u003e Add .ZIP Library...\n\n# Dependencies\n\nThe dependency to the Sensirion I2C drivers are only needed to run the example, which uses a SGP40 resp SGP41 and a SHT4x sensor.\n\n* [Sensirion I2C SGP41](https://github.com/Sensirion/arduino-i2c-sgp41)\n* [Sensirion I2C SGP40](https://github.com/Sensirion/arduino-i2c-sgp40)\n* [Sensirion I2C SHT4x](https://github.com/Sensirion/arduino-i2c-sht4x)\n\n\n## Quick Start to run the example\n\nThe example measures VOC and NOx ticks with a SGP41 sensor using a SHT4x to compensate temperature and humidity.\nThe raw VOC and NOx measurement signals are then processed with the gas index algorithm to get VOC Index and NOx Index values.\n\nFor more details about the sensors and breakout boards check out http://sensirion.com/my-sgp-ek/.\n\n1. **Install the driver dependencies** listed above the same way as you installed this library (via `Add .ZIP Library`)\n\n\n2. Connect a SGP41 and SHT4x Sensor over I2C to your Arduino\n\n\n3. Open the `exampleUsage` sample project within the Arduino IDE\n\n        File =\u003e Examples =\u003e Sensirion Gas Index Algorithm =\u003e exampleUsage\n\n4. Click the `Upload` button in the Arduino IDE or\n\n        Sketch =\u003e Upload\n\n5. When the upload process has finished, open the `Serial Monitor` or `Serial\n   Plotter` via the `Tools` menu to observe the measurement values and calculated \n   Gas Index value. Note that the `Baud Rate` in the corresponding window has to be set to `115200 baud`.\n\n\n### Low power example (SGP40)\nThe provided low power example demonstrate how to run the SGP40 sensor in low power mode and apply the VOC index algorithm to the acquired data. \n\nReduced power consumption is achieved by turning off the heater after each measurement. The heater is then turned back on by calling for a first ignored measurement that preceeds the actual measurement call by 170ms.\n\nThe following two low power modes have been tested:\nDuty cycle | Sampling interval | Average  power  consumption at 1.8V\n --- | --- | --- \nContinuous | 1 s | 6.3mW\n20%| 1 s | \u003c2.0mW\n2%| 10 s | \u003c0.2mW\n\n\n\n\n# Contributing\n\n**Contributions are welcome!**\n\nWe develop and test this algorithm 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 `.cpp` 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 src/*.cpp src/*.h\n```\n\nNote that differences from this formatting will result in a failed build until\nthey are fixed.\n\n# License\n\nSee [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensirion%2Farduino-gas-index-algorithm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsensirion%2Farduino-gas-index-algorithm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensirion%2Farduino-gas-index-algorithm/lists"}