LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsMEMS gas sensors are tiny heated chips, much smaller and lower power than the old MQ tubes. The DFRobot Fermion MEMS methane sensor gives an analog voltage that rises with methane from about 1 to 10,000 ppm. Because each sensor and room is different, the sketch first learns the clean-air reading at power-up and then alarms when the voltage climbs a set amount above it. Give it a few minutes to warm up before you trust it.
This is a learning project, not a certified gas detector. Use certified alarms where gas leaks are possible.
If you smell gas, do not switch anything on or off; open windows and leave.
Tick anything you already have and the total updates.
DFRobot Fermion MEMS methane sensor
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB or a 5 V adapter; the heater needs steady power.
methane.inoVerify & upload in Electrolark#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 oled(128, 64, &Wire, -1);
float base = 0;
const float ALARM_RISE = 0.40; // volts above clean air
float volts() { long s = 0; for (int i = 0; i < 20; i++) s += analogRead(A0); return s / 20.0 * 5.0 / 1023; }
void setup() {
pinMode(8, OUTPUT);
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C); oled.setTextColor(WHITE);
for (int s = 180; s > 0; s--) { // 3 minute warm-up
oled.clearDisplay(); oled.setCursor(0, 0); oled.print("Warming up "); oled.print(s); oled.display(); delay(1000);
}
for (int i = 0; i < 10; i++) { base += volts(); delay(200); }
base /= 10;
}
void loop() {
float v = volts();
bool alarm = v - base > ALARM_RISE;
digitalWrite(8, alarm && (millis() / 300) % 2);
oled.clearDisplay(); oled.setTextSize(1); oled.setCursor(0, 0);
oled.print("Base "); oled.print(base, 2); oled.print(" V");
oled.setTextSize(3); oled.setCursor(0, 20); oled.print(v, 2);
oled.setTextSize(1); oled.setCursor(0, 55); oled.print(alarm ? "GAS! Ventilate" : "OK");
oled.display();
delay(500);
}
The baseline was taken while gas was present or the sensor was still cold; restart in clean air.
Normal for heated sensors; restart now and then to take a new baseline.
Lighter gas is mostly butane; the sensor reacts less to it than to methane, so a small rise is normal.
Not without calibration against a known gas; it is best for spotting a rise.
It detects the same gas, with a smaller, lower power MEMS chip.
LPG is mostly propane and butane and sinks; use an LPG sensor mounted low instead.
6 parts: Generic Nano CH340 Development Board (Soldered), DFRobot Fermion MEMS Methane Gas Sensor (1–10000 ppm) – Analog Voltage Output, 0.96" OLED Display 128x64, Buzzer Module 3.3–5V, 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 beginner project and takes about 1 hour. The build on this page has 5 steps.
No. This page has the complete, tested code (methane.ino).
About ₹977 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
How MEMS heated gas sensors work; Using a clean-air baseline instead of a fixed number; Warm-up time and drift.
This is a learning project, not a certified gas detector. Use certified alarms where gas leaks are possible. If you smell gas, do not switch anything on or off; open windows and leave.
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.