LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsThe MS4525DO is a small digital pressure sensor from TE; this version reads vacuum from 0 down to -15 psi and reports it over I2C as a 14-bit number with temperature. Teed into the line between a 310 mini pump and a suction cup, it shows how much vacuum the pump makes and whether the cup is sealed. The ESP32 shows the reading and switches the pump on until the target vacuum is reached.
Tick anything you already have and the total updates.
TE MS4525DO -15 to 0 psi digital pressure sensor
Follow the colours: red is power, dark grey is ground, blue is a signal.
12 V adapter for the pump; ESP32 from USB.
vacuum.inoVerify & upload in Electrolark#include <Wire.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 oled(128, 64, &Wire);
const int ADDR = 0x28, PUMP = 25;
const float P_MIN = -15.0, P_MAX = 0.0; // psi range of this part
const float OUT_MIN = 0.05 * 16383, OUT_MAX = 0.95 * 16383; // type B; use 0.10/0.90 for type A
const float TARGET = -6.0; // psi
float readPsi() {
Wire.requestFrom(ADDR, 2);
if (Wire.available() < 2) return NAN;
uint16_t raw = ((Wire.read() & 0x3F) << 8) | Wire.read();
return (raw - OUT_MIN) * (P_MAX - P_MIN) / (OUT_MAX - OUT_MIN) + P_MIN;
}
void setup() {
Wire.begin(21, 22);
pinMode(PUMP, OUTPUT);
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
}
void loop() {
float psi = readPsi();
bool on = psi > TARGET + 0.3 ? true : (psi < TARGET - 0.3 ? false : digitalRead(PUMP));
digitalWrite(PUMP, on);
oled.clearDisplay(); oled.setTextColor(SSD1306_WHITE);
oled.setTextSize(2); oled.setCursor(0, 0); oled.print(psi, 2); oled.print(" psi");
oled.setTextSize(1); oled.setCursor(0, 24); oled.print(psi * 6.895, 1); oled.print(" kPa");
oled.setCursor(0, 44); oled.print(on ? "Pump ON" : "Holding"); oled.print(" target "); oled.print(TARGET, 1);
oled.display();
delay(100);
}
Check the pinout; the address may be 0x36 or 0x46 on other versions.
Zero offset: note it with the port open and subtract it.
There is a leak; check the cup and every tube joint.
About 0.4 bar below atmospheric pressure, a firm grip for a small cup.
Not this version; it is made for vacuum only.
The sensor port only needs to see the line pressure; no air flows through it.
8 parts: TE Connectivity MS4525DO-SS3BS015VPF Pressure Sensor, Vacuum, -15 psi to 0 psi, 3.3 VDC, Digital I2C/SPI, PCB Mount, 310 Mini Vacuum / Air Pump 6V-12V, MOSFET Switch Module, Relay Replacement (D4184 / LR7843), ESP32-WROOM-32 38-Pin Development Board, 0.96" OLED Display 128x64, DC Power Adapter (5.5x2.1mm), Solderless Breadboard and Dupont Jumper Wires (40 pcs). Tools: Solder Wire 60/40 Rosin Core. 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 (vacuum.ino).
About ₹5,461 for the parts at the prices on this page, plus tools if you do not have them. Quantity price breaks lower the cost when you build several.
Reading a digital pressure sensor over I2C; Gauge pressure and vacuum units; Simple on-off control with a target.
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.