INTRODUCTION
This short tutorial shows how to build simple CO2 meter using CJMCU-8118 board and Raspberry Pi 3. This board uses CCS811 sensor. This sensor supports intelligent algorithms to process raw sensor measurements to output a TVOC value or equivalent CO2 (eCO2) levels, where the main cause of VOCs is from humans.
CJMCU-8118 includes HDC1080 sensor. There is also list of available alternative boards with CCS811 sensor on the end of this video.
Where to buy:
https://s.click.aliexpress.com/e/_mtY...
https://s.click.aliexpress.com/e/_DmP...
CLASS DESCRIPTION
Class for CJMCU-8118 covers:
retreiving measurement data
drive mode configuration
baseline get/set and manual baseline correction
error codes/IDs
temperature and humidity compensation (extrernal HDC1080 library)
Does not cover:
interrupts and tresholds
optional NTC circuit handling
TROUBLESHOOTING:
Problem: Read ALG_RESULT_DATA bytes values contains random value errors in some bytes (this issue appears mostly in low-power drive modes, mode 2 and 3):
Solution: put to /boot/config.txt this configuration:
dtparam=i2c1_baudrate=10000
*note: this slow down RPi I2C bus and you need to set it back to 100000 if you need to use e.g. LED displays or devices which needs higher speed
Problem: Measured temperature from HDC1080 is higher than expected (up to 3 C)
Cause: gas sensor generates heat and this affects HDC1080 sensor
Solution: switch CCS811 sensor to low-power pulse heating mode (mode 2 or 3) and measure temperature/humidity before the pulse
Problem: My measured eCO2 values are too high!
Solution: AMS advises customers to run CCS811 for 48 hours in the selected mode of operation to ensure sensor performance is stable. Also when a sensor operating mode is changed to a new mode with a lower sample rate (e.g. from Mode 1 to Mode 3), it should be placed in Mode 0 (Idle) for at least 10 minutes before enabling the new mode. Please note that sensor is VERY sensitive to volatile organic compound and this can affect calculated eCO2 concentration accordingly.
Problem: Script does not work for my sensor board
Unfortunately I can not test the code for all of them so I can not support you in this case, sorry.
SOURCES AND LINKS
Source codes (script, class and class for HDC1080 from SwitchDoc Labs):
https://gist.github.com/xxlukas42/60a...
CCS811 datasheet and firmware app:
https://download.ams.com/ENVIRONMENTA...
SwitchDocLabs class for HDC1080:
https://github.com/switchdoclabs/SDL_...
==========
#plukas #raspberrysensors #raspberrypi