Skip to main content

Sensirions public algorithms to calculate VOC and NOx gas indices.

Project description

Sensirion’s Gas Index Algorithm software provides a VOC and an NOx Index output signal calculated from the SGP40/41 raw signal inputs SRAW_VOC and SRAW_NOX. Note: for SGP40, only SRAW_VOC is available. This algorithm enables robust detection of ambient changes of VOCs and NOx with minimal sensor-to-sensor variation. The algorithm is based on a statistical gain-offset normalization and adapts both parameters constantly applying an exponentially decaying function of the learned parameters to be able to adapt to changing environments.

For the VOC Index output, the software must be instanced as VOC Algorithm while for the NOx Index output, the software must be instanced as NOx Algorithm. It is important to feed the raw signals to the corresponding algorithm (i.e., SRAW_VOC to the VOC Algorithm and SRAW_NOX to the NOx Algorithm) at a constant sampling interval which must coincide with the sampling interval that is used to read out the raw signals from the SGP40/41 sensor. The default sampling interval applied in the algorithm is 1 s. In case, a different sampling interval should be used the definition of the sampling interval in the h.file of the algorithm must be changed, too.

The algorithm calculates the VOC and NOx Index signals recursively from a single raw tick value of SRAW_VOC and SRAW_NOX, respectively, which are both measured by the SGP40/41 sensor at each time step, as well as internal states that are updated at each time step. These internal states are most importantly the recursively estimated mean and variance of the corresponding SRAW signal as well as some additional internal states such as uptime and other counters. After estimating the states, the algorithm converts the raw signals in ticks into either VOC or NOx Index, respectively, and applies an adaptive low-pass filter.

Install

pip install sensirion-gas-index-algorithm

Recommended usage is within a virtualenv.

Usage VOC Algorithm

from sensirion_gas_index_algorithm.voc_algorithm import VocAlgorithm

voc_algorithm = VocAlgorithm()
s_voc_raw = 27000  # read out from SGP41
for _ in range(100):
    voc_index = voc_algorithm.process(s_voc_raw)
    print(voc_index)

Usage NOx Algorithm

from sensirion_gas_index_algorithm.nox_algorithm import NoxAlgorithm

nox_algorithm = NoxAlgorithm()
s_nox_raw = 18000  # read out from SGP41
for _ in range(100):
    nox_index = nox_algorithm.process(s_voc_raw)
    print(nox_index)

CHANGELOG

3.2.1

  • Use floating point version of Gas Index Algorithm

3.2.0

  • Add low power examples

  • Allow chaning of sampling interval

3.1.0

  • Add VOC gas index algorithm version 3.1.0

  • Add NOx gas index algorithm version 3.1.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sensirion-gas-index-algorithm-3.2.2.tar.gz (49.4 kB view details)

Uploaded Source

Built Distribution

sensirion_gas_index_algorithm-3.2.2-cp38-cp38-win_amd64.whl (43.0 kB view details)

Uploaded CPython 3.8 Windows x86-64

File details

Details for the file sensirion-gas-index-algorithm-3.2.2.tar.gz.

File metadata

  • Download URL: sensirion-gas-index-algorithm-3.2.2.tar.gz
  • Upload date:
  • Size: 49.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.9.2 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/3.6.9

File hashes

Hashes for sensirion-gas-index-algorithm-3.2.2.tar.gz
Algorithm Hash digest
SHA256 a7c1de5ffef8f2245b35ad3c5a426747bbbfa5b3803534bc27ba88d77dbcaf2e
MD5 f717503f4263f2acc8bf3bfb947bbeb1
BLAKE2b-256 46672469ae7f760281a8ad06b79bb8b1886877c2b40c94b2516a36459d096022

See more details on using hashes here.

File details

Details for the file sensirion_gas_index_algorithm-3.2.2-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: sensirion_gas_index_algorithm-3.2.2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 43.0 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.9.2 requests/2.27.1 setuptools/39.0.1 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/3.6.9

File hashes

Hashes for sensirion_gas_index_algorithm-3.2.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 b26feabb8662366394ae73aee1143e402a6bf756ac664cd0a9aa4eece3c1f01c
MD5 387ecce6c80a621b392b20c83661cd51
BLAKE2b-256 21735deeb0bcc2455064ec7d61fe21ba3fde2b4b57a65c9e62f2d8204e017598

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page