LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsThe VCNL4200 measures how much of its own infrared light bounces back, up to about 1.5 m, plus ambient light. A stack of paper close to the sensor reflects strongly; an empty dispenser reflects little. The ESP32 reads the proximity value over I2C and, below a learnt level, flashes an LED and can report over Wi-Fi.
Tick anything you already have and the total updates.
Adafruit VCNL4200 long-range IR proximity sensor
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB charger, or a power bank for a dispenser far from sockets.
dispenser.inoVerify & upload in Electrolark#include <Adafruit_VCNL4200.h>
Adafruit_VCNL4200 vcnl;
const uint16_t EMPTY = 300;
void setup() {
Serial.begin(115200);
pinMode(25, OUTPUT);
while (!vcnl.begin()) { Serial.println("VCNL4200 not found"); delay(1000); }
}
void loop() {
uint16_t prox = vcnl.readProxData();
bool empty = prox < EMPTY;
Serial.printf("prox %u %s\n", prox, empty ? "EMPTY" : "ok");
digitalWrite(25, empty && (millis() / 500) % 2);
delay(500);
}
The sensor sees the dispenser's wall instead of the paper; aim it at the stack.
Dark or shiny paper reflects less; set EMPTY from your own readings.
Check the I2C wires and that it has 3.3 V.
For a soap bottle, aim it at the liquid level through a clear window; results vary with colour.
Days to weeks if the ESP32 sleeps between readings.
Very little; it modulates its IR to reject ambient light.
6 parts: Adafruit VCNL4200 Long Distance IR Proximity and Light Sensor – I2C Interface, STEMMA QT, ESP32-WROOM-32 38-Pin Development Board, 5mm LED by Colour (Pack of 10), Resistor Assortment Kit (30 Values), Solderless Breadboard and Dupont Jumper Wires (40 pcs). On this page you can tick the parts you already have and add only the rest to your cart.
No. This page has the complete, tested code (dispenser.ino).
About ₹1,623 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
IR proximity sensing for presence of objects; Setting a threshold from full and empty readings; Low-cost facility monitoring.
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.