Skip to main content

ccs811

Monitor indoor air quality with eCO2 and TVOC readings from the CCS811 sensor via I2C.

Overview

The ccs811 node reads equivalent CO2 (eCO2) and Total Volatile Organic Compounds (TVOC) from the ams CCS811 digital gas sensor via I2C. This sensor uses a metal oxide (MOX) element to detect a wide range of VOCs and estimate CO2 levels, making it essential for indoor air quality monitoring and ventilation control.

400-8192
eCO2 (ppm)
0-1187
TVOC (ppb)
I2C
Interface
3.3V
Power

Wiring (I2C)

Connection

VCC → 3.3V

GND → GND

SDA → GPIO 2 (Pin 3)

SCL → GPIO 3 (Pin 5)

WAKE → GND (always active)

Address: 0x5A (default) or 0x5B (ADDR→HIGH)

Important Notes

Requires 48-hour burn-in for initial accuracy

20-minute warmup needed after each power cycle

Supply environmental data for better accuracy

Connect WAKE pin to GND to keep sensor active

Properties

Property Type Default Description
bus number 1 I2C bus number
address number 0x5A I2C address (0x5A or 0x5B)
mode string "1s" Measurement interval: "1s", "10s", or "60s"
baseline number Saved baseline for faster calibration on restart
interval number 1000 Output interval in milliseconds

Output

{
  "payload": {
    "eCO2": 650,
    "TVOC": 34
  },
  "eCO2": 650,
  "TVOC": 34,
  "baseline": 41339,
  "timestamp": 1640000000000
}

eCO2 Levels Reference

400-600 ppm

Excellent - Fresh outdoor air

600-1000 ppm

Good - Acceptable indoor levels

1000-2500 ppm

Poor - Ventilation needed

2500+ ppm

Unhealthy - Immediate action

Example: Indoor Air Quality with Alerts

Monitor air quality and send notifications when CO2 levels indicate poor ventilation.

ccs811 function telegram
// Function node: Air quality assessment
var eCO2 = msg.eCO2;
var tvoc = msg.TVOC;

var level, color, action;

if (eCO2 < 600) {
    level = "excellent";
    color = "green";
    action = "none";
} else if (eCO2 < 1000) {
    level = "good";
    color = "yellow";
    action = "none";
} else if (eCO2 < 2500) {
    level = "poor";
    color = "orange";
    action = "open_window";
} else {
    level = "unhealthy";
    color = "red";
    action = "ventilate_now";
}

// Only alert on state changes
var prevLevel = flow.get('aqLevel') || "excellent";
flow.set('aqLevel', level);

msg.payload = {
    eCO2: eCO2,
    tvoc: tvoc,
    level: level,
    action: action,
    changed: level !== prevLevel
};

// Only forward if level changed
if (level !== prevLevel) return msg;
return null;

Use Cases

Ventilation Control

Trigger fans or open vents when CO2 levels rise

Classroom Monitoring

Ensure adequate air quality in occupied rooms

Office Air Quality

Display real-time AQ index on dashboards

Smart Home Health

Combine with temp/humidity for complete comfort score

Related Nodes