Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit a94c24a7 authored by Narcisa Ana Maria Vasile's avatar Narcisa Ana Maria Vasile Committed by Jonathan Cameron
Browse files

iio: chemical: ccs811: Add support for AMS CCS811 VOC sensor



Add support for CCS811 VOC sensor. This patch adds support
for reading current and voltage across the sensor and TVOC
and equivalent CO2 values.

Scale and offset values have been computed according to datasheet:
    - For current: raw value is in microamps
        => 0.001 scale to convert to milliamps
    - For voltage: 1.65V = 1023, therefore 1650mV = 1023
        => 1650.0/1023 = 1.612903 scale to convert to millivolts
    - For eCO2: raw value range is from 400ppm to 8192ppm.
        => (val - 400) * (100 - 0) / (8192 - 400) + 0 =
           (val - 400) * 0.01283367 => offset: -400, scale = 0.012834
           to get a percentage value
    -For TVOC: raw value range is from 0ppb to 1187ppb.
        => (val - 0) * 100 / (1187 - 0) + 0 = val * 0.0842459 =>
            scale = 0.084246 for getting a percentage value

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Cc: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: default avatarNarcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 7c6d5c7e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment