antirez / bme680-pure-mp

Pure MicroPython Bosch BME680 sensor driver
MIT License
12 stars 0 forks source link

Notes on the BME680 #1

Open rcarmo opened 8 months ago

rcarmo commented 8 months ago

Just wanted to leave you with a couple of pointers. I have gone down the rabbit hole of trying to understand what Bosch did in their code a while back and kept this repo as a decent starting point for trying to understand it.

I have a Pico board and a spare BME680 someplace around, so whenever I have the time I will try out your code.

antirez commented 8 months ago

@rcarmo oh, that's interesting! You had too to fight with the BME680. I dind't write it in the README yet as I'll experiment more with it, but basically what I'm finding is that:

  1. The BME680 is really a temperature sensor OR ALTERNATIVELY a VOC sensor. Because if you use the gas sensitive surface sensor, the heating will affect the temperature reading and make it unusable. To avoid this problem you need to take VOC measures very far apart from temperature measures. Minutes apart.
  2. The gas sensor reading is highly a relative measure. You need to be consistent when querying the gas sensor: always at the same interval. Then you need to correct the reading for absolute humidity (trying to guess it from RL / temp), and finally you have to do experiments in live in order to find set-points, and finally provide a scale approximating your curve.
  3. All this probably also requires a baseline because (I need to test) there could be sensor-to-sensor differences. But I want to hope that if one is super consistent in the reading period / parameters, it is possible to get some absolute sense of the reading. I'll see...

Thanks!

antirez commented 8 months ago

@rcarmo p.s. reading your repo and finding it highly instructive! Thanks for sharing.

rcarmo commented 8 months ago

We seem to be going down parallel paths towards simpler, more low-level gear, which is great - happy to provide some insight back. Regarding the BME680, in my case the readings were offset even more because the Enviropi+ board I was using (in one of my attempts) had the Pi Zero CPU too close to it as well, so running more processes made the temperature reference fluctuate.

It’s been weird. I’ve since gotten - just yesterday, in fact - an IKEA VINDSTYRKA air quality sensor that uses a Sensirion part and intend to open it up and poke at it, but it works so well with zigbee2mqtt and HomeKit that I am hesitant to do so just yet.

Give it a couple of weeks… In the meantime I will be hacking at ESP32s and RK3588 boards…