The SparkFun CCS811 Breakout is an advanced sensor board designed to detect Volatile Organic Compounds (VOCs) in the air. Utilizing the CCS811 sensor, this breakout board is capable of providing detailed information about the air quality in an environment. It is commonly used in indoor air quality monitoring systems, smart home automation, and environmental sensing projects.
Pin Number | Pin Name | Description |
---|---|---|
1 | WAKE | Wake pin, active low |
2 | GND | Ground |
3 | SDA | I2C Data |
4 | SCL | I2C Clock |
5 | nINT | Active low interrupt |
6 | RST | Reset pin, active low |
7 | 3V3 | 3.3V power supply input |
8 | ADDR | I2C address selection (floating or GND) |
#include <Wire.h>
#include "SparkFunCCS811.h" // Include the CCS811 library
#define CCS811_ADDR 0x5B // Default I2C Address
CCS811 mySensor(CCS811_ADDR);
void setup() {
Serial.begin(9600);
Wire.begin();
if (mySensor.begin() == false) {
Serial.println("CCS811 sensor not found. Please check wiring.");
while (1);
}
}
void loop() {
// Check if data is available to read
if (mySensor.dataAvailable()) {
mySensor.readAlgorithmResults(); // Read sensor data
Serial.print("CO2: ");
Serial.print(mySensor.getCO2());
Serial.print(" ppm, TVOC: ");
Serial.print(mySensor.getTVOC());
Serial.println(" ppb");
}
delay(500); // Delay between readings
}
Q: Can the CCS811 sensor measure CO2 directly? A: No, the CCS811 sensor measures the total VOC level, which can be used to estimate CO2 levels, but it does not measure CO2 directly.
Q: How long does the sensor last? A: The CCS811 sensor has a typical lifespan of five years when operated within its specified conditions.
Q: Is the sensor sensitive to humidity and temperature? A: Yes, the sensor's readings can be affected by humidity and temperature. It is recommended to use additional sensors to compensate for these factors.
Q: Can I use the sensor with a 5V microcontroller? A: Yes, the sensor can be interfaced with a 5V microcontroller, but ensure that the I2C lines are level-shifted to 3.3V to avoid damaging the sensor.