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.
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)
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_29_touch_password.inoVerify & upload in Electrolarkint touchPins[3] = {2, 3, 4};
int greenLed = 5;
int redLed = 6;
int buzzer = 8;
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 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.
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.
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 61 in the Geekobot Explorer 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 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), 3 × Capacitive Touch Sensor Module, PCB Mounted Active Buzzer 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 6 steps.
No. This page has the complete, tested code (explorer_kit_29_touch_password.ino).
About ₹530 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.
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.