LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsThe MB1013 HRLV-MaxSonar-EZ1 has 1 mm resolution and an analog output scaled at Vcc/1024 per 5 mm, so on a 5 V Nano each ADC count is 5 mm. Mounted on the ceiling or a doorway, it measures the distance to the top of your head; height is the mounting height minus that distance.
Tick anything you already have and the total updates.
MaxBotix MB1013 HRLV-MaxSonar-EZ1
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB charger.
height_station.inoVerify & upload in Electrolark#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 oled(128, 64, &Wire, -1);
void big(const char* top, float value, int dp, const char* unit) {
oled.clearDisplay(); oled.setTextColor(WHITE);
oled.setTextSize(1); oled.setCursor(0, 0); oled.print(top);
oled.setTextSize(3); oled.setCursor(0, 20); oled.print(value, dp);
oled.setTextSize(1); oled.print(" "); oled.print(unit);
oled.display();
}
float mountCm = 220;
float distCm() {
long sum = 0;
for (int i = 0; i < 20; i++) { sum += analogRead(A0); delay(10); }
return sum / 20.0 * 5.0 / 10.0; // 5 mm per count at 5 V
}
void setup() { pinMode(2, INPUT_PULLUP); oled.begin(SSD1306_SWITCHCAPVCC, 0x3C); }
void loop() {
float d = distCm();
if (digitalRead(2) == LOW) { mountCm = d; delay(500); }
float h = mountCm - d;
big("Height", h > 30 ? h : 0, 0, "cm");
delay(200);
}
Hair and posture matter; use a flat card on the head for a better target.
Keep the sensor's beam clear of walls and door frames.
Power the sensor from the same 5 V as the Nano's ADC reference.
It is good to about 1 cm; medical records need a proper stadiometer.
Yes, detect a drop in distance and count each one.
The HRLV has 1 mm resolution and built-in temperature compensation options.
6 parts: MaxBotix MB1013 HRLV-MaxSonar-EZ1 Ultrasonic Sensor – 5m Range, 1mm Resolution, Analog/PWM/Serial Output, Generic Nano CH340 Development Board (Soldered), 0.96" OLED Display 128x64, Tactile Push Button Switch, 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 (height_station.ino).
About ₹2,677 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Analog output scaling on MaxBotix HRLV sensors; Calibrating with a known mounting height; Averaging for a steady reading.
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.