LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsStuffy rooms are high in CO2, traffic and cooking raise PM2.5, and cleaning sprays and paint raise VOCs. The Sensirion SCD41 measures real CO2 photoacoustically, the Plantower PMS5003 counts particles with a laser, and the Bosch BME688 gives temperature, humidity, pressure and a gas resistance that drops when VOCs rise. The ESP32 reads all three and colours the advice on an OLED.
Tick anything you already have and the total updates.
SCD41 CO2, temperature and humidity module
Plantower PMS5003 laser PM2.5 sensor
BME688 gas, temperature, humidity and pressure module
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB 5 V adapter, 1 A.
air_monitor.inoVerify & upload in Electrolark#include <Wire.h>
#include <SensirionI2cScd4x.h>
#include <Adafruit_BME680.h>
#include <PMS.h>
#include <Adafruit_SSD1306.h>
SensirionI2cScd4x scd;
Adafruit_BME680 bme;
HardwareSerial pmsSerial(2);
PMS pms(pmsSerial);
PMS::DATA pm;
Adafruit_SSD1306 oled(128, 64, &Wire, -1);
uint16_t co2 = 0; float t = 0, h = 0, gasK = 0; int pm25 = -1;
void setup() {
Wire.begin(21, 22);
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
scd.begin(Wire, SCD41_I2C_ADDR_62);
scd.stopPeriodicMeasurement();
scd.startPeriodicMeasurement();
bme.begin(0x77);
bme.setGasHeater(320, 150);
pmsSerial.begin(9600, SERIAL_8N1, 16, 17);
}
void loop() {
if (pms.read(pm)) pm25 = pm.PM_AE_UG_2_5;
static unsigned long last = 0;
if (millis() - last < 5000) return;
last = millis();
bool ready = false;
scd.getDataReadyStatus(ready);
if (ready) scd.readMeasurement(co2, t, h);
if (bme.performReading()) gasK = bme.gas_resistance / 1000.0;
const char* advice = co2 > 1200 || pm25 > 60 ? "Open a window" : co2 > 800 || pm25 > 30 ? "Getting stuffy" : "Air is good";
oled.clearDisplay(); oled.setTextColor(WHITE); oled.setTextSize(1);
oled.setCursor(0, 0); oled.printf("CO2 %u ppm", co2);
oled.setCursor(0, 12); oled.printf("PM2.5 %d ug/m3", pm25);
oled.setCursor(0, 24); oled.printf("VOC %.0f kOhm", gasK);
oled.setCursor(0, 36); oled.printf("%.1f C %.0f %%", t, h);
oled.setCursor(0, 54); oled.print(advice);
oled.display();
}
The SCD41 gives its first reading after about 5 seconds; check SDA/SCL and the 0x62 address.
PMS5003 TX (pin 5) must go to GPIO 16 and the sensor needs 5 V for its fan.
Gas resistance is a trend: lower than usual means more VOCs. Watch how it changes, not the absolute value.
Outdoor air is about 420 ppm; under 800 ppm indoors is good, above 1200 ppm open a window.
India's 24-hour standard is 60 µg/m³; lower is better.
It self-calibrates if it sees fresh air once a week; or force-calibrate outdoors.
7 parts: ESP32-WROOM-32 38-Pin Development Board, Sensirion SCD41 CO2, Temperature & Humidity Sensor Module – I2C Interface, Blue PCB, Plantower PMS5003 PM2.5 Laser Particle Concentration Sensor, UART, 0~500 µg/m³, 5 V, Range: 0.3~10 µm, Bosch BME688 4-in-1 Environmental Sensor Module with Cotton Core & Holder – I2C/SPI, 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 3 hours. The build on this page has 6 steps.
No. This page has the complete, tested code (air_monitor.ino).
About ₹6,532 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Photoacoustic CO2 sensing; Reading a PMS5003 data frame; Using gas resistance as a VOC trend.
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.