Nicla Sense ME getting air quality values

hello, i've been looking at the examples for the Nicla Sense ME. For the 'gas' sensor (the BME688), I'm trying to get what the air quality index is, and also the eCO2. However, the examples only show a "gas.value()" that returns an integer. I have no idea what that is returning (there is no description of units).

I saw on a Bosch message board that a different sensor ID needs to be called out (SensorBSEC bsec(SENSOR_ID_BSEC_LEGACY)) and the SENSOR_DATA_FIXED_LENGTH needs to be updated to 30 in the SensorTypes.h file in the library. However, most of the values are still 0 (I'm only getting the temp, what looks like in degrees C):

BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 30.93 comp_h: 20.99

Can anyone assist in how to get the IAQ and eCO2 values from the sensor? Thanks!

Nicla Sense ME in the store: https://store.arduino.cc/products/nicla-sense-me
Nicla Sense ME in the docs: https://docs.arduino.cc/hardware/nicla-sense-me
Nicla Sense ME library: https://github.com/arduino/nicla-sense-me-fw

I'm very sorry, I spent about 20 minutes reading code on Github and didn't get anywhere.
Adafruit sells the BME688: https://www.adafruit.com/product/5046
They use the library of the BME680, which returns only the raw value of the gas sensor.
In the tutorial they tell about the BSEC library and they show an example how to use that. If you try that, you should get better numbers.

It works if you use the updated version of BHY2Host from Github and if you change the SENSOR_DATA_FIXED_LENGTH to 30. There is as well a new example for the BSEC host sketch.
I used the deprecated ID 171 and not the actual one 115. For whatever reason the actual ID only delivers zero values.

1 Like

@hditter, yes thank you. I meant to come back on the board and post exactly what you wrote. With the new library, and changing the size to 30, along with using the LEGACY ID, I was able to get it to work. Seems awful kludgy to me for a "Pro" board. Thanks for the response.

1 Like