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.
Wiring (I2C)
Connection
VCC → 3.3V
GND → GND
SDA → GPIO 2 (Pin 3)
SCL → GPIO 3 (Pin 5)
WAKE → GND (always active)
Important Notes
Requires 48-hour burn-in for initial accuracy
20-minute warmup needed after each power cycle
Supply environmental data for better accuracy
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.
// 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