Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use Adafruit CCS811: Examples, Pinouts, and Specs

Image of Adafruit CCS811Design with Adafruit CCS811 in Cirkit Designer

Introduction

The Adafruit CCS811 is an advanced gas sensor designed to detect a wide range of Volatile Organic Compounds (VOCs) and equivalent carbon dioxide (eCO2) levels. This sensor is ideal for monitoring indoor air quality in various environments such as homes, offices, and industrial spaces. The CCS811 is a digital sensor that communicates over an I2C interface, making it easy to integrate with microcontrollers like the Arduino UNO.

Explore Projects Built with Adafruit CCS811

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Smart Weighing System with ESP8266 and HX711 - Battery Powered and Wi-Fi Enabled: A project utilizing Adafruit CCS811 in a practical application
Smart Weighing System with ESP8266 and HX711 - Battery Powered and Wi-Fi Enabled

This circuit is a multi-sensor data acquisition system powered by a 18650 battery and managed by an ESP8266 microcontroller. It includes a load sensor interfaced with an HX711 module for weight measurement, an IR sensor, an ADXL345 accelerometer, a VL53L0X distance sensor, and a Neo 6M GPS module for location tracking. The system is designed for wireless data transmission and is supported by a TP4056 module for battery charging.

Open Project in Cirkit Designer
Image of ESP32-Controlled Smart Lighting System with Power Monitoring: A project utilizing Adafruit CCS811 in a practical application
ESP32-Controlled Smart Lighting System with Power Monitoring

This circuit appears to be a multi-channel current monitoring system using several ACS712 current sensors to measure the current through different loads, likely bulbs connected to a 220V power source. The current readings from the sensors are digitized by an Adafruit ADS1115 16-bit ADC, which interfaces with an ESP32 microcontroller via I2C communication for further processing or telemetry. A buck converter is used to step down the voltage to power the ESP32 and the sensors, and the system is powered through a 2.1mm DC barrel jack, indicating it is designed for external power supply.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Number Pin Name Description
1 VDD Supply Voltage (3.3V to 5V)
2 GND Ground
3 SDA I2C Data
4 SCL I2C Clock
5 WAKE Wake Pin (active low)
6 INT Interrupt Pin
7 RST Reset Pin (active low)
8 ADDR I2C Address Select (float or connect to GND)

Usage Instructions

Integrating with a Circuit

  1. Powering the Sensor: Connect the VDD pin to a 3.3V or 5V power supply and the GND pin to the ground.
  2. I2C Communication: Connect the SDA and SCL pins to the corresponding SDA and SCL pins on your microcontroller.
  3. Wake Pin: The WAKE pin can be connected to ground to keep the sensor awake.
  4. Interrupt and Reset: The INT and RST pins can be left unconnected if not used. If using the interrupt feature, connect the INT pin to an interrupt-capable GPIO on your microcontroller. The RST pin can be connected to a GPIO for software reset functionality.

Important Considerations and Best Practices

Example Code for Arduino UNO

#include <Wire.h>
#include <Adafruit_CCS811.h>

Adafruit_CCS811 ccs;

void setup() {
  Serial.begin(9600);
  Wire.begin();

  // Initialize the sensor
  if (!ccs.begin()) {
    Serial.println("Failed to start sensor! Please check your wiring.");
    while (1);
  }

  // Wait for the sensor to be ready
  while (!ccs.available());
}

void loop() {
  // Read sensor data when available
  if (ccs.available()) {
    if (!ccs.readData()) {
      Serial.print("CO2: ");
      Serial.print(ccs.geteCO2());
      Serial.print("ppm, TVOC: ");
      Serial.print(ccs.getTVOC());
      Serial.println("ppb");
    } else {
      Serial.println("ERROR!");
      // If reading the sensor data failed, print an error message
    }
  }
  delay(500); // Wait for 500 ms before reading again
}

Troubleshooting and FAQs

Common Issues

Solutions and Tips for Troubleshooting

FAQs

Q: Can the CCS811 sensor measure CO2 directly? A: No, the CCS811 measures eCO2 levels, which are calculated based on detected VOCs and not a direct measurement of CO2.

Q: How long does the sensor need to preheat? A: The sensor should preheat for at least 20 minutes upon first use or after a prolonged period of inactivity.

Q: Is the sensor compatible with 5V logic? A: The sensor can be powered by 5V, but the logic level for I2C communication is 3.3V. Use level shifters if necessary.

Q: Can I use multiple CCS811 sensors on the same I2C bus? A: Yes, but you will need to set different I2C addresses using the ADDR pin for each sensor.