Repository navigation
Version 2.0.0
The component now drives both the SGP40 and the SGP41 through a single API.
The SGP41 is the same sensor with an added NOx channel, and it requires the
conditioning command before the first measurement: sgp4x_start_conditioning()
runs it and returns the raw VOC value for every cycle, so the sensor can be
watched while it warms up. After that, sgp4x_measure_index() returns the VOC
index and, on the SGP41, the NOx index, both computed by Sensirion's Gas Index
Algorithm, which replaces the older VOC algorithm.
The new sgp41 example shows the whole sequence: the humidity and the
temperature are taken from an AHT sensor during the conditioning, the sensor
warms up for ten seconds and the loop then prints both indices with the air
quality verdict. The header of the vendor algorithm is documented on the
component page as well.
Breaking changes
sgp40.his nowsgp4x.h, and the prefix of every function, type and
constant issgp4x_:sgp40_tbecamesgp4x_t,SGP40_ADDRbecame
SGP4X_ADDR.sgp4x_init_desc()takes the device type, so a single call describes either
chip:sgp4x_init_desc(&dev, SGP4x_TYPE_SGP40, port, sda, scl).sgp40_measure_raw()becamesgp4x_measure_raw(), which fills the raw VOC
value and, on the SGP41, the raw NOx value.sgp40_measure_voc()becamesgp4x_measure_index().sgp40_soft_reset()is gone: the initialization reads the serial number and
the featureset, and the datasheet's reset command is no longer needed.
Thanks to @botastic for the SGP41 support and for the unified driver.
Full changelog: 1.0.8...2.0.0