LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsA waterproof DS18B20 probe is slipped inside the fridge, with its cable passing under the door seal. The Pico reads it every few seconds, shows the temperature on an OLED, and beeps if it stays above 8 degrees for ten minutes. The delay avoids false alarms while the door is open for a moment. A thin cable under the seal can leave a gap and warm the fridge slightly, so use a flat cable or a small notch.
Tick anything you already have and the total updates.
Waterproof DS18B20 probe
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB power adapter placed outside the fridge.
main.pyimport time, onewire, ds18x20
from machine import Pin, I2C
from ssd1306 import SSD1306_I2C
i2c = I2C(0, sda=Pin(4), scl=Pin(5), freq=400000)
oled = SSD1306_I2C(128, 64, i2c)
ds = ds18x20.DS18X20(onewire.OneWire(Pin(15)))
roms = ds.scan()
buzzer = Pin(14, Pin.OUT)
MAX_C = 8.0
LIMIT_MS = 10 * 60 * 1000
warm_since = None
while True:
ds.convert_temp()
time.sleep_ms(800)
t = ds.read_temp(roms[0])
now = time.ticks_ms()
if t > MAX_C:
if warm_since is None:
warm_since = now
else:
warm_since = None
alarm = warm_since is not None and time.ticks_diff(now, warm_since) > LIMIT_MS
buzzer.value(1 if alarm else 0)
oled.fill(0)
oled.text("Fridge", 0, 0)
oled.text("%.1f C" % t, 0, 20)
oled.text("ALARM!" if alarm else "OK", 0, 44)
oled.show()
time.sleep(2)
The probe was not found. Check the pull-up resistor and wiring.
Raise LIMIT_MS or the temperature limit.
Air near the cooling plate is colder. Move the probe.
Generally 1 to 5 degrees, and below 8.
Use a Pico W with the Telegram project's approach.
A thin flat cable is fine for a probe; check the door still closes fully.
7 parts: Raspberry Pi Pico, 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 beginner project and takes about 1 hour. The build on this page has 6 steps.
No. This page has the complete, tested code (main.py).
About ₹715 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Reading a DS18B20 in MicroPython; A timed alarm condition; Placing a probe inside a fridge.
Ideas that reuse this build: Pico DS18B20 thermometer OLED. 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.