I was looking for an air quality sensor,
although I've tried some, controlling heater of the sensor
was somewhat difficult and so far I have not had any reasonable
read-out from the sensors/modules I've tired.
Then I came across this one, the heater can be controlled via I2C or SPI.
So I gave a try.
It was easy up to read and write registers via I2C,
then I noticed that configuring the parameters and
calculating the read value to something reasonable
were not quite easy.
So it was the time to read the datasheet seriously,
and I found that Bosch was providing a couple of lifesavers.
(1) Open Source Driver via the github
(2) Bosch Sensortec BSEC Software
Since (2) requires SLA (Software License Agreement), I decided to go with (1).
Note: To calculate the gas resistor value to IAQ Index probably (2) is required.
The open-source driver also came with self-test.
Which is quite helpful to confirm that the hardware is at least functioning.
But meantime, I noticed that as the self test utilizes heater a lot,
after the test, the temperature read outs starts rather high.
本サンプルは CQ出版 インターフェース 2019年2月号に
I contributed this sample project to a Japanese technical magazine
"Interface" Feb/2019 edition.