ESP32 CCS811 Digital Gas Sensor

CCS811 Digital Gas Sensor image

AIRQUALITY I2C

CCS811

Protocol: I2C

Overview

The CCS811 is a digital gas sensor for monitoring indoor air quality. It measures levels of Total Volatile Organic Compounds (TVOCs) and equivalent CO₂ (eCO₂), providing valuable data for applications like air purifiers, HVAC systems, and smart home devices. Operating over an I²C interface, it simplifies integration into various projects.

About CCS811 Digital Gas Sensor

The CCS811 is an ultra-low power digital gas sensor designed for indoor air quality monitoring. It detects volatile organic compounds (VOCs) and provides equivalent CO₂ (eCO₂) levels, making it useful for smart home automation, HVAC systems, and environmental monitoring.

Key Features #

  • VOC & eCO₂ Detection – Monitors air quality and pollution levels.

  • Integrated MCU & ADC – Simplifies processing and reduces external component requirements.

  • Ultra-Low Power Consumption – Ideal for battery-powered applications.

  • I²C Interface – Seamlessly integrates with ESP32, Arduino, and other microcontrollers.

Technical Specifications

Operating Voltage 3.3V to 5V DC
Current Consumption 0.7µA (sleep mode), 1.2mA (active mode)
Measurement Range 400 to 8192 ppm (eCO₂), 0 to 1187 ppb (TVOC)
Interface I²C
Operating Temperature -5°C to 50°C
Operating Humidity 10% to 95% RH
Dimensions 2.7mm x 4.0mm x 1.1mm

Where to Buy

CCS811 Digital Gas Sensor

Starting from

12$ per piece

Amazon com
Amazon.com Ships worldwide
View Price
Amazon de
Amazon.de Ships to EU
View Price
Aliexpress
AliExpress Best value
View Price

Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.

Pinout Configuration

The VCC pin is used to supply power to the sensor, and it typically requires 3.3V or 5V (refer to the datasheet for specific voltage requirements). The GND pin is the ground connection and must be connected to the ground of your ESP32.

The CCS811 pinout is as follows:

  • VDD: Supply voltage (3.3V to 5V).
  • GND: Ground connection.
  • SDA: I²C data line.
  • SCL: I²C clock line.
  • nWAKE: Wake pin (active low; connect to GND to enable communication).
  • nINT: Interrupt pin (optional; indicates data ready).
  • nRESET: Reset pin (active low; optional).
  • ADDR: I²C address select (connect to GND for 0x5A or VDD for 0x5B).

Wiring with ESP32

To interface the CCS811 with a microcontroller like an Arduino or ESP32, connect VDD to a 3.3V or 5V power source, GND to ground, SDA to the microcontroller's SDA pin, and SCL to the microcontroller's SCL pin. Connect nWAKE to GND to enable communication. The I²C address can be set by connecting ADDR to GND (0x5A) or VDD (0x5B). Ensure that the I²C communication parameters are correctly configured in your code.

Troubleshooting Guide

Common Issues

🔄 Intermittent Sensor Hang-ups on ESP8266

❌ Initialization Failure on ESP8266

⚠️ Remote I/O Error on ESP32

❓ Reading Error Code 2 on Particle Devices

Debugging Tips

🔍 Serial Monitor

⚡ Voltage Checks

Code Examples

Arduino Example

C++
🔧

ESP-IDF Example

C++
🏠

ESPHome Example

YAML
🛠️

PlatformIO Example

C++
🐍

MicroPython Example

Python

Conclusion

The ESP32 CCS811 Digital Gas Sensor is a powerful airQuality sensor that offers excellent performance and reliability. With support for multiple development platforms including Arduino, ESP-IDF, ESPHome, PlatformIO, and MicroPython, it's a versatile choice for your IoT projects.

For optimal performance, ensure proper wiring and follow the recommended configuration for your chosen development platform.

Always verify power supply requirements and pin connections before powering up your project to avoid potential damage.