LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsThe Winsens F1031 is a thermal mass flow sensor for small gas flows. Gas passes over a tiny heated element; the faster it flows, the more heat it carries away, and the module outputs an analog voltage that rises with flow. In this project a Nano runs a 310 air pump through a MOSFET module at a speed set by a knob, reads the F1031's voltage and turns it into flow using the curve in Winsens' datasheet.
Tick anything you already have and the total updates.
Winsens F1031 micro gas flow sensor
Follow the colours: red is power, dark grey is ground, blue is a signal.
12 V adapter for the pump; Nano from USB; sensor at the voltage in its datasheet.
airflow.inoVerify & upload in Electrolark#include <Wire.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 oled(128, 64, &Wire);
// From the F1031 datasheet for your range:
const float V_ZERO = 0.5, V_FULL = 4.5, FULL_SCALE = 5.0; // volts, volts, litres per minute
void setup() {
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
}
void loop() {
int duty = analogRead(A1) / 4;
analogWrite(9, duty);
float v = analogRead(A0) * 5.0 / 1023;
float lpm = constrain((v - V_ZERO) / (V_FULL - V_ZERO), 0, 1) * FULL_SCALE; // replace with the datasheet curve if it is not linear
oled.clearDisplay(); oled.setTextColor(SSD1306_WHITE);
oled.setCursor(0, 0); oled.setTextSize(1); oled.print("Pump "); oled.print(duty * 100 / 255); oled.print("% "); oled.print(v, 2); oled.print(" V");
oled.setCursor(0, 24); oled.setTextSize(2); oled.print(lpm, 2); oled.print(" L/min");
oled.display();
delay(200);
}
Let the sensor warm up for a minute and check V_ZERO.
Pump pulses cause ripple; average several readings.
The tubing is on the wrong port; follow the flow arrow.
No, it is for clean, dry gases such as air.
Check the datasheet; some ranges need a lookup table instead of a straight line.
Standard litres per minute (SLPM), referred to standard temperature and pressure.
9 parts: Winsens F1031 Micro Gas Flow Sensor – Analog Voltage Output, 310 Mini Vacuum / Air Pump 6V-12V, MOSFET Switch Module, Relay Replacement (D4184 / LR7843), Generic Nano CH340 Development Board (Soldered), 0.96" OLED Display 128x64, Rotary Potentiometer Module 10k (3-Pin), DC Power Adapter (5.5x2.1mm), 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 2 hours. The build on this page has 6 steps.
No. This page has the complete, tested code (airflow.ino).
About ₹4,971 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
How thermal flow sensors work; Converting voltage to flow with a datasheet curve; PWM speed control with a MOSFET.
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.