THE ALPHABET PROJECT - professional Arduino, BeagleBone & Raspberry PI shields

COVID19-SARS2 service info ==> we are 100% up and running!

Order IoT product(s) of the week. Check our newest low power IoT shield and Raspberry PI low power LTE modem.

Bosch BSEC2 cookbook (Arduino BME688 or BME680 sensor advanced tutorial)



About this tutorial

This is just a kickstart that helps you to earn a lot of time by fast install, configure and adapt the Bosch BSEC2 library in order to be used with s-Sense BME688 or BME680 sensors. The rest depends on you... only the sky may be the limit! ;)

BME688 sensor breakout - topBME688 sensor breakout - bottom

PN: SS-BME688#I2C   SKU: ITBP-6007     BME688 I2C sensor breakout more info, order

BME680 sensor breakout - topBME680 sensor breakout - bottom

PN: SS-BME688#I2C   SKU: ITBP-6003     BME680 I2C sensor breakout more info, order

- at first sensor usage, minimum 48 hours of "burn in" should be made. Later, at each usage, at least 30 min. of functioning should pass before sensor data may be considered as valid (depend on sensor configuration).
- in order to avoid contamination, DO NOT touch the metallic casing of the BME688/BME680!!!




Hardware integration (wiring)

Hardware wiring it is exemplified bellow for xyz-mIoT shield (SAMD21G). The wiring for BME680 sensor it's the same as shown for BME688. In a nut shell, wire as bellow:

BSEC2 Arduino BME688 or BME680 sensor advanced tutorial - wiring




Bosch BSEC2 library and Bosch BME68x library (download, install and configure)

a. download Bosch BME68x library from: itbrainpower or from github. Download Bosch BSEC2 library from: itbrainpower or from github.

b. unzip the libraries and install (copy the folders) to the Arduino libraries folder (mine is "C:\Users\drago\Documents\Arduino\libraries").

c. Identify the location for Arduino "preferences.txt" (mine is in "C:\Users\drago\AppData\Local\Arduino15". You should find the location in your computer by accesing in Arduino File\Preferences section). Close the Arduino environment.

d. Open and edit the "preferences.txt" file. Search for the following line:
"recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" --specs=nano.specs --specs=nosys.specs {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} -Wl,--start-group {compiler.arm.cmsis.ldflags} -lm "{build.path}/{archive_file}" -Wl,--end-group".
Comment this line!

Add bellow:
"#modified pt. BSEC2
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" --specs=nano.specs --specs=nosys.specs {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} "C:\...your_path_to_Arduino_libraries...\Bosch-BSEC2-Library-master\src\cortex-m0plus\libalgobsec.a" -Wl,--start-group {compiler.arm.cmsis.ldflags} -lm "{build.path}/{archive_file} " -Wl,--end-group
Save the modified "preferences.txt" file.

d. Open the Arduino environment. Now you should be able to compile and run (almost) any examples that can be found under "BSEC2 Software Library" and "BME68x Sensor library".

HINTS - do not forget to:
- READ and ACCEPT Bosch Sensortec licence agreemets.
- In examples replace "Serial." with "SerialUSB." in order to make the software compatible with the xyz-mIoT nodes.
- In examplesmake the proper instantiation for the BME86x "envSensor" variable. "envSensor.begin(BME68X_I2C_ADDR_LOW, Wire)" should be suitable for you...
- READ the comments / guidelines in code files inside Bosch BSEC2 library and Bosch BME68x library!

Last, but not least:
- invests significant time and resources providing those tutorials and in the design phase of our IoT products. Support us by purchasing our sensors, IoT nodes and modems from here.
- You know? We offer design hardware, software and manufacturing services even for low power (battery/solar) sensor application.








Original how to written by Dragos Iosub & team





document version 1.0 / 2022-05-03 © R&D Software Solutions srl