The CCS811 sensor from ams is used to measure indoor air quality. It can sense CO2 and TVOC. This simple project uses the CCS811 sensor breakout board from Joy-it and the Arduino Uno to light an LED when the CO2 and TVOC levels surpass a certain configurable threshold. This signals that the room should be aerated.
Install the Adafruit CCS811 Library from the Arduino IDE Library Manager.
Open the ccs811-voc/ccs811-voc.ino file in the Arduino IDE and upload sketch.
arduino-cli core install arduino:avr
arduino-cli compile --fqbn arduino:avr:uno ccs811-voc/ccs811-voc
arduino-cli upload -p /dev/ttyUSB0 --fqbn arduino:avr:uno ccs811-voc
Replace /dev/ttyUSB0 with whatever port your Arduino Uno is connected to.
If you get USB permission error in the Arduino IDE when uploading the sketch under Linux, try the following:
sudo usermod -a -G dialout $USER
sudo chmod a+rw /dev/ttyUSB0
- CCS811 sensor on Joy-it breakout board
- Arduino Uno
- Led
- Cables
MIT License