General questions about BME680

I bought a BME680 sensor from Adafruit and I've been testing it for the last couple of days. Some questions arise however.

IAQ Calculations

I know it's written in the datasheet that the IAQ calculation happens in a closed-source library from Bosch:

Bosch Sensortec BSEC software is available as a closed source binary which will be made available via a Software License Agreement (SLA) on the Bosch Sensortec website (https://www.bosch-sensortec.com/bst/products/all_products/BSEC).

The key features of the hardware-software system are:
Calculation of ambient air temperature outside of the device (e.g. phone)
Calculation of ambient relative humidity outside of the device
Calculation of indoor air quality (IAQ) level outside of the device

But there are other libraries/scripts out there which attempt to directly talk to the sensor without the BSEC library and use their own algorithm/calculation to obtain an IAQ value:

You've been asked this probably a thousand times but I'm asking it again: Would you be so kind to share the IAQ calculation algorithm? Or at least give some hints to get to a close to correct value?

 

Calibrations + Runtime

In the last few days I've been using a C script from https://github.com/alexh-name/bsec_bme680_linux to in combination with the BSEC library to obtain some values. Example output:

 

2020-04-03 10:17:08,[IAQ (2)]: 23.54,[T degC]: 2.36,[H %rH]: 68.66,[P hPa]: 950.59,[G Ohms]: 985240,[S]: 0,[eCO2 ppm]: 487.148864746093750,[bVOCe ppm]: 0.4762972593307495117187500
2020-04-03 10:17:11,[IAQ (2)]: 23.56,[T degC]: 2.36,[H %rH]: 68.62,[P hPa]: 950.60,[G Ohms]: 985968,[S]: 0,[eCO2 ppm]: 487.308288574218750,[bVOCe ppm]: 0.4765842854976654052734375
2020-04-03 10:17:14,[IAQ (2)]: 23.62,[T degC]: 2.35,[H %rH]: 68.60,[P hPa]: 950.60,[G Ohms]: 987426,[S]: 0,[eCO2 ppm]: 487.841918945312500,[bVOCe ppm]: 0.4775463342666625976562500

 

After a couple of hours of runtime, the sensor eventually switched to accuracy 3.

If I stop the script and launch it again (even just for a few seconds), the IAQ accuracy drops to 0 again. Does that mean that the sensor needs to be actively queried all the time to stay at accuracy level 3? Shouldn't the sensor have at least a short-term memory to recall it's already calibrated?

 

Python

From what I saw in the BSEC library, there's only support for C. Are there any plans to officially support python by creating a module?

 

Values between BSEC and Open Source Libraries differ

By comparing the Adafruit BME680 python library and using the above mentioned C program using the BSEC library I noticed different values retrieved from the sensor. This is probably caused by the Adafruit's own sensor calculations. Are you (Bosch) in direct contact with Adafruit which could help to get the same values as retrieved from the BSEC library (supposing the data retrieved from BSEC is correct)? -> https://github.com/adafruit/Adafruit_CircuitPython_BME680/issues/29

 

Thanks in advance for any helpful answers!

Best reply by Inactive Member

Napsty wrote:

You've been asked this probably a thousand times but I'm asking it again: Would you be so kind to share the IAQ calculation algorithm? Or at least give some hints to get to a close to correct value?


Short version: no. We are trying to support new platform requests to the extent of our resources, but their is no plan to open BSEC algorithms.


Napsty wrote:

After a couple of hours of runtime, the sensor eventually switched to accuracy 3.

If I stop the script and launch it again (even just for a few seconds), the IAQ accuracy drops to 0 again. Does that mean that the sensor needs to be actively queried all the time to stay at accuracy level 3? Shouldn't the sensor have at least a short-term memory to recall it's already calibrated?


For optimal performance, it is recommended to query the BME680 at fixed sampling period. The sensor itself is only providing raw data outputs (and has no on-board memory). During run-time, the different BSEC processes are happening in RAM, thus their status are lost if reset without further context information. In real-life, devices may be reset for different reasons (power outage, battery replacement, ...). Therefore BSEC offers interfaces to pull (respectively upload) a "state string" from (resp. to) the library (bsec_get_state() and bsec_set_state()). This state contains information about calibration history among others, so that IAQ accuracy could be restored as quickly as possible.


Napsty wrote:

From what I saw in the BSEC library, there's only support for C. Are there any plans to officially support python by creating a module?


There is currently no plan to officially support python for BSEC. Interfacing BSEC and python should be possible on larger platforms (e.g. Windows/Linux), but I understand it may get more challenging for the embedded python trend.


Napsty wrote:

By comparing the Adafruit BME680 python library and using the above mentioned C program using the BSEC library I noticed different values retrieved from the sensor. This is probably caused by the Adafruit's own sensor calculations. Are you (Bosch) in direct contact with Adafruit which could help to get the same values as retrieved from the BSEC library (supposing the data retrieved from BSEC is correct)? -> https://github.com/adafruit/Adafruit_CircuitPython_BME680/issues/29


We typ. support sensor usage and integration, but as far as I know we don't support third-party software. This specific implementation seems to me more like a port our sensor API/drivers in python, meaning a pure read-out our raw sensor signals.

Note that in addition to the IAQ calculation, BSEC is also doing all sorts of internal (and optionally even external) cross-influences compensation .

View original
4
13 replies
Resolved