KS0457 keyestudio CCS811 Carbon Dioxide Temperature Air Quality Sensor

From Keyestudio Wiki
Jump to: navigation, search


Keyestudio CCS811 Carbon Dioxide/ Temperature Air Quality Sensor (Black and Eco-friendly)



Description

Keyestudio CCS811 carbon dioxide, temperature air quality sensor mainly uses the CCS811B chip. It is an ultra-low-power miniature digital gas sensor that can detect a wide range of volatile organic compounds (TVOCs), including equivalent carbon dioxide (eCO2) and metal oxide (MOX) levels.
Equivalent carbon dioxide (eCO2) is measured in the range of 400 to 8192 ppm (parts per million), and various volatile organic compounds (TVOC) ranges from 0 to 1187 ppb (parts per billion).
At the same time, the sensor comes with a 10K precision 1% NTC thermistor, which can be used to test the specific temperature in the environment. In order to fix to other devices, the sensor comes with a positioning hole with a diameter of 3mm.


Technical Parameters

  • Working voltage: DC 5V
  • Working current: 30mA
  • Maximum power: 46mW
  • eCO2 measurement range: 400-8192 ppm
  • TVOC measurement range: 0 to 1187 ppb
  • Working temperature: -25 ~ +65℃
  • Interface: 7pin (2.54mm pitch)
  • Positioning hole diameter: 3mm
  • Dimensions: 36mm*20mm*7mm
  • Environmental attributes: ROHS


PINOUTS


thumb



Connection


thumb


Test Code

NOTE:
1)Before upload the code, should place the necessary library into the libraries folder of Arduino IDE;


thumb

2)The code is tested by Arduino IDE 1.8.7 version. Other version may not compatible.

#include "Adafruit_CCS811.h"
Adafruit_CCS811 ccs;

void setup() {
  Serial.begin(9600);
  Serial.println("CCS811 test");
  
  if(!ccs.begin()){
    Serial.println("Failed to start sensor! Please check your wiring.");
    while(1);
  }
  //calibrate temperature sensor
  while(!ccs.available());
  float temp = ccs.calculateTemperature();
  ccs.setTempOffset(temp - 25.0);
}

void loop() {
  if(ccs.available()){
    float temp = ccs.calculateTemperature();
    if(!ccs.readData()){
      Serial.print("CO2: ");
      Serial.print(ccs.geteCO2());
      Serial.print("ppm, TVOC: ");
      Serial.print(ccs.getTVOC());
      Serial.print("ppb   Temp:");
      Serial.println(temp);
    }
    else{
      Serial.println("ERROR!");
      while(1);
    }
  }
  delay(500);
}


Test Result


thumb

Done uploading the code, open the serial monitor and set the baud rate to 9600. You will see the monitor window show the data as below.
thumb



Resource

  • Download all the relevant info from the link:

https://drive.google.com/open?id=1rKBkaN3RpuUP24UWuM1guAe2bhhT6pA9



Buy from

  • [ Official Website]
  • [ Shop on Aliexpress ]