Dobrica Pavlinušić's random unstructured stuff
CJMCU-811: Revision 12

CJMCU-811 CCS811 Carbon Monoxide CO VOCs Air Quality Digital Gas Sensor

https://revspace.nl/CJMCU-811

pins

    VCC this is directly connected to the IC (there is no voltage regulator on board), connect this to 3.3V
    GND to ground obviously
    SCL signal from I2C
    SDA signal from I2C
    WAK this needs to be low (!) in order for the chip to be active
    INT can be left unconnected
    RST can be left unconnected
    ADD can be left unconnected. It has a 10k pull-down to GND, setting the I2C address to 0x5A.

firmware upgrade

https://github.com/maarten-pennings/CCS811/tree/master/examples/ccs811flash

dpavlin@nuc:~/Arduino/libraries$ git clone https://github.com/maarten-pennings/CCS811


Wiring for ESP8266 NodeMCU boards: VDD to 3V3, GND to GND, SDA to D2, SCL to D1, nWAKE to D3 (or GND)

Serial output with sensor out of (china) bag:

setup: Starting CCS811 basic demo
setup: ccs811 lib  version: 12
setup: hardware    version: 12
setup: bootloader  version: 1000
setup: application version: 1100
CCS811: waiting for (new) data
CCS811: waiting for (new) data
CCS811: eco2=0 ppm  etvoc=0 ppb  
CCS811: eco2=0 ppm  etvoc=0 ppb  
CCS811: eco2=0 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  

upgrade serial output

Starting CCS811 flasher
setup: library     version: 12
setup: hardware    version: 12
setup: bootloader  version: 1000
setup: application version: 1100
setup: comment-out this code line if you want to flash
loop: ended ...
loop: ended ...
loop: ended ...
loop: ended ...
loop: ended ...
loop: ended ...
loop: ended ...
loop: ended ... 

ccs811: ping ok
ccs811: reset ok
ccs811: status (reset1) 10 ok
ccs811: app-erase ok
ccs811: status (app-erase) 40 ok
ccs811: writing 5120 ................................................................ 4608
ccs811: writing 4608 ................................................................ 4096
ccs811: writing 4096 ................................................................ 3584
ccs811: writing 3584 ................................................................ 3072
ccs811: writing 3072 ................................................................ 2560
ccs811: writing 2560 ................................................................ 2048
ccs811: writing 2048 ................................................................ 1536
ccs811: writing 1536 ................................................................ 1024
ccs811: writing 1024 ................................................................ 512
ccs811: writing 512 ................................................................ 0
ccs811: app-verify ok
ccs811: status (app-verify) 30 ok
ccs811: reset2 ok
ccs811: status (reset2) 10 ok

setup: Starting CCS811 basic demo
setup: ccs811 lib  version: 12
setup: hardware    version: 12
setup: bootloader  version: 1000
setup: application version: 2000
CCS811: waiting for (new) data
CCS811: waiting for (new) data
CCS811: waiting for (new) data
CCS811: waiting for (new) data
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=409 ppm  etvoc=1 ppb  
CCS811: eco2=414 ppm  etvoc=2 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=407 ppm  etvoc=1 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=408 ppm  etvoc=1 ppb  
CCS811: eco2=414 ppm  etvoc=2 ppb  
CCS811: eco2=417 ppm  etvoc=2 ppb  
CCS811: eco2=414 ppm  etvoc=2 ppb  
CCS811: eco2=408 ppm  etvoc=1 ppb  
CCS811: eco2=408 ppm  etvoc=1 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  
CCS811: eco2=406 ppm  etvoc=0 ppb  
CCS811: eco2=400 ppm  etvoc=0 ppb  


Since my sensor is new, I used firmware 2.0.0 to allow initial burn-in compensation.

temperature compensation

https://github.com/sparkfun/SparkFun_CCS811_Arduino_Library/blob/master/examples/Example2_BME280Compensation/Example2_BME280Compensation.ino

esphome

esphome:
  name: ccs811
  friendly_name: ccs811

esp8266:
  board: nodemcuv2

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX="

ota:
  password: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Ccs811 Fallback Hotspot"
    password: "XXXXXXXXXXXX"

captive_portal:

  # Example configuration entry
i2c:
  sda: D2
  scl: D1

sensor:
  - platform: ccs811
    eco2:
      name: "CCS811 eCO2 Value"
    tvoc:
      name: "CCS811 Total Volatile Organic Compound"
    address: 0x5A
    update_interval: 15s

  - platform: bme280
    temperature:
      name: "BME280 Temperature"
      id: bme280_temperature
    pressure:
      name: "BME280 Pressure"
      id: bme280_pressure
    humidity:
      name: "BME280 Relative Humidity"
      id: bme280_humidity
    address: 0x76
    update_interval: 15s