LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsThe DS18B20 is a digital temperature probe where every sensor has a unique 64-bit address, so many can share one data wire. This project puts one probe in the fridge and one in the freezer, reads both with the OneWire and DallasTemperature libraries and shows them on a small OLED. A buzzer sounds if the fridge goes above 8 degrees or the freezer above -12 degrees for a few minutes. The probes' thin cable passes through the door seal without stopping it from closing.
Do not rely on this alone for medicine or vaccine storage; use a calibrated cold-chain monitor.
Tick anything you already have and the total updates.
Waterproof DS18B20 temperature probe
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB phone charger on a short extension from a nearby socket.
fridge_logger.inoVerify & upload in Electrolark#include <OneWire.h>
#include <DallasTemperature.h>
#include <Wire.h>
#include <Adafruit_SSD1306.h>
OneWire bus(4);
DallasTemperature sensors(&bus);
Adafruit_SSD1306 oled(128, 64, &Wire, -1);
const int BUZZ = 25;
const float FRIDGE_MAX = 8.0, FREEZER_MAX = -12.0;
unsigned long warmSince = 0;
void setup() {
pinMode(BUZZ, OUTPUT);
Wire.begin(21, 22);
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
oled.setTextColor(WHITE);
sensors.begin();
}
void loop() {
sensors.requestTemperatures();
float fridge = sensors.getTempCByIndex(0); // swap 0 and 1 if your probes are the other way round
float freezer = sensors.getTempCByIndex(1);
bool tooWarm = (fridge > FRIDGE_MAX) || (freezer > FREEZER_MAX);
if (!tooWarm) warmSince = 0;
else if (warmSince == 0) warmSince = millis();
bool alarm = tooWarm && millis() - warmSince > 5UL * 60 * 1000; // warm for 5 minutes
digitalWrite(BUZZ, alarm ? HIGH : LOW);
oled.clearDisplay();
oled.setTextSize(1); oled.setCursor(0, 0); oled.print("Fridge");
oled.setTextSize(2); oled.setCursor(0, 10); oled.printf("%.1f C", fridge);
oled.setTextSize(1); oled.setCursor(0, 34); oled.print("Freezer");
oled.setTextSize(2); oled.setCursor(0, 44); oled.printf("%.1f C", freezer);
oled.display();
delay(2000);
}
The probe is not detected. Check the pull-up resistor and the three wire colours.
They may be reading as one. Check each probe is connected and try getTempC with the sensor's own address.
The 5-minute delay allows for normal door openings; lengthen it if needed.
Many. Each has its own address on the same wire.
Yes. Combine this with the Telegram alert project.
The stainless steel probe is fine in a fridge, but keep it out of open food and wipe it clean.
7 parts: ESP32-WROOM-32 38-Pin Development Board, 2 × DS18B20 Waterproof Temperature Probe – 1m Cable, Stainless Steel, 0.96" OLED Display 128x64, Buzzer Module 3.3–5V, Resistor Assortment Kit (30 Values), 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.5 hours. The build on this page has 6 steps.
No. This page has the complete, tested code (fridge_logger.ino).
About ₹755 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Putting several DS18B20 sensors on one pin; Finding each sensor's address; Setting alarm limits with a delay.
Ideas that reuse this build: ESP32 flame alert via Telegram. They are listed under Take it further on this page.
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.
Learning project. Check every circuit and the datasheet of each part before you power it up.