There are no kinds of VOCs and there is no VOC measurements.
Neither of these sensors can measure VOC.
To measure them there are some fancier like PMS5003
You literally measure the resistance of a wire (sensirion doc) in flame, where VOC + Oxygen makes it burn better.
The only difference is that the VOC index shows fancy meaningless numbers.
BME680 produces direct measurements of resistance and it is your job to map it or tune to real-world values in your environment. Ex: For tuned BME680 ~0kOm is heavily polluted and 1000kOm fresh air from outside.
(you can configure its temp/time of burn, to choose what to measure and how).
With SGP40 there is no configuration, actually just a 16-bit number, which can be mapped in the same way. The only difference is that by datasheet it looks reverse mapped, closer to 0 - cleaner.
Also, note some limitations:
So, again:
- VOC Index - meaningless
- You should not convert to a VOC Index if you wish to compare or measure something.
- You should measure sensor values under known conditions to have an idea of what they mean.
- To know if you really need temperature/humidity compensation - again it is preferred to measure raw values under known conditions.
There is no issue with an external VOC library because it is not needed.
There is no profit from the sensor if you do not spend time to at least get to know what it shows.
The only good analogy that I come up with, is the belt tensioner tool:
VOC sensors are really like this one. There is no general way to convert values from measurements in
mm
to real tension.
Or like a humidity sensor without temperature, you can say you have a 60% relative humidity and I have a 60% humidity, and they are very likely unequal underneath by several times in absolute humidity values.
If you want an analogy for the VOC index - imagine your thermistor will show the temperature difference between a cold start and “now”. Not 240 degree, just +220 degrees. You hit FIRMWARE_RESTART and now it is 0, and after cooldown -200.
You can spray the sensor with isopropyl alcohol, it is harmless, but you will get the idea of a “polluted” value from the sensor.