The CCS811 is an advanced digital gas sensor designed to measure indoor air quality. It detects levels of carbon dioxide (CO2) and total volatile organic compounds (TVOCs) using a metal oxide (MOX) sensor. The CCS811 communicates via the I2C interface, making it easy to integrate into microcontroller-based systems. Its compact size and low power consumption make it ideal for applications such as:
The CCS811 sensor is equipped with a range of features that make it versatile and reliable for air quality monitoring. Below are its key technical details:
Parameter | Value |
---|---|
Supply Voltage (VDD) | 1.8V to 3.6V |
Interface | I2C |
Operating Current | 1.1mA (typical) |
Idle Current | 20µA |
Measurement Range | CO2: 400–8192 ppm |
TVOC: 0–1187 ppb | |
Operating Temperature | -40°C to +85°C |
Humidity Range | 10% to 95% RH (non-condensing) |
Dimensions | 2.7mm x 4.0mm x 1.1mm |
The CCS811 sensor typically comes in a 10-pin LGA package. Below is the pinout description:
Pin Number | Name | Description |
---|---|---|
1 | VDD | Power supply (1.8V to 3.6V) |
2 | GND | Ground |
3 | SDA | I2C data line |
4 | SCL | I2C clock line |
5 | nWAKE | Wake-up pin (active low) |
6 | RST | Reset pin (active low) |
7 | INT | Interrupt pin (optional, active low) |
8–10 | NC | Not connected (leave floating or grounded) |
Below is an example of how to connect and use the CCS811 with an Arduino UNO:
CCS811 Pin | Arduino UNO Pin |
---|---|
VDD | 3.3V |
GND | GND |
SDA | A4 |
SCL | A5 |
nWAKE | GND |
#include <Wire.h>
#include "Adafruit_CCS811.h"
// Create an instance of the CCS811 sensor
Adafruit_CCS811 ccs;
void setup() {
Serial.begin(9600); // Initialize serial communication
Wire.begin(); // Initialize I2C communication
// Initialize the CCS811 sensor
if (!ccs.begin()) {
Serial.println("Failed to start CCS811 sensor! Check connections.");
while (1);
}
// Wait for the sensor to be ready
while (!ccs.available());
Serial.println("CCS811 sensor initialized successfully.");
}
void loop() {
if (ccs.available()) {
// Read CO2 and TVOC levels
if (!ccs.readData()) {
Serial.print("CO2: ");
Serial.print(ccs.geteCO2()); // Get CO2 in ppm
Serial.print(" ppm, TVOC: ");
Serial.print(ccs.getTVOC()); // Get TVOC in ppb
Serial.println(" ppb");
} else {
Serial.println("Error reading data from CCS811 sensor.");
}
}
delay(1000); // Wait 1 second before the next reading
}
Sensor Not Detected on I2C Bus
Inaccurate Readings
Error Codes from Sensor
High Power Consumption
Q: Can the CCS811 measure outdoor air quality?
A: The CCS811 is optimized for indoor air quality monitoring. Outdoor conditions, such as extreme temperatures and humidity, may affect its accuracy.
Q: How often should I calibrate the sensor?
A: Periodic calibration in a well-ventilated environment is recommended every few weeks for optimal performance.
Q: Can I use the CCS811 with a 5V microcontroller?
A: Yes, but you must use a logic level shifter for the I2C lines, as the CCS811 operates at 3.3V logic levels.
Q: What is the warm-up time for the sensor?
A: The sensor requires approximately 20 minutes to stabilize after power-up for accurate readings.