GithubHelp home page GithubHelp logo

zanduino / bme680 Goto Github PK

View Code? Open in Web Editor NEW
37.0 6.0 10.0 5.23 MB

Arduino Library to access the Bosch BME680 - temperature, pressure, humidity and gas sensor

License: GNU General Public License v3.0

C++ 100.00%
arduino-library arduino i2c spi bosch bme680 sensor temperature pressure humidity

bme680's People

Contributors

michelheil avatar sv-zanshin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bme680's Issues

BME680 Humidity calibration according to datasheet?

Hi

I've seen a possible other calibration in you're code (and those from Bosh, versus the BME680 datasheet.

According the datasheet I would expect :

.h
const uint8_t BME680_BIT_H1_DATA_MSK = 0xF0; ///< Mask for humidity (instead of 0x0F)

.cpp

_H1 = (uint16_t)(((uint16_t)coeff_arr2[BME680_H1_MSB_REG] << BME680_HUM_REG_SHIFT_VAL) |
((uint16_t)(coeff_arr2[BME680_H1_LSB_REG] & BME680_BIT_H1_DATA_MSK)>>4) );
_H2 = (uint16_t)(((uint16_t)coeff_arr2[BME680_H2_MSB_REG] << BME680_HUM_REG_SHIFT_VAL) |
((uint16_t)(coeff_arr2[BME680_H2_LSB_REG] & BME680_BIT_H1_DATA_MSK)>>4));

Optimize Library code

Describe what the feature request is and if it solves an issue or adds functionality
Optimize library code

  • compact size
  • use standard initializers
  • optimize calls

Describe the solution you'd like
see above

Describe alternatives you've considered
none

Additional context
none

Implement "clang-format" to format c++ using a standard style

Describe what the feature request is and if it solves an issue or adds functionality
Currently the formatting of the library and example programs is non-standard. Using a standardized tool such as "clang-format" allows for a more legible source code and makes applying pull requests from multiple contributors much easier

Describe the solution you'd like
Add "clang-format" to the GitHub actions to automatically format on commit

Describe alternatives you've considered
none

Additional context
While I like working on a wide screen with the current 120-column width, it is non-standard.

Automate doxyfile to allow common file across all repos

Describe what the feature request is and if it solves an issue or adds functionality
Add environment variables to .travis.yml to allow using a common standardized doxfile

Describe the solution you'd like
as above

Describe alternatives you've considered
None

Additional context
None

Add function "getOversampling()" to read the oversampling values from the BME680

Is your feature request related to a problem? Please describe.

I have had a request to add this function to the library, at the moment the library contains no means of reading the current settings.

Describe the solution you'd like
Add the "getOversampling()" function to the library with the same parameters as the setOversampling() function.

Describe alternatives you've considered
None, if the user wants to read the current settings.

Additional context
None required

Zanshin Logo

Temperature readings are too high

Hi
after dealing a while with the BME680 I had the feeling that the Temprature out of the readings seems to be to high. After doing some research I found this from Bosch

Looking at a reference thermometer, we can see that our temperature is indeed a few degrees to high. Does that mean the temperature sensor inside the BME680 is inaccurate?
Actually no, it very accurately measures the temperature exactly where it is located on the board. But there also is the issue: our board as most devices contains some heat sources (e.g., MCU, WiFi chip, display, โ€ฆ). This means the temperature on our board is actually higher than the ambient temperature. Since the absolute amount of water in the air is approximately constant, this also causes the relative humidity to be lower on our board than elsewhere in the room.
As BSEC cannot know in which kind of device the sensor is integrated, we have provide some information to the algorithm to enable it to compensate this offset. In the simplest case, we have to deal with an embedded device with a constant workload and approximately constant self-heating. In such a case, we can simply supply a temperature offset to BSEC which will be subtracted from the temperature and will be used to correct the humidity reading as well.

from the Integration Guide - Bosch Software Environmental Cluster (BSEC)

Do you have a parameter that this mentioned compensation can be added to the initialisation?
If not is there a plan to integrate it?

Thanks
Martin

Add finer control to measurement calls

Describe what the feature request is and if it solves an issue or adds functionality
Currently a measurement is triggered at the end of a call to getSensorData(). Functionality to control triggering a new measurement and waiting for a measurement to complete should be added to the library. These suggestions are implied from posts and code recommendation from @Alain2019

Describe the solution you'd like
Add a "measuring()" function to return the current state of the BME680 and a "triggerMeasurement()" function to force a new measurement.

Describe alternatives you've considered
n/a

Additional context
n/a

Add an example program for I2C with 2 Bosch BME680 devices

Is your feature request related to a problem? Please describe.
The Bosch BME680 allows for 2 distinct I2C addresses, 0x76 and 0x77.

Describe the solution you'd like
An example program showing how to use 2 devices with I2C would be helpful.

Describe alternatives you've considered
none

Additional context

Zanshin Logo

SparkFun Fork?

Hi there @SV-Zanshin

I'd like to start by saying this isn't an issue, more of a request. SparkFun is currently making a breakout for the BME680 and would like to point to your library in our hookup guide. This can sometimes lead to an influx of questions/issues/pull requests on the repository. We are currently considering two options.

  1. Fork the library so we are able to update the library on our own.
  2. Leave the library as is, updating the library through pull requests.

Although your library is licensed as GNU, we wanted to ask if you had a preference before we move forward.

Thanks in advance, and excellent work,
Andy England

Gas Resistance Values are Static

Expected Behavior

The gas resistance value should change smell is detected.

Actual Behavior

The value is static and prints out a negative value in the 2000s. It is a library problem because the gas value changes when using the adafruit BME680 library.

Steps to Reproduce the Problem

Explain what needs to be done in order to reproduce the problem.
1.Make a sketch that includes the Zanshin BME680 library or use the IC2DEMO
2.Print the gas resistance value in serial monitor.
3.Run code and open serial monitor.

Specifications

  • Library Version:1.0.10
  • IDE Version:1.8.19
  • Platform:Arduino IDE
  • Subsystem:esp32 with BME680 sensor.

how are the readings done? sleep mode?

Hi

How is de lebrary doing the readings?

After looking at the source code I have the impression that the sensor is constantly running doing measurements.

Is it possible to let it "sleep" and only measure when needed?

Where in the source code should I look?

Using the "reset()" function doesn't work correctly when specifying I2C Address

Expected Behavior

The library should function after doing a reset() when using I2C with a specified address

Actual Behavior

The reset() is issued, but the library doesn't remember the original begin() parameter value, if specified.

Steps to Reproduce the Problem

The error is only visible when multiple BME680 devices are present on the bus and the reset() is called on the library with 0x77 address.

Specifications

  • Version: v1.0.5
  • Platform: Arduino
  • Subsystem: Arduino Micro

Zanshin Logo

Register offset for Pressure and Temperature oversampling switched around

Expected Behavior

Oversampling for temperature changes when calling setOversampling(TemperatureSensor,{value})

Actual Behavior

Oversampling in the command above changes that pressure oversampling register position

Steps to Reproduce the Problem

This requires a sample program that reads the Bosch BME680 registers directly

Specifications

  • Version: 1.0.5
  • Platform: Arduino
  • Subsystem: Arduino Micro

Zanshin Logo

Add function "getIIRFilter()" to read the IIR Filter values from the BME680

Is your feature request related to a problem? Please describe.
I have had a request to add this function to the library, at the moment the library contains no means of reading the current settings.

Describe the solution you'd like
Add the "getIIRFilter()" function to the library with the same parameters as the setIIRFilter() function.

Describe alternatives you've considered
None, if the user wants to read the current settings.

Additional context
None required

Zanshin Logo

Where are the Gas calibration constants used?

I've browsed through the source code and didn't see where the Gas calibration constants are used. This must be a bug. I recommend reviewing the code and comparing against the original published library from Bosch Sensortek.

Stefan

Return which I2C Address is in use

Is your feature request related to a problem? Please describe.
Since the BME680 can have two possible I2C addresses, it would be good to know which address is being used by the library instance

Describe the solution you'd like
Add a new function, "getI2CAddress()" which will return the current BME680 I2C Address

Describe alternatives you've considered
The alternative is to expose the internal "I2CAddress" variable, but if that is done then the user can change the I2C address determined during instantiation and break the library.

Additional context
none.

Function "setGas()" not documented in Wiki pages

Expected Behavior

Description of function should be on wiki pages

Actual Behavior

Page and links missing

Steps to Reproduce the Problem

n/a

Specifications

  • Version: 1.0.4
  • Platform: all
  • Subsystem: n/a

Zanshin Logo

Allow I2C to address a specific BME680 address

The BME680 allows 2 different I2C addresses (0x76 and 0x77). The library currently will check both addresses and use the first one found. But this means that two devices, both using I2C, are not supported. The begin() method should be changed to allow for explicit setting of either address while still being backwards-compatible and allowing no I2C address to be specified.

Demo program for ESP32 and logging to a webpage

Is your feature request related to a problem? Please describe.
An additional example program showing how to send BME680 logging data to a web page would be helpful. The ESP32 has built-in WiFi so is a good hardware platform for this example

Describe the solution you'd like
A running example program for the ESP32 microprocessor platform showing BME680 data going to a self-hosted webpage using AJAX

Describe alternatives you've considered
While adding a WiFi breakout to a smaller Arduino is possible, that would require specific programming for the various WiFi breakout boards available. Each example would be for just one WiFi board and be too much effort.

Additional context
None

Zanshin Logo

Sensor on/off

Curious if your library is handling the mentioned Low Power Mode or simple on/off of the sensor when utilized with battery?

Perhaps I'm literally missing the obvious in your code. ;)

First measurements after power-up incorrect

Expected Behavior

Each call to getSensorData() should return valid data.

Actual Behavior

After powering up the BME680 and initializing the library, the first returned measurements from getSensorData() are always incorrect.

Steps to Reproduce the Problem

  1. Power-Up System
  2. Initialize Library
  3. call getSensorData()

Specifications

  • Version: 1.0.13
  • Platform: Arduino

Zanshin Logo

Implement Travis-CI

Change the affected source code so that all of the platforms will compile correctly with Travis-CI

Sporadic problems when reading Humidity and Pressure

Expected Behavior

Values for temperature, humidity and pressure should be plausible

Actual Behavior

Occasionally, the BME680 using the example SPIDemo program, will show correct temperature values but the humidity will read 100% and the pressure will be below 700hPa although it should be close to 1000hPa.

Steps to Reproduce the Problem

Power down the device and restart. Sometimes the error will be reproducible. It seems to be a non-deterministic occurrence.

Specifications

  • Version: Library version 1.0.4
  • Platform: Arduino
  • Subsystem: Arduino Micro

Zanshin Logo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.