LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsThe DYP-A22 is a waterproof ultrasonic sensor made for obstacle avoidance, with a wide beam that sees posts and kerbs. The UART auto-output version sends a 4-byte frame (0xFF, high byte, low byte, checksum) about ten times a second with the distance in millimetres. The Nano reads it and beeps faster as the distance falls, with a steady tone under 30 cm.
Fuse any connection to a vehicle's 12 V and do not tap airbag or safety system wiring.
Tick anything you already have and the total updates.
DYP-A22 UART auto-output ultrasonic sensor
Follow the colours: red is power, dark grey is ground, blue is a signal.
From the vehicle's 12 V through a fuse and the 5 V buck converter.
reverse_aid.inoVerify & upload in Electrolark#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 oled(128, 64, &Wire, -1);
#include <SoftwareSerial.h>
SoftwareSerial us(10, 11);
int mm = -1;
void readFrame() {
while (us.available() >= 4) {
if (us.read() != 0xFF) continue;
uint8_t h = us.read(), l = us.read(), s = us.read();
if ((uint8_t)(0xFF + h + l) == s) mm = h * 256 + l;
}
}
void setup() {
us.begin(9600); pinMode(8, OUTPUT);
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C); oled.setTextColor(WHITE);
}
void loop() {
readFrame();
unsigned long period = mm < 0 || mm > 1500 ? 0 : mm < 300 ? 1 : map(mm, 300, 1500, 100, 800);
if (period == 1) digitalWrite(8, HIGH);
else if (period) digitalWrite(8, (millis() % period) < period / 2);
else digitalWrite(8, LOW);
static unsigned long last = 0;
if (millis() - last > 200) {
last = millis();
oled.clearDisplay(); oled.setTextSize(3); oled.setCursor(0, 16);
if (mm > 0) { oled.print(mm / 10); oled.setTextSize(1); oled.print(" cm"); } else { oled.setTextSize(1); oled.print("No reading"); }
oled.display();
}
}
Wrong version (PWM or switch output) or TX not on D10; check the label on the sensor.
Tilt the sensor up a few degrees.
Water drops on the face scatter sound; it is sealed but keep the face clean.
No, always check mirrors and behind you; it only helps.
Yes, with a 5 V power bank instead of the vehicle supply.
Bumpers get rain and car washes; ordinary HC-SR04 modules fail there.
7 parts: DYP-A22YYUW-V1.0 UART Auto Ultrasonic Obstacle Avoidance Sensor (Object Range 2-300cm), Generic Nano CH340 Development Board (Soldered), Buzzer Module 3.3–5V, 0.96" OLED Display 128x64, Step-Down Converter to 5V USB / 5V 3A, 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 2 hours. The build on this page has 5 steps.
No. This page has the complete, tested code (reverse_aid.ino).
About ₹2,500 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Obstacle-avoidance ultrasonic sensors; Parsing a checksummed distance frame; Mapping distance to beep rate.
Fuse any connection to a vehicle's 12 V and do not tap airbag or safety system wiring.
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.