CCS811 sensor measures Tvoc, as well as eCO2

A, this routine to achieve the function

Measure indoor air quality (IAQ) through CCS811 sensor module, and print the measured Tvoc(unit PPB), eCO2(unit PPM) and Rawdata data to the serial port debugging terminal of the computer.

2. Basic concepts

  • Tvoc: Indoor air quality researchers commonly refer to all the indoor Organic gaseous substances they sample and analyze as TVOC, which stands for the first letter of the three words Volatile Organic Compound, The vocs measured are collectively known as Total Volatile Organic Compounds (TVOC). TVOC is one of the three kinds of pollution affecting indoor air quality. TVOC refers to the organic matter whose saturated vapor pressure exceeds 133.32Pa at room temperature and whose boiling point is between 50℃ and 250℃. It can be evaporated in the air at room temperature. Its toxicity, irritation, carcinogenicity and special odor will affect skin and mucous membrane and cause acute damage to human body. The World Health Organization (WHO), the National Academy of Sciences/National Research Council (NAS/NRC) and other institutions have always emphasized that TVOC is an important air pollutant. The US Environmental Agency (EPA) defines VOC as any carbon containing compound other than carbon monoxide, carbon dioxide, carbonic acid, metal carbide, carbonate, and ammonium carbonate that participates in photochemical reactions in the atmosphere.
  • ECO2: Equivalent carbon dioxide concentration measured by CCS811 sensor.
  • Part per billion (PPb) is a dimensionless concentration in a solution that is expressed in billionths of the mass of the solute to the total mass of the solution. It is also known as the billionth of the concentration (1/10, 1/billion, 10-9). It is often used when the concentration is very small. Similarly, part per million (PPM), PPB =1/1000ppm.

Wiring diagram

Complete code

-- Configure USB to work in virtual serial mode, so that calling print() will print LIB_UsbConfig("CDC") -- Configure CCS811 gas sensor to start working, occupying IIC0 interface, each1LIB_CCS811Config("IIC0"."1S") -- Start the big cyclewhile(GC(1) = =true)
doFlag, tVOC, eCO2, raw_I, raw_u = LIB_CCS811GetResult()if flag == 1Then -- Print Tvoc and eCO2 values and rawData I and u print(string.format("Tvoc:%d, eCO2:%d, i=%d, u=%d", tvoc,eCO2,raw_i,raw_u))
    end
end
Copy the code

Six, code running results

The Tvoc(unit PPB), eCO2(unit PPM) and Rawdata displayed on the serial port debugging terminal of the computer are shown as follows:

Seven, CCS811 official materials need to pay attention to the place

Read more at shineblink.comThe website links