CCS811

by brentscheerlinck in Circuits > Arduino

311 Views, 1 Favorites, 0 Comments

CCS811

133192665_Adafruit_CCS811AirQualitySensorBreakoutBoard.png

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

133192665_Adafruit_CCS811AirQualitySensorBreakoutBoard.png
c408d0d27666dea73ec2abac5c8bcb263361d355.jpg
unnamed.jpg
image.jpg
  • 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).

CONNECT THE WIRES

adafruit_products_sensors_CCS811_test_bb.png
adafruit_products_CCS811_Arduino_I2C_STEMMA_bb.jpg

CCS811  Arduino

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

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

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

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

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)

TEST IT OUT

Screenshot 2022-01-27 13.07.35.png
Screenshot 2022-01-27 13.10.03.png
Screenshot 2022-01-27 13.11.23.png
  1. Press the save button
  2. Press upload
  3. Press on monitor and see the results