CCS811 Digital Air Quality Sensor

CCS811 is an I2C digital gas sensor for monitoring indoor air quality, which is handled with the CCS811 module.

How to use

I2C1.setup({scl:B6,sda:B7});
var gas = require("CCS811").connectI2C(I2C1);
// wait for the sensor to be ready
setTimeout(function() {
  gas.get(print);
}, 3000);
// prints { "eCO2": 491, "TVOC": 13, "new": true }

Or specify an interrupt pin to have data 'pushed' as soon as it is available:

var gas = require("CCS811").connectI2C(I2C1, {int : B8});
gas.on('data', print);
// prints { "eCO2": 491, "TVOC": 13, "new": true }

Reference

// Shut down the CCS811
CCS811.prototype.stop = function () { ... }

// Returns true if data is available
CCS811.prototype.available = function () { ... }

/* read the current environment settings, assuming available()==true.
   {
     eCO2 : int, // equivalent CO2, in ppm (400..8192)
     TVOC : int, // Total Volatile Organic Compounds, in ppb (0..1187)
     new : bool  // true if this is a new reading
   }
   ec02 and TVOC values are clipped to the given ranges - so for instance you'll never see a CO2 value below 400.
*/
CCS811.prototype.get = function () { ... }

// Initialise the CCS811 module with the given I2C interface
exports.connectI2C = function (i2c, options) { ... }

Buying

CCS811 can be bought on breakout boards from several different sellers:

This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.