letscontrolit / ESPEasy

Easy MultiSensor device based on ESP8266/ESP32
http://www.espeasy.com
Other
3.22k stars 2.2k forks source link

BME680 - IAQ above 1.000 #3864

Open stoffelll opened 2 years ago

stoffelll commented 2 years ago

I'm running ESP_Easy_mega_20211105_test_B_ESP32_4M316k on an ESP32 with a Bosch BME680 sensor connected. The sensor itself seems to run good - as Temp, Hum and Pressure are reasonable. Only the IAQ value is somehow screwed up as it is constantly above 1.000 - usually the value should be between 0-500. Hence I'm wondering what is going wrong.

Interesstingly the IAQ value is increasing when I open the windows to get fresh air in -> I'm living in an area with no to little airpolution, so the outside air should be better than indoor air (see graphana chart).

In addition I'm running a second BME680 (different breakout board) on a ESP8266 (ESP_Easy_mega_20211105_test_B_ESP8266_4M1M) which delivers reasonable data (between 0-500).

Any ideas what could be the issue?

Independent of this issue, I wanted to ask if we can get somehow the other values from the BME680 (like e.g. CO2 ppm, b-VOC ppm and may be accuracy status) -> see https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bme680-ds001.pdf -> Page 25.

Thanks and best regards SL

image image

TD-er commented 2 years ago

The Bosch BME 680 is a so called "VOC" sensor. Meaning it does measure Volatile Organic Compounds, and thus is not specific to a single gas. So whatever the manufacturer calls "CO2" or "eCO2" is not what it is measuring. The sensor does react to a number of gasses and this can be somewhat compared to the amount of CO2 which might be in a room, under very specific conditions...

Bosch does have a closed source library to read the AQI value from the sensor, but we are not allowed to use that in "nightly builds" due to the license restrictions. (I have talked to Bosch about this a while ago) There are libraries based on reverse-engineering which we can look into to use.

About what I'm seeing here, it looks like one or more values read from the sensor may get out of range for the used integer type or may have flipped its sign where the used formula is not accounting for. So this may very well be a bug that's fixable in our code.

To be honest, without looking into the code, I have no idea how the AQI value is being computed. If memory serves me well, I think it is based on reading some resistance value and applying some corrections on it. But I know that computing a proper AQI value is difficult without the closed source Bosch library. So we may need to move to one of those reverse engineered libs out there to perform a good AQI calculation. Also I don't think the "Gas" value is to be considered the AQI value, but merely related to the measured resistance inside the sensor and thus still a raw value.

Related issues: