{"id":20046023,"url":"https://github.com/johntalton/boschieu","last_synced_at":"2025-05-05T09:31:23.835Z","repository":{"id":22579343,"uuid":"96734848","full_name":"johntalton/boschIEU","owner":"johntalton","description":"Bosch Integrated Environmental Unit (bmp280 / bme280 / bme680 / bmp388/ bmp390)","archived":false,"fork":false,"pushed_at":"2023-03-31T13:57:06.000Z","size":375,"stargazers_count":6,"open_issues_count":5,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-07T21:46:29.381Z","etag":null,"topics":["bme280","bme680","bmp280","bmp388","bmp390","bosch","fifo","gas","humidity","i2c","javascript","pressure","sensor","spi","temperature"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johntalton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.yml","support":null}},"created_at":"2017-07-10T04:10:59.000Z","updated_at":"2023-01-18T12:25:51.000Z","dependencies_parsed_at":"2023-02-17T19:55:16.624Z","dependency_job_id":null,"html_url":"https://github.com/johntalton/boschIEU","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johntalton%2FboschIEU","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johntalton%2FboschIEU/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johntalton%2FboschIEU/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johntalton%2FboschIEU/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johntalton","download_url":"https://codeload.github.com/johntalton/boschIEU/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224436903,"owners_count":17310927,"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":["bme280","bme680","bmp280","bmp388","bmp390","bosch","fifo","gas","humidity","i2c","javascript","pressure","sensor","spi","temperature"],"created_at":"2024-11-13T11:20:27.520Z","updated_at":"2024-11-13T11:20:28.060Z","avatar_url":"https://github.com/johntalton.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bosch Integrated Environmental Unit\n\nCommon Unified Sensor API for supported IEU chips.\n\n[![npm Version](http://img.shields.io/npm/v/@johntalton/boschieu.svg)](https://www.npmjs.com/package/@johntalton/boschieu)\n![GitHub package.json version](https://img.shields.io/github/package-json/v/johntalton/boschieu)\n![CI](https://github.com/johntalton/boschIEU/workflows/CI/badge.svg?branch=master\u0026event=push)\n![CodeQL](https://github.com/johntalton/boschIEU/workflows/CodeQL/badge.svg)\n![GitHub](https://img.shields.io/github/license/johntalton/boschieu)\n[![Downloads Per Month](http://img.shields.io/npm/dm/@johntalton/boschieu.svg)](https://www.npmjs.com/package/@johntalton/boschieu)\n![GitHub last commit](https://img.shields.io/github/last-commit/johntalton/boschieu)\n[![Package Quality](https://npm.packagequality.com/shield/%40johntalton%2Fboschieu.svg)](https://packagequality.com/#?package=@johntalton/boschieu)\n\nProvides full feature access to all supported chips (bmp280 bme280 bme680 bmp388 bmp390) while still providing rich chip specific features (multiple heater profiles and fifo access).\n\nTested with these products:\n - [Adafruit BMP280](https://www.adafruit.com/product/2651)\n - [Adafruit BME280](https://www.adafruit.com/product/2652)\n - [Adafruit BME680](https://www.adafruit.com/product/3660)\n - [Adafruit BMP388](https://www.adafruit.com/product/3966)\n - [Adafruit BMP390](https://www.adafruit.com/product/4816)\n\n(note: Adafruit no-longer sells the [bmp085](https://www.adafruit.com/product/391) or [bmp180](https://www.adafruit.com/product/1603), donation of legacy chips are welcome to aid in greater product support)\n\n## :triangular_ruler: [Example Usage](examples/README.md)\n\n# :wrench: API\n\nThe API is organized around simple sensor class `BoschSensor` which provides an object interface for manipulating the sensor.  All method return a Promise.\n\nA simple demo usage follows.\n```js\nconst i2c1 = await i2c.openPromisified(1);\nconst addressedI2C1 = new I2CAddressedBus(i2c1, 0x77);\nconst sensor = await BoschIEU.sensor(addressedI2C1);\nawait sensor.detectChip();\nawait sensor.calibration();\nconst result = await sensor.measurement();\n\n```\n\n## :blue_book: BoschIEU\n#### :page_facing_up: sensor(addressedBus)\nA static factory method to provide access to the `BoschSensor` class.\n\n\n## :blue_book: BoschIEU Sensor\n#### :page_facing_up: detectChip()\nAfter constructing a sensor object, the `detectChip` method is recommended as it will attempt to (get this) detect which version of the chip to use for further register interactions.\n```js\nsensor.detectChip()\n   .then(() =\u003e { if(sensor.valid()) ... })\n\n```\nAlternatively, if you are you wish to set the chip during initialization that is also possible\n```js\n   // sensor.chipId = Chip.bmp388\n```\n#### :page_facing_up: id()\nReturns the chips id as defined by the vendor. This is only valid after a chip has been detected (`valid()` returns true)\n(note that legacy `id()` call will internal run `detectChip()` for now...)\n```js\nsensor.id()\n   .then(id =\u003e console.log('sensors Id', id);\n```\n#### :page_facing_up: calibration()\nFetches the calibration constants from the chip.  These values are unique for each chip and needed to perform compensation of the raw data values into temperature and pressure readings.\n\nNote: This must be called before the `measurement` call will return valid results.\n\nNote: The method itself caches results in the class and is not needed externally (though returned for user inspection)\n#### :page_facing_up: fifo()\nThe `fifo` getter method returns a static `Fifo` class implementation. This provides a namespace for fifo functionality.\n```js\nsensor.fifo.flush( ... ).then(...)\n```\n#### :page_facing_up: profile()\nReturns current chip profile from the device.\n#### :page_facing_up: setProfile(profile)\nSets the profile for the chip.\n\nNote: This will set the entire profile, if fields are not included in `profile` they will be set to the defaults for the `Chip`.\n#### :page_facing_up: reset()\nWrite a soft-reset to the chip.  Returning it to power-on state.\n```js\nsensor.reset().then( ... )\n```\n#### :page_facing_up: measurement(...)\nReads and calculates related measurement data from the `Chip`.\n```js\nsensor.measurement().then(results =\u003e {\n  // process results\n});\n```\n\n\n## :blue_book: Fifo\n#### :page_facing_up: flush()\nFlushes the fifo buffer using command register.\n#### :page_facing_up: read()\nReads the current fifo buffer in full (as specified by size) and parses and compensates frame data.\n## :blue_book: Converter\nConverter class of common helps are included (ft to meters, altitude from Pa, etc)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohntalton%2Fboschieu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohntalton%2Fboschieu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohntalton%2Fboschieu/lists"}