LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsPlay a proper melody through a piezo buzzer when someone touches the doorbell pad, and count the visitors. A melody is two parallel arrays: one of frequencies and one of durations. Walking through them with a for loop and calling tone() for each pair plays the tune. The gap after each note, here 30 percent longer than the note itself, is what stops the melody sounding like one continuous smear. Note that the touch pad works through several millimetres of plastic or wood, so the sensor can be hidden behind a real door panel.
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
TTP223 touch module (the kit has a pack of two, twice)
16x2 LCD with I2C backpack: four wires, two lines of text
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_59_smart_doorbell.inoVerify & upload in Electrolark#include <Wire.h>
#include <LiquidCrystal_I2C.h>
int touchPin = 2;
int buzzer = 8;
int led = 7;
LiquidCrystal_I2C lcd(0x27, 16, 2);
int melody[8] = {659, 587, 370, 415, 554, 494, 294, 330};
int durations[8] = {300, 300, 600, 300, 300, 600, 300, 700};
int visitors = 0;
void playChime()
{
for (int i = 0; i < 8; i++)
{
tone(buzzer, melody[i], durations[i]);
digitalWrite(led, HIGH);
delay(durations[i] * 0.6);
digitalWrite(led, LOW);
delay(durations[i] * 0.7);
}
noTone(buzzer);
}
void showIdle()
{
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Touch to ring");
lcd.setCursor(0, 1);
lcd.print("Visitors: ");
lcd.print(visitors);
}
void setup()
{
pinMode(touchPin, INPUT);
pinMode(buzzer, OUTPUT);
pinMode(led, OUTPUT);
Serial.begin(9600);
lcd.init();
lcd.backlight();
showIdle();
}
void loop()
{
if (digitalRead(touchPin) == HIGH)
{
visitors = visitors + 1;
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("DING DONG!");
lcd.setCursor(0, 1);
lcd.print("Someone is here");
Serial.print("Doorbell pressed. Visitor ");
Serial.println(visitors);
playChime();
// Ignore a finger left resting on the pad
while (digitalRead(touchPin) == HIGH)
{
delay(20);
}
delay(1000);
showIdle();
}
}
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.
Power it from 5V and GND, and touch the pad itself. Some modules toggle on each touch: the sketch expects the default momentary mode.
This project needs the passive buzzer (the one that plays notes with tone()), not the active one.
A melody is two parallel arrays: one of frequencies and one of durations. Walking through them with a for loop and calling tone() for each pair plays the tune. The gap after each note, here 30 percent longer than the note itself, is what stops the melody sounding like one continuous smear. Note that the touch pad works through several millimetres of plastic or wood, so the sensor can be hidden behind a real door panel.
LCD shows Touch to ring / Visitors: 0. Touch the pad: DING DONG! appears and an eight-note chime plays. The LED pulses in time with the melody.
Yes. It is project 59 of 61 in the Geekobot Explorer Kit, in level 10 (Smart home). 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), Capacitive Touch Sensor Module, Buzzer Module 3.3–5V, LCD1602 16x2 Character LCD Display 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_59_smart_doorbell.ino).
About ₹590 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Touch sensing and piezo melodies; Parallel arrays for pitch and duration; Why notes need a gap between them; Counting events with a persistent variable.
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.