Detecting Gas and Air Quality with the CCS811

The CCS811 is a digital gas sensor built around a heated metal-oxide (MOX) sensing element: a tiny plate is warmed to a few hundred degrees Celsius, and its electrical resistance shifts as volatile organic compounds (VOCs) in the surrounding air react with its surface. An onboard co-processor inside the CCS811 package reads that raw resistance, runs it through ams's proprietary algorithm, and outputs two numbers over I²C: total VOC (TVOC, 0–1187 ppb) and equivalent CO2 (eCO2, 400–8192 ppm). The word "equivalent" is doing real work in that second number — the CCS811 has no dedicated CO2-sensing element and never measures carbon dioxide molecules directly. It infers eCO2 from the same VOC signal that produces TVOC, using a correlation that holds reasonably well for typical indoor air (breath, off-gassing from materials, cooking) but is not a substitute for a sensor that actually detects CO2. Because the MOX element is commonly paired with a temperature/humidity sensor for compensation — the CCS811 has a register for exactly that — it shows up in DIY indoor-air-quality monitors, smart vent controllers, and classroom CO2-awareness projects far more often than in equipment where a certified CO2 number is required.

What does the CCS811 actually measure?

Output Range Interface What it actually senses
eCO2 (equivalent CO2) 400–8192 ppm I²C Derived from VOC resistance, not a direct CO2 reading
TVOC (total VOCs) 0–1187 ppb I²C Directly related to the MOX element's resistance change

Physically, there is one sensing element on the die: a micro-hotplate coated in a metal-oxide film, heated by an internal element so that VOC molecules in the air oxidize on contact with its surface and change its conductivity. The chip's built-in application-specific microcontroller samples that resistance, applies ams's algorithm, and exposes TVOC as its most direct output and eCO2 as a value calculated from the same underlying signal. Both numbers come off the same I²C transaction (default address 0x5A, alternate 0x5B if the ADDR pin is pulled high), read with a library such as Adafruit's Adafruit_CCS811 or SparkFun's SparkFun_CCS811 Arduino library.

eCO2 vs true CO2: what's the difference and why does it matter?

A true CO2 sensor, such as an NDIR (non-dispersive infrared) module like the MH-Z19, shines infrared light through a gas sample and measures how much of a specific wavelength CO2 molecules absorb — a direct physical measurement of CO2 concentration. The CCS811 does none of that. Its eCO2 output is a curve fit against TVOC, built on the observation that human-occupied indoor spaces tend to produce both VOCs (from breath, skin, and off-gassing) and CO2 (from breath) together, so a rise in one correlates loosely with a rise in the other. That correlation is real but indirect: a room full of VOCs from a can of paint or a cleaning product, with no additional people breathing, will spike the CCS811's eCO2 reading even though actual CO2 in the room hasn't moved much. Use the CCS811 when the goal is a general indoor-air-quality signal (open a window, run a fan, flag "stuffy air") and it's a well-suited, inexpensive, digital part. Use an NDIR sensor like the MH-Z19 instead when a project genuinely needs a trustworthy CO2 ppm number — for calibrating ventilation to occupancy, for research, or for anything where "equivalent" isn't good enough.

How do you wire the CCS811 to an Arduino Uno?

Arduino Uno pin CCS811 pin Signal
5V VCC Power
GND GND Ground
GND WAK Wake (active low — must be grounded for I²C to respond)
A4 SDA I²C data
A5 SCL I²C clock

Five connections cover a working build. The one most people miss: the CCS811's WAK pin is active-low and must be tied to ground for the chip to answer on the I²C bus at all — leave it floating or pull it high and the sensor stays silent, which is a common reason a first attempt reads all zeros. Two more pins exist on most breakout boards and are optional for a basic read loop: INT can be wired to a digital pin for interrupt-driven reads instead of polling, and nRESET can be wired to a digital pin for a software-controlled reset, but both can be left unconnected on a simple serial-monitor build. Most CCS811 breakouts include a regulator and level-shifting that make the 5V VCC and 5V-logic I²C lines from an Uno safe to use directly, but the bare die itself is a 3.3V part — if working from a breakout with no onboard regulation, check its markings before assuming 5V is safe.

Does the CCS811 need a warm-up or burn-in period?

Yes, and skipping it is the most common reason CCS811 readings look wrong. A brand-new sensor needs a 48-hour burn-in the first time it's powered, during which its baseline resistance stabilizes as the heated element cures. After that initial burn-in, every subsequent power-on needs roughly a 20-minute warm-up before readings settle to stable, trustworthy values — the first numbers off the serial monitor after power-up will typically show a fixed 400 ppm eCO2 and near-zero TVOC while the element heats up, then start moving. For a project that stays powered continuously, this is a one-time cost. For a battery-powered or frequently power-cycled build, the 20-minute warm-up on every restart is a real design constraint worth planning around, and it's part of why the CCS811 also exposes a baseline register: saving and restoring that baseline periodically (roughly every 24–48 hours of continuous operation, per the datasheet's application guidance) helps the sensor recover its calibration faster after a power cycle than starting from a completely fresh baseline every time.

Watch it built live

We typed this into Compoden's storefront assistant, Soldr, exactly as a customer would:

"I want to measure indoor air quality (CO2 and VOCs) using a CCS811 sensor with an Arduino Uno"

Compoden storefront AI assistant Soldr responding to a CCS811 gas sensor request with an Arduino Uno, showing the MQ-135 substituted into the parts tray

Soldr does not carry a CCS811 module and said so by substitution rather than by name: it carded the MQ-135 Air Quality Gas Sensor Module into the sensor slot instead, describing it as designed "to detect various gases related to air quality, including ammonia (NH3), benzene, smoke, CO2, and alcohol," connecting "using an analog interface, which means it provides a continuously varying electrical signal that the microcontroller can read," and noting that "you will need to calibrate it… before its measurements are accurate." We followed up in the same session to confirm rather than guess: "I specifically need the CCS811 model, not the MQ-135 — do you have that exact I2C sensor in stock?" Soldr's reply didn't name a CCS811 at all; it offered an unrelated HTU21D temperature/humidity module, then twice noted it had kept the existing build unchanged because — in its own words — "the part you asked for isn't a fit for this setup." A direct product search of Compoden's catalog for "CCS811" independently confirms the same thing: zero matching listings. In plain terms, Compoden does not currently stock a CCS811 module. The MQ-135 is a real, different sensor technology — an analog resistive gas sensor that needs manual calibration and reports a general air-quality signal, not a digital I²C eCO2/TVOC pair — and it is not a like-for-like substitute for the CCS811's specific outputs.

Watch the firmware get generated

We then asked Compoden's code assistant, Soldr's PWA build companion, to write real CCS811 firmware, independent of what the storefront had in stock:

"I'm using a CCS811 gas sensor over I2C with an Arduino Uno to measure eCO2 and TVOC. Write the full firmware to read and print both values to the serial monitor."

Soldr PWA firmware editor screenshot showing generated Arduino Uno code for a CCS811 eCO2 and TVOC gas sensor using the Adafruit CCS811 library

The build log carded its own substitute into the parts list — an MQ-6 LPG Gas Sensor Module in the "Gas Sensor" slot, a different substitution than the storefront's MQ-135 — but the generated source code ignored that substitution and targeted the real chip named in the prompt. The sketch includes #include <Wire.h> and #include <Adafruit_CCS811.h>, with wiring comments matching the CCS811's actual pinout: Arduino Uno A4 (SDA) -> CCS811 SDA, A5 (SCL) -> CCS811 SCL, 5V -> CCS811 VCC, GND -> CCS811 GND, plus optional lines for the WAK, INT, and nRESET pins covered in the wiring section above. Its instructions above the code panel read: "Upload this sketch to your Arduino Uno. Install via Library Manager: Adafruit CCS811, MQUnifiedsensor." The build log also flagged an honest caveat mid-generation: "Heads up — this sketch does not compile yet. I tried an automatic fix and a documentation lookup, and it still fails. Tell me the board you're targeting and I'll retarget it." Treat the generated source as a real, correctly-targeted starting point for CCS811 wiring and register access, not a guaranteed drop-in compile; the Firmware tab lets you edit the sketch directly and recompile it against the board picked from its own target list.

Get everything in this build

Compoden does not currently stock a CCS811 module, so there is no CCS811 SKU to link here honestly. The parts below are what Soldr's storefront assistant actually offered in response to the exact prompt above — live price and stock, direct add-to-cart links.

Part Price Add to cart
Arduino Uno R3 CH340G ATmega328P Board Rs.230 Add to cart
MQ-135 Air Quality Gas Sensor Module (analog substitute, not a CCS811) Rs.110 Add to cart
SYB-170 Mini Breadboard Rs.20 Add to cart
Male-to-Male Breadboard Jumper Wires (20 cm, 24 AWG) Rs.40 Add to cart
USB-C 5V 3A Power Supply Adapter Rs.180 Add to cart
Total Rs.580 Add all 5 to cart

If a real digital eCO2/TVOC reading is the actual goal, sourcing a CCS811 breakout separately and following the wiring and firmware notes above is the honest path — the code generated in this build already targets the real chip correctly, even though Compoden's own tray couldn't card one.

Built and Backed by Compoden

The parts listed above ship from Compoden's India stock and are checked for compatibility before they're carded together, not sourced individually and hoped to work. Delivery typically takes 3–7 days across India, with Cash on Delivery and UPI both available at checkout. Compoden's support team can help with wiring or firmware issues on a build, and if a stocked sensor doesn't perform as described, support will help troubleshoot or replace it.

FAQ

Does the CCS811 measure real CO2, or an estimate?
An estimate. The CCS811 has one metal-oxide sensing element that responds to VOCs; its eCO2 output is calculated from that VOC signal using a correlation, not measured with a CO2-specific sensing method. For a genuine CO2 ppm reading, an NDIR sensor like the MH-Z19 measures the gas directly instead of estimating it.

Does Compoden sell the CCS811 directly?
No, not at the time of writing. A direct catalog search for "CCS811" returns zero listings, and Compoden's storefront assistant substitutes the MQ-135 — a different, analog gas sensor — when a CCS811 is requested.

Does the CCS811 need a warm-up period before its readings are accurate?
Yes. A new sensor needs a one-time 48-hour burn-in, and every power-on after that needs roughly 20 minutes for readings to stabilize. Numbers read immediately after power-up (often a flat 400 ppm eCO2) should not be trusted.

Is the MQ-135 a substitute for the CCS811?
Not a like-for-like one. The MQ-135 is an analog resistive gas sensor that needs manual calibration and reports a general air-quality signal across several gases; the CCS811 is a digital I²C sensor with a built-in algorithm that outputs specific eCO2 and TVOC values. They use different sensing electronics and different interfaces.

Back to blog