Difference between revisions of "CJMCU-811"

From RevSpace
Jump to navigation Jump to search
(baseline saving)
 
(17 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
  |Picture=cjmcu811.jpg
 
  |Picture=cjmcu811.jpg
 
  |Omschrijving=Playing around with a breakout board for the CSS-811 IC
 
  |Omschrijving=Playing around with a breakout board for the CSS-811 IC
  |Status=Initializing
+
  |Status=Completed
 
  |Contact=bertrik
 
  |Contact=bertrik
 
}}
 
}}
  
 
== Introduction ==
 
== Introduction ==
I bought this board from Aliexpress, it's a breakout board for [https://ams.com/ccs811 the AMS CCS-811].
+
I bought  
 +
[https://www.aliexpress.com/item/cjmcu811/32806054180.html this board]
 +
from Aliexpress, it's a breakout board for [https://ams.com/ccs811 the AMS CCS-811].
 
The CCS-811 is an ultra-low power digital gas sensor for monitoring indoor air quality.
 
The CCS-811 is an ultra-low power digital gas sensor for monitoring indoor air quality.
  
Line 16: Line 18:
 
The datasheet can be found [https://ams.com/ccs811#tab/documents here].
 
The datasheet can be found [https://ams.com/ccs811#tab/documents here].
  
It is unclear what it measures exactly.
+
It measures volatile organic compounds, but it is a bit unclear what it measures exactly.
 
It appears to be sensitive to temperature and humidity levels too, although the chip provides a way to let it know the humidity and temperature so it can compensate for it.
 
It appears to be sensitive to temperature and humidity levels too, although the chip provides a way to let it know the humidity and temperature so it can compensate for it.
  
[https://keetweej.vanheusden.com/grafana/d/uL--TeUiz/ccs811 Grafana page]
+
* [https://keetweej.vanheusden.com/grafana/d/uL--TeUiz/ccs811 private Grafana page]
 +
* [https://keetweej.vanheusden.com/grafana/dashboard/snapshot/fv8xpNqHkFyXI5CfBS7oNquoNKdfXxu3 public Grafana snapshot]
 +
 
 +
== Sensitivity to organic solvents ==
 +
 
 +
Very roughly from experimentation (and memory):
 +
* Alklanet (contains 2-butoxyethanol), very sensitive to this stuff, we use it everywhere in the space to clean working surfaces
 +
* permanent marker: very sensitive to it
 +
* toluene: very sensitive
 +
* acetone: very sensitive
 +
* butanol: sensitive
 +
* butylacetate: sensitive
 +
* butane, it is detected but not impressively so
 +
* chloroform, almost no response!
 +
* dichloro-methane: insensitive
 +
* acetaldehyde: not very sensitive to it
  
 
== Hardware ==
 
== Hardware ==
Line 54: Line 71:
  
 
== Application to air quality monitoring at RevSpace ==
 
== Application to air quality monitoring at RevSpace ==
A sensor like this could be used to monitor indoor air quality at Revspace.
+
The sensor is currently present in the RevSpace main room.
 +
 
 +
It has temperature/humidity compensation using a BME280.
 +
 
 +
Values are available on the RevSpace MQTT on the following topics:
 +
* revspace/sensors/tvoc/F091A0/status can be "online" or "offline"
 +
* revspace/sensors/tvoc/F091A0/ccs811/tvoc is the TVOC concentration in ppm
 +
* revspace/sensors/tvoc/F091A0/ccs811/eco2 is the "equivalent CO2" concentration in ppm
 +
* revspace/sensors/tvoc/F091A0/bme280/temperature is the temperature inside the case in degrees Celcius
 +
* revspace/sensors/tvoc/F091A0/bme280/humidity is the relative humidity inside the case in percent
 +
 
 +
There is no LED display.
  
 
=== pinout ===
 
=== pinout ===
 
See https://github.com/bertrik/tvocmeter
 
See https://github.com/bertrik/tvocmeter
* pin D1 goes to CCS811 SCL
+
* pin D3 goes to WS2812 VDC
* pin D2 goes to CCS811 SDA
+
* pin D4 goes to WS2812 DIN
* pin D3 goes to CCS811 WAK
+
* pin GND goes to WS2812 GND
* pin D8 goes to CCS811 GND, we use a data pin as ground because the D1 mini has only one ground pin
+
* pin D5 goes to CCS811 WAK
* pin D4 goes to Neopixel DIN
+
* pin D6 goes to CCS811 SDA
* pin 5V goes to Neopixel VDC
+
* pin D7 goes to CCS811 SCL
* pin GND goes to Neopixel GND
+
* <s>pin D8</s> GND goes to CCS811 GND <s>we use a data pin as ground because the D1 mini has only one ground pin</s>
 +
* pin 3V3 goes to CCS811 VCC
  
 
=== temperature and humidity correction ===
 
=== temperature and humidity correction ===
A BME280 could be used to read ambient temperature and humidity.
+
A BME280 is used to read ambient temperature and humidity.
 
The microcontroller inside the CCS811 can use this information to improve the reading.
 
The microcontroller inside the CCS811 can use this information to improve the reading.
  
=== Neopixel display ===
+
It can be connected on the same I2C bus, but the software has to toggle the CCS811 WAK pin.
The idea is that it shows the TVOC concentration on a bar of 8 LEDs using a kind of logarithmic scale, one LED for each of the following levels: 25, 50, 100, 200, 400, 800, 1600, 3200 ppb
+
The CCS811 doesn't play nice with other I2C devices on the same bus (perhaps this is caused by the clock stretching requirement).
Unfortunately, I can't get the neopixel strip to work yet.
+
 
 +
=== WS2812 LED bar display ===
 +
A RGB LED bargraph shows the current TVOC concentration, using a WS2812 RGB LED stick.
 +
On a logarithmic scale of 8 pixels, LEDs light for each of the following levels: 62, 125, 250, 500, 1000, 2000, 4000, 8000 ppb
  
 
Also, I don't know what a specific TVOC concentration means, e.g. what level is considered as clean air?
 
Also, I don't know what a specific TVOC concentration means, e.g. what level is considered as clean air?
 +
 +
The air at RevSpace appears to default to a quite high value of approximately 500-1000, probably because of Alklanet vapours.
  
 
=== baseline saving ===
 
=== baseline saving ===
Line 80: Line 114:
 
The state of this is kept in a baseline register.
 
The state of this is kept in a baseline register.
  
We could periodically read this register and save it in flash/EEPROM (say once an hour).
+
We periodically read this register and save it in flash/EEPROM (once an hour).
 
Upon startup, the baseline register is restored from the saved value.
 
Upon startup, the baseline register is restored from the saved value.
  

Latest revision as of 08:09, 29 July 2019

Project CJMCU-811
Cjmcu811.jpg
Playing around with a breakout board for the CSS-811 IC
Status Completed
Contact bertrik
Last Update 2019-07-29

Introduction

I bought this board from Aliexpress, it's a breakout board for the AMS CCS-811. The CCS-811 is an ultra-low power digital gas sensor for monitoring indoor air quality.

It appears what they accomplished is integration of a metal-oxide gas sensor into a tiny package so it uses very little power and has a fast response. For example, the well-known MQ-135 typically uses 750 mW just for heating the sensitive MOX layer.

The datasheet can be found here.

It measures volatile organic compounds, but it is a bit unclear what it measures exactly. It appears to be sensitive to temperature and humidity levels too, although the chip provides a way to let it know the humidity and temperature so it can compensate for it.

Sensitivity to organic solvents

Very roughly from experimentation (and memory):

  • Alklanet (contains 2-butoxyethanol), very sensitive to this stuff, we use it everywhere in the space to clean working surfaces
  • permanent marker: very sensitive to it
  • toluene: very sensitive
  • acetone: very sensitive
  • butanol: sensitive
  • butylacetate: sensitive
  • butane, it is detected but not impressively so
  • chloroform, almost no response!
  • dichloro-methane: insensitive
  • acetaldehyde: not very sensitive to it

Hardware

Pins on the breakout board:

  • 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.

I'm wiring it up to a Wemos D1 mini board with an ESP8266.

Firmware update

There is a firmware update available for the microcontroller inside the CCS811. My board shipped with the V1.1 version. I flashed it to the V2.0 version with this firmware updater by Maarten Pennings.

The newer 2.0 firmware fixes the upper range of eTVOC. In the older version, the maximum reported concentration was 1156 bpm, this limit is no longer present with the 2.0 firmware.

Software

I found the following libraries (in order of preference, top one most likely to use):

Interesting projects using it together with a BME280:

Application to air quality monitoring at RevSpace

The sensor is currently present in the RevSpace main room.

It has temperature/humidity compensation using a BME280.

Values are available on the RevSpace MQTT on the following topics:

  • revspace/sensors/tvoc/F091A0/status can be "online" or "offline"
  • revspace/sensors/tvoc/F091A0/ccs811/tvoc is the TVOC concentration in ppm
  • revspace/sensors/tvoc/F091A0/ccs811/eco2 is the "equivalent CO2" concentration in ppm
  • revspace/sensors/tvoc/F091A0/bme280/temperature is the temperature inside the case in degrees Celcius
  • revspace/sensors/tvoc/F091A0/bme280/humidity is the relative humidity inside the case in percent

There is no LED display.

pinout

See https://github.com/bertrik/tvocmeter

  • pin D3 goes to WS2812 VDC
  • pin D4 goes to WS2812 DIN
  • pin GND goes to WS2812 GND
  • pin D5 goes to CCS811 WAK
  • pin D6 goes to CCS811 SDA
  • pin D7 goes to CCS811 SCL
  • pin D8 GND goes to CCS811 GND we use a data pin as ground because the D1 mini has only one ground pin
  • pin 3V3 goes to CCS811 VCC

temperature and humidity correction

A BME280 is used to read ambient temperature and humidity. The microcontroller inside the CCS811 can use this information to improve the reading.

It can be connected on the same I2C bus, but the software has to toggle the CCS811 WAK pin. The CCS811 doesn't play nice with other I2C devices on the same bus (perhaps this is caused by the clock stretching requirement).

WS2812 LED bar display

A RGB LED bargraph shows the current TVOC concentration, using a WS2812 RGB LED stick. On a logarithmic scale of 8 pixels, LEDs light for each of the following levels: 62, 125, 250, 500, 1000, 2000, 4000, 8000 ppb

Also, I don't know what a specific TVOC concentration means, e.g. what level is considered as clean air?

The air at RevSpace appears to default to a quite high value of approximately 500-1000, probably because of Alklanet vapours.

baseline saving

The microcontroller inside the CCS811 keeps track of the properties of the particular sensor and the environment it is in. The state of this is kept in a baseline register.

We periodically read this register and save it in flash/EEPROM (once an hour). Upon startup, the baseline register is restored from the saved value.

Saving and restoring the register is described in AMS Application Note AN000370.

Reading and writing the baseline register is supported by the Sparkfun library.

further reading