LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsAuthenticate with a secret sequence: touch three capacitive pads in the right order to unlock. The three sensors are stored in an array, which lets one for loop check all of them however many there are. Each accepted touch is appended to a sequence array and compared against the secret. Because a finger rests on a pad for far longer than one loop pass, the sketch waits for the pad to be released before accepting the next touch, without that, a single tap would register dozens of times.
The ESP32 is a 3.3V board: never connect a 5V signal straight to a GPIO pin.
Every part for this build comes in the Geekobot Titan Kit box, a Geekobot exclusive, together with the parts for all 120 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.
ESP32 DevKit V1 (38-pin): the brain of every Titan Kit project, with Wi-Fi and Bluetooth
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
ESP32 expansion board from the kit: every GPIO has its own S, V, G header
Follow the colours: red is power, dark grey is ground, blue is a signal.
titan_kit_029_touch_password.inoVerify & upload in Electrolarkint touchPins[3] = {13, 12, 14};
int greenLed = 27;
int redLed = 26;
int buzzer = 33;
int secret[3] = {1, 3, 2}; // Touch sensor 1, then 3, then 2
int entered[3];
int position = 0;
void beep(int ms)
{
digitalWrite(buzzer, HIGH);
delay(ms);
digitalWrite(buzzer, LOW);
}
void setup()
{
for (int i = 0; i < 3; i++)
{
pinMode(touchPins[i], INPUT);
}
pinMode(greenLed, OUTPUT);
pinMode(redLed, OUTPUT);
pinMode(buzzer, OUTPUT);
Serial.begin(9600);
Serial.println("Enter the touch sequence");
}
void loop()
{
for (int i = 0; i < 3; i++)
{
if (digitalRead(touchPins[i]) == HIGH)
{
entered[position] = i + 1;
position = position + 1;
Serial.print("Touched sensor ");
Serial.println(i + 1);
beep(60);
// Wait until the finger is lifted
while (digitalRead(touchPins[i]) == HIGH)
{
delay(10);
}
}
}
if (position == 3)
{
bool correct = true;
for (int i = 0; i < 3; i++)
{
if (entered[i] != secret[i])
{
correct = false;
}
}
if (correct)
{
Serial.println("ACCESS GRANTED");
digitalWrite(greenLed, HIGH);
beep(400);
delay(2000);
digitalWrite(greenLed, LOW);
}
else
{
Serial.println("ACCESS DENIED");
digitalWrite(redLed, HIGH);
beep(150);
delay(150);
beep(150);
delay(1500);
digitalWrite(redLed, LOW);
}
position = 0;
}
}
Use a micro-USB data cable (some cables only charge), install the CP210x or CH340 driver if no port appears, pick Tools > Board > ESP32 Dev Module and hold the BOOT button on the board until the upload starts.
Turn it round: the long leg (anode) goes to the GPIO side through the 220 ohm resistor, the short leg to GND.
Power it from 3V3 and GND, and touch the pad itself. The sketch expects the module's default momentary mode.
The active buzzer has a + leg: it goes to the GPIO, the other to GND. Peel off the sticker on top if it has one.
The three sensors are stored in an array, which lets one for loop check all of them however many there are. Each accepted touch is appended to a sequence array and compared against the secret. Because a finger rests on a pad for far longer than one loop pass, the sketch waits for the pad to be released before accepting the next touch, without that, a single tap would register dozens of times.
Serial Monitor prints Touched sensor 1 with a short beep on each pad. Correct order 1-3-2: ACCESS GRANTED, green LED and a long beep. Any wrong order: ACCESS DENIED, red LED and two short beeps.
Yes. It is project 29 of 120 in the Geekobot Titan Kit, in level 6 (Security and access). 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 Titan Kit project is wired on the ESP32 expansion board and the breadboard with jumper wires.
9 parts: ESP32-WROOM-32 38-Pin Development Board, USB Cable, Solderless Breadboard, Dupont Jumper Wires (40 pcs), 2 × Through-Hole LED Pack (Pack of 10), Carbon Film Resistor 1/4W 5% (Pack of 10), 3 × Capacitive Touch Sensor Module, PCB Mounted Active Buzzer Module and ESP32 38-Pin Expansion Board. 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 6 steps.
No. This page has the complete, tested code (titan_kit_029_touch_password.ino).
About ₹812 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Capacitive touch arrays and logic; Comparing two arrays element by element; Waiting for release to debounce a touch; Storing a secret as data rather than as code.
The ESP32 is a 3.3V board: never connect a 5V signal straight to a GPIO pin.
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.