LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsMake an LED respond to a clap, using a sound sensor and a guard that ignores the echo. The module's digital output pulses LOW whenever the sound crosses the level set by its onboard potentiometer. The complication is that one clap in a hard-walled room produces several pulses as it echoes off the surfaces. Recording the time of each accepted clap and refusing anything within 300 ms of it filters those echoes out. That guard is the difference between a light that toggles once and one that flickers unpredictably.
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
Sound sensor: its DO pin goes active when a clap or voice crosses the knob setting
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_10_clap_detection.inoVerify & upload in Electrolarkint soundPin = 2;
int led = 8;
int buzzer = 9;
bool lightOn = false;
unsigned long lastClap = 0;
unsigned long deadTime = 300; // Ignore echoes for this long
int clapCount = 0;
void setup()
{
pinMode(soundPin, INPUT);
pinMode(led, OUTPUT);
pinMode(buzzer, OUTPUT);
Serial.begin(9600);
Serial.println("Clap to switch the light");
}
void loop()
{
if (digitalRead(soundPin) == LOW)
{
if (millis() - lastClap > deadTime)
{
lastClap = millis();
clapCount = clapCount + 1;
lightOn = !lightOn;
digitalWrite(led, lightOn);
digitalWrite(buzzer, HIGH);
delay(40);
digitalWrite(buzzer, LOW);
Serial.print("Clap ");
Serial.print(clapCount);
Serial.print(" - light is ");
Serial.println(lightOn ? "ON" : "OFF");
}
}
}
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 blue trim pot on the sound sensor slowly until its LED just goes off in a quiet room.
The module's digital output pulses LOW whenever the sound crosses the level set by its onboard potentiometer. The complication is that one clap in a hard-walled room produces several pulses as it echoes off the surfaces. Recording the time of each accepted clap and refusing anything within 300 ms of it filters those echoes out. That guard is the difference between a light that toggles once and one that flickers unpredictably.
Clap once and the LED lights with a short chirp. Clap again and it goes out. Echoes in a hard room do not cause extra switching.
Yes. It is project 10 of 61 in the Geekobot Explorer Kit, in level 1 (Foundations). 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.
8 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, Generic LM393 Sound Detection Sensor Module – Digital Output 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 beginner project and takes about 30 minutes. The build on this page has 6 steps.
No. This page has the complete, tested code (explorer_kit_10_clap_detection.ino).
About ₹530 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Sound sensing with a digital output; Using millis() to record when something happened; Guard windows that reject echoes; Combining sensing with a toggled state.
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.