LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsWatch the room temperature and sound a loud buzzer the moment it crosses a limit you set. The alarm is a threshold comparison: read a value, compare it with a limit, act. Rather than holding the buzzer permanently on, the sketch pulses it, which is both more attention-grabbing and easier on the ear. Change alarmTemp to a value just above your current room temperature and you can trigger the alarm by cupping the sensor in your hand.
Every part for this build comes in the Geekobot Explorer Kit box, a Geekobot exclusive, together with the parts for all 61 projects, from a first blinking LED to a smart fan and a reaction game. The wiring below is the kit's own wiring.
Tick anything you already have and the total updates.
The brain of every Explorer Kit project
Male-to-female and female-to-female leads for the modules
LEDs from the kit's red, green, yellow and blue packs
220 ohm resistors: one in series with every LED segment
16x2 LCD with I2C backpack: four wires, two lines of text
DHT11 temperature and humidity sensor
Nano I/O shield from the kit: every pin has its own S, V, G header, so modules plug in with jumpers
Follow the colours: red is power, dark grey is ground, blue is a signal.
explorer_kit_24_temperature_alarm.inoVerify & upload in Electrolark#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <DHT.h>
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
LiquidCrystal_I2C lcd(0x27, 16, 2);
int buzzer = 8;
int led = 6;
float alarmTemp = 32.0;
void setup()
{
pinMode(buzzer, OUTPUT);
pinMode(led, OUTPUT);
dht.begin();
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Temp Alarm ON");
delay(2000);
lcd.clear();
}
void loop()
{
float temp = dht.readTemperature();
if (isnan(temp))
{
lcd.setCursor(0, 0);
lcd.print("Sensor error ");
delay(2000);
return;
}
lcd.setCursor(0, 0);
lcd.print("Temp: ");
lcd.print(temp, 1);
lcd.write(223);
lcd.print("C ");
if (temp > alarmTemp)
{
lcd.setCursor(0, 1);
lcd.print("** TOO HOT! ** ");
for (int i = 0; i < 4; i++)
{
digitalWrite(buzzer, HIGH);
digitalWrite(led, HIGH);
delay(150);
digitalWrite(buzzer, LOW);
digitalWrite(led, LOW);
delay(150);
}
}
else
{
lcd.setCursor(0, 1);
lcd.print("Status: Normal ");
digitalWrite(buzzer, LOW);
digitalWrite(led, LOW);
delay(1500);
}
}
Use the kit's mini-USB cable, install the CH340 driver on Windows if no port appears, pick Tools > Board > Arduino Nano and try Tools > Processor > ATmega328P (Old Bootloader) if the upload times out.
Turn it round: the long leg (anode) goes to the pin side through the 220 ohm resistor, the short leg to GND.
The active buzzer has a + leg: it goes to the pin, the other to GND. Peel off the sticker on top if it has one.
Turn the small contrast pot on the back of the I2C board. If still blank, change 0x27 in the sketch to 0x3F.
The alarm is a threshold comparison: read a value, compare it with a limit, act. Rather than holding the buzzer permanently on, the sketch pulses it, which is both more attention-grabbing and easier on the ear. Change alarmTemp to a value just above your current room temperature and you can trigger the alarm by cupping the sensor in your hand.
Temp: 28.5°C / Status: Normal in an ordinary room. Hold the sensor in a closed hand for a few seconds. Above 32°C: ** TOO HOT! ** with a pulsing buzzer and flashing LED.
Yes. It is project 24 of 61 in the Geekobot Explorer Kit, in level 5 (Smart automation). Every part on the list comes in the kit box, and you can also buy the parts one by one from the list above.
No. Every Explorer Kit project is wired on the Nano I/O shield and the breadboard with jumper wires.
9 parts: Generic Nano CH340 Development Board (Soldered), USB Cable, Dupont Jumper Wires (40 pcs), Through-Hole LED Pack (Pack of 10), Carbon Film Resistor 1/4W 5% (Pack of 10), PCB Mounted Active Buzzer Module, LCD1602 16x2 Character LCD Display, Generic DHT11 Digital Temperature & Humidity Sensor Module and Arduino Nano IO Expansion Shield (328P Compatible). 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 45 minutes. The build on this page has 7 steps.
No. This page has the complete, tested code (explorer_kit_24_temperature_alarm.ino).
About ₹633 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Threshold-based environmental alarms; Comparing float readings against a limit; Pulsing an output instead of holding it on; Combining a sensor, a display and two outputs.
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.