LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsAmbient light sensors such as the TONYU DY-FPD333 are phototransistors with a filter that matches the human eye, so they ignore the infrared that fools a bare LDR or photodiode. Wired with a 10 kΩ resistor, the sensor's current turns into a voltage the Nano reads on A0. The lamp fades a WS2812 ring up as the room darkens and off when lights come on, with a small dead band so it does not flicker.
Tick anything you already have and the total updates.
DY-FPD333 5 mm ambient light sensor
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB phone charger.
night_lamp.inoVerify & upload in Electrolark#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel ring(12, 6, NEO_GRB + NEO_KHZ800);
const int DARK = 120, LIGHT = 200; // set from your serial readings
int level = 0;
bool on = false;
void setup() { Serial.begin(9600); ring.begin(); }
void loop() {
int light = analogRead(A0);
Serial.println(light);
if (light < DARK) on = true;
if (light > LIGHT) on = false;
int target = on ? 80 : 0;
level += (target > level) - (target < level); // slow fade
ring.fill(ring.Color(level, level * 0.6, level * 0.2));
ring.show();
delay(20);
}
The sensor is in backwards; swap the legs.
Widen the gap between DARK and LIGHT, and keep the sensor away from the ring.
Use a smaller resistor, such as 4.7 kΩ.
LDRs are slow and drift; ambient light sensors respond quickly and match the eye.
Only roughly: compare with a lux meter and build a table; for real lux use an I2C light sensor.
Yes, through a MOSFET module on a PWM pin.
6 parts: TONYU DY-FPD333-3B/L3 5mm Plugin Ambient Light Sensor ROHS, Resistor Assortment Kit (30 Values), Generic Nano CH340 Development Board (Soldered), WS2812 RGB LED Ring, 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.
It is a beginner project and takes about 1 hour. The build on this page has 6 steps.
No. This page has the complete, tested code (night_lamp.ino).
About ₹341 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Wiring a phototransistor as a light sensor; Why ambient light sensors have IR filters; Hysteresis to stop flicker.
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.