The SparkFun Environmental Combo Breakout is a comprehensive sensor module that integrates two powerful sensors: the CCS811 and the BME280. This combination allows for the measurement of a wide range of environmental parameters, making it an ideal choice for monitoring indoor air quality and weather conditions. The CCS811 sensor is capable of detecting volatile organic compounds (VOCs) and equivalent CO2 (eCO2) levels, while the BME280 sensor provides accurate readings of temperature, humidity, and barometric pressure. This breakout is designed for easy integration into projects with its Qwiic connect system, eliminating the need for soldering.
Common applications for this sensor include:
Pin Number | Function | Description |
---|---|---|
1 | GND | Ground |
2 | 3V3 | 3.3V power supply |
3 | SDA | I2C data line |
4 | SCL | I2C clock line |
5 | INT | Interrupt pin |
6 | WAKE | Wake pin for CCS811 |
7 | RST | Reset pin |
8 | ADD | I2C address selection (pull to GND for alt.) |
To use the SparkFun Environmental Combo Breakout with an Arduino UNO, follow these steps:
#include <Wire.h>
#include <SparkFunBME280.h>
#include <SparkFunCCS811.h>
#define CCS811_ADDR 0x5B // Default I2C Address
#define BME280_ADDR 0x77 // Default I2C Address
// Create sensor instances
BME280 myBME280;
CCS811 myCCS811(CCS811_ADDR);
void setup() {
Serial.begin(9600);
Wire.begin();
// Initialize the BME280 sensor
if (myBME280.beginI2C(BME280_ADDR) == false) {
Serial.println("BME280 sensor not detected. Please check wiring.");
while (1);
}
// Initialize the CCS811 sensor
if (myCCS811.begin() == false) {
Serial.println("CCS811 sensor not detected. Please check wiring.");
while (1);
}
}
void loop() {
// Check if data is available to read
if (myCCS811.dataAvailable()) {
myCCS811.readAlgorithmResults(); // Read sensor data
Serial.print("CO2: ");
Serial.print(myCCS811.getCO2());
Serial.print(" ppm, TVOC: ");
Serial.print(myCCS811.getTVOC());
Serial.println(" ppb");
}
// Read BME280 data
Serial.print("Temperature: ");
Serial.print(myBME280.readTempC());
Serial.print(" °C, Humidity: ");
Serial.print(myBME280.readFloatHumidity());
Serial.print(" %, Pressure: ");
Serial.print(myBME280.readFloatPressure() / 100.0F);
Serial.println(" hPa");
delay(2000); // Wait for 2 seconds before reading again
}
Q: Can the sensor be used with a 5V system? A: No, the sensor operates at 3.3V. Using it with a 5V system without proper level shifting could damage the sensor.
Q: How do I change the I2C address of the sensor? A: The I2C address can be changed by connecting the ADD pin to GND. This will switch the address to an alternative setting.
Q: What is the maximum I2C bus speed for this sensor? A: The maximum I2C bus speed for the CCS811/BME280 combo is 400kHz (Fast Mode).