{"id":16064684,"url":"https://github.com/eldruin/embedded-ccs811-rs","last_synced_at":"2025-03-18T05:30:47.727Z","repository":{"id":57624593,"uuid":"225143264","full_name":"eldruin/embedded-ccs811-rs","owner":"eldruin","description":"Platform agnostic Rust driver for the CCS811 ultra-low power digital gas sensor for monitoring indoor air quality","archived":false,"fork":false,"pushed_at":"2021-09-11T16:29:53.000Z","size":136,"stargazers_count":12,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-16T05:28:11.808Z","etag":null,"topics":["co2","digital-gas-sensor","driver","embedded","embedded-hal","embedded-hal-driver","gas","i2c","rust","sensor","vocs"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eldruin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-01T10:29:46.000Z","updated_at":"2021-09-11T16:29:56.000Z","dependencies_parsed_at":"2022-08-26T22:12:15.672Z","dependency_job_id":null,"html_url":"https://github.com/eldruin/embedded-ccs811-rs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fembedded-ccs811-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fembedded-ccs811-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fembedded-ccs811-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fembedded-ccs811-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eldruin","download_url":"https://codeload.github.com/eldruin/embedded-ccs811-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243902842,"owners_count":20366365,"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","digital-gas-sensor","driver","embedded","embedded-hal","embedded-hal-driver","gas","i2c","rust","sensor","vocs"],"created_at":"2024-10-09T05:09:07.293Z","updated_at":"2025-03-18T05:30:47.716Z","avatar_url":"https://github.com/eldruin.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust CCS811 Driver: Ultra-low Power Digital Gas Sensor for Monitoring Indoor Air Quality\n\n[![crates.io](https://img.shields.io/crates/v/embedded-ccs811.svg)](https://crates.io/crates/embedded-ccs811)\n[![Docs](https://docs.rs/embedded-ccs811/badge.svg)](https://docs.rs/embedded-ccs811)\n![Minimum Supported Rust Version](https://img.shields.io/badge/rustc-1.62+-blue.svg)\n[![Build Status](https://github.com/eldruin/embedded-ccs811-rs/workflows/Build/badge.svg)](https://github.com/eldruin/embedded-ccs811-rs/actions?query=workflow%3ABuild)\n[![Coverage Status](https://coveralls.io/repos/github/eldruin/embedded-ccs811-rs/badge.svg?branch=master)](https://coveralls.io/github/eldruin/embedded-ccs811-rs?branch=master)\n\nThis is a platform-agnostic Rust driver for the CCS811 ultra-low power\ndigital VOC sensor for monitoring indoor air quality (IAQ) using\nthe [`embedded-hal`] traits.\n\nThis driver allows you to:\n- In application mode:\n    - Set the measurement mode. See: `set_mode()`.\n    - Check if there is new data ready. See: `has_data_ready()`.\n    - Get the algoritm and raw result data. See: `data()`.\n    - Get the raw data. See: `raw_data()`.\n    - Get the current baseline. See: `baseline()`.\n    - Set the baseline. See: `set_baseline()`.\n    - Set the environment temperature and relative humidity. See: `set_environment()`.\n    - Set the interrupt mode. See: `set_interrupt_mode()`.\n    - Set the eCO2 thresholds for interrupts. See: `set_eco2_thresholds()`.\n- In boot mode:\n    - Start application. See: `start_application()`.\n    - Reset, erase, download and verify new application. See: `update_application()`.\n    - Erase application. See: `erase_application()`.\n    - Verify application. See: `verify_application()`.\n    - Download application. See: `download_application()`.\n- In either mode:\n    - Get the firmware mode. See: `firmware_mode()`.\n    - Check whether a valid application is loaded. See: `has_valid_app()`.\n    - Get the hardware ID. See: `hardware_id()`.\n    - Get the hardware version. See: `hardware_version()`.\n    - Get the firmware bootloader version. See: `firmware_bootloader_version()`.\n    - Get the firmware application version. See: `firmware_application_version()`.\n    - Do a software reset. See: `software_reset()`.\n\n[Introductory blog post](https://blog.eldruin.com/ccs811-indoor-air-quality-sensor-driver-in-rust)\n\n## The device\n\nThe CCS811 is an ultra-low power digital gas sensor solution which\nintegrates a metal oxide (MOX) gas sensor to detect a wide range of\nVolatile Organic Compounds (VOCs) for indoor air quality monitoring\nwith a microcontroller unit (MCU), which includes an Analog-to-Digital\nconverter (ADC), and an I²C interface.\n\nCCS811 is based on ams unique micro-hotplate technology which enables a\nhighly reliable solution for gas sensors, very fast cycle times and a\nsignificant reduction in average power consumption.\n\nThe integrated MCU manages the sensor driver modes and measurements.\nThe I²C digital interface significantly simplifies the hardware and\nsoftware design, enabling a faster time to market.\n\nCCS811 supports intelligent algorithms to process raw sensor measurements\nto output equivalent total VOC (eTVOC) and equivalent CO2 (eCO2) values,\nwhere the main cause of VOCs is from humans.\n\nCCS811 supports multiple measurement modes that have been optimized for\nlow-power consumption during an active sensor measurement and idle mode\nextending battery life in portable applications.\n\nDocumentation:\n- [Datasheet](https://www.sciosense.com/wp-content/uploads/2020/01/CCS811-Datasheet.pdf)\n- [Programming and interfacing guide](https://www.sciosense.com/wp-content/uploads/2020/01/CCS811-Application-Note-Programming-and-interfacing-guide.pdf)\n\n## Usage\n\nTo use this driver, import this crate and an `embedded_hal` implementation,\nthen instantiate the device.\n\nPlease find additional examples using hardware in this repository: [driver-examples]\n\n[driver-examples]: https://github.com/eldruin/driver-examples\n\n```rust\nextern crate linux_embedded_hal as hal;\nuse embedded_ccs811::{prelude::*, Ccs811, MeasurementMode, SlaveAddr};\nuse nb::block;\n\nfn main() {\n    let dev = hal::I2cdev::new(\"/dev/i2c-1\").unwrap();\n    let nwake = hal::Pin::new(17);\n    let delay = hal::Delay {};\n    let address = SlaveAddr::default();\n    let sensor = Ccs811::new(dev, address, nwake, delay);\n    let mut sensor = sensor.start_application().ok().unwrap();\n    sensor.set_mode(MeasurementMode::ConstantPower1s).unwrap();\n    loop {\n        let data = block!(sensor.data()).unwrap();\n        println!(\"eCO2: {}, eTVOC: {}\", data.eco2, data.etvoc);\n    }\n}\n```\n\n## Support\n\nFor questions, issues, feature requests, and other changes, please file an\n[issue in the github project](https://github.com/eldruin/embedded-ccs811-rs/issues).\n\n## Minimum Supported Rust Version (MSRV)\n\nThis crate is guaranteed to compile on stable Rust 1.62 and up. It *might*\ncompile with older versions but that may change in any new patch release.\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or\n   http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or\n   http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contributing\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n\n[`embedded-hal`]: https://github.com/rust-embedded/embedded-hal\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldruin%2Fembedded-ccs811-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feldruin%2Fembedded-ccs811-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldruin%2Fembedded-ccs811-rs/lists"}