Introduction: CCS811

The CCS811 module is a digital gas sensor with metal oxide (MOX) gas sensor to measure "Volatile Organic Compounds" (VOCs) from the air.

This sensor is intended for indoor use in combination with a microcontroller through an I2C interface. The sensor can also measure "equivalent CO2" (eCO2).


Supplies

  • 3 jumper wires.
  • Arduino-board UNO.
  • USB for Arduino.
  • CCS811 sensor.
  • Computer or laptop.
  • Arduino Editor to import the code (https://create.arduino.cc/editor).

Step 1: CONNECT THE WIRES

CCS811  Arduino

VIN ================================ ⇒ VIN

GND================================ ⇒ GND

SCL================================ ⇒ SCL

SDA================================ ⇒ SDA

Step 2: PROGRAMMING

# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries

# SPDX-License-Identifier: MIT


import time

import board

import adafruit_ccs811


i2c = board.I2C() # uses board.SCL and board.SDA

ccs811 = adafruit_ccs811.CCS811(i2c)


# Wait for the sensor to be ready

while not ccs811.data_ready:

pass


while True:

print("CO2: {} PPM, TVOC: {} PPB".format(ccs811.eco2, ccs811.tvoc))

time.sleep(0.5)

Step 3: TEST IT OUT

  1. Press the save button
  2. Press upload
  3. Press on monitor and see the results