CCS811 digital gas sensor and Chipkit example

CCS811 is a low-power digital gas sensor solution, which integrates a gas sensor solution for detecting low levels of VOCs typically found indoors, with a microcontroller unit (MCU) and an Analog-to-Digital converter to monitor the local environment and provide an indication of the indoor air quality via an equivalent CO2 or TVOC output over a standard I2C digital interface.

Features

Integrated MCU
On-board processing
Standard digital interface
Optimised low power modes
IAQ threshold alarms
Programmable baseline
2.7mm x 4.0mm LGA package
Low component count
Proven technology platform

Specs

Interface I²C
Supply Voltage [V] 1.8 to 3.6
Power Consumption [mW] 1.2 to 46
Dimension [mm] 2.7 x 4.0 x 1.1 LGA
Ambient Temperature Range [°C] -40 to 85
Ambient Humidity Range [% r.h.] 10 to 95

Parts List

 

Amount Part Type
1 CJMCU-811 CCS811 Air Quality Gas Sensor
1

 

Schematics/Layout

Remember and connect WAKE to gnd

max32 and CCS811

Code

Again we use a library – https://github.com/adafruit/Adafruit_CCS811

And this is the out of the box example

[codesyntax lang=”cpp”]

#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);
}

[/codesyntax]

 

Output

Open the serial monitor – this is what I saw. The higher CO2 level was when I breathed on the sensor

CO2: 400ppm, TVOC: 0ppb Temp:16.95
CO2: 424ppm, TVOC: 3ppb Temp:20.71
CO2: 400ppm, TVOC: 0ppb Temp:22.00
CO2: 427ppm, TVOC: 4ppb Temp:21.48
CO2: 400ppm, TVOC: 0ppb Temp:21.09
CO2: 400ppm, TVOC: 0ppb Temp:19.09
CO2: 445ppm, TVOC: 6ppb Temp:19.58
CO2: 441ppm, TVOC: 6ppb Temp:21.48
CO2: 400ppm, TVOC: 0ppb Temp:22.80
CO2: 400ppm, TVOC: 0ppb Temp:21.48
CO2: 400ppm, TVOC: 0ppb Temp:20.71
CO2: 410ppm, TVOC: 1ppb Temp:16.15
CO2: 420ppm, TVOC: 3ppb Temp:17.30

 

Links

ccs811 datasheet

CJMCU-811 CCS811 Air Quality Gas Sensor

Related posts

Chipkit Max32 and ADXL335 accelerometer example

Chipkit Max32 and LSM303 Accelerometer example

Chipkit Max32 and LSM303 Magnetometer example

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Read More