LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsThe CCS811 is a metal-oxide gas sensor with its own microcontroller that reports TVOC (total volatile organic compounds) and an estimated eCO2. Metal-oxide sensors change with temperature and humidity, so the CCS811 accepts both as inputs. An Si7021 module measures them and the ESP32 passes them on every minute. Note that eCO2 is a guess from VOCs, not a true CO2 measurement.
Tick anything you already have and the total updates.
CCS811 TVOC / eCO2 sensor module
GY-213V Si7021 humidity sensor
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB.
ccs811_si7021.inoVerify & upload in Electrolark#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 oled(128, 64, &Wire, -1);
#include <Adafruit_CCS811.h>
#include <Adafruit_Si7021.h>
Adafruit_CCS811 ccs;
Adafruit_Si7021 si;
unsigned long lastComp = 0;
void setup() {
Serial.begin(115200);
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C); oled.setTextColor(WHITE);
if (!ccs.begin()) Serial.println("CCS811 not found");
if (!si.begin()) Serial.println("Si7021 not found");
while (!ccs.available()) delay(100);
}
void loop() {
float rh = si.readHumidity(), t = si.readTemperature();
if (millis() - lastComp > 60000 || lastComp == 0) { ccs.setEnvironmentalData(rh, t); lastComp = millis(); }
if (ccs.available() && !ccs.readData()) {
int tvoc = ccs.getTVOC(), eco2 = ccs.geteCO2();
oled.clearDisplay(); oled.setTextSize(1); oled.setCursor(0, 0);
oled.print(t, 1); oled.print(" C "); oled.print(rh, 0); oled.println(" %RH");
oled.setTextSize(3); oled.setCursor(0, 16); oled.print(tvoc); oled.setTextSize(1); oled.print(" ppb TVOC");
oled.setCursor(0, 46); oled.print("eCO2 ~"); oled.print(eco2);
oled.setCursor(0, 56); oled.print(tvoc < 220 ? "Clean" : tvoc < 660 ? "Some fumes" : "Ventilate now");
oled.display();
}
delay(1000);
}
WAKE is not tied to GND, or the module uses address 0x5B; pass 0x5B to ccs.begin().
Still in its first 20 minutes, or clean air; breathe near it or open a marker.
The CCS811 relearns its baseline; leave it powered all the time.
No, it is estimated from VOCs; use an NDIR sensor like the SCD30 for real CO2.
Under about 220 ppb is clean; above 660 ppb is worth ventilating.
The CCS811 is more accurate when told the room's humidity and temperature.
6 parts: CCS811 CO2 eCO2 TVOC Air Quality Detection Sensor Module – I2C Interface, Generic GY-213V-SI7021 Temperature and Humidity Sensor Module – I2C Interface, ESP32-WROOM-32 38-Pin Development Board, 0.96" OLED Display 128x64, Solderless Breadboard and Dupont Jumper Wires (40 pcs). On this page you can tick the parts you already have and add only the rest to your cart.
It is a intermediate project and takes about 1 hour. The build on this page has 5 steps.
No. This page has the complete, tested code (ccs811_si7021.ino).
About ₹2,973 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Metal-oxide VOC sensors; Environmental compensation; Why eCO2 is not the same as NDIR CO2.
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
See the smoke level live on a crisp screen and get a loud warning when it spikes.
An infrared eye that spots an open flame and raises the alarm.
Walk into the room and it sounds the alarm: the classic first security build.
Lessons are free to read. Maker (₹499/month) and Pro add quizzes, worked problems and certificates, paid with your Geekobot account. See plans
Learning project. Check every circuit and the datasheet of each part before you power it up.