LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsBenewake lidars send a standard 9-byte UART frame: 0x59 0x59, distance low and high bytes in centimetres, signal strength, then more data and a checksum (low byte of the sum of the first 8 bytes). The TF-Nova reads 0.1-14 m at 115200 baud. On a Nano, use the hardware serial pins (and unplug the sensor while uploading) because SoftwareSerial is unreliable at that speed.
Use it as a guide only; always watch where you are driving.
Tick anything you already have and the total updates.
Benewake TF-Nova lidar
Follow the colours: red is power, dark grey is ground, blue is a signal.
9-12 V adapter into the Nano's VIN.
garage_lidar.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();
}
uint8_t f[9];
int readCm() {
while (Serial.available() >= 9) {
if (Serial.read() != 0x59 || Serial.peek() != 0x59) continue;
f[0] = 0x59; Serial.readBytes(f + 1, 8);
uint8_t sum = 0;
for (int i = 0; i < 8; i++) sum += f[i];
if (sum != f[8]) return -1;
int strength = f[4] | (f[5] << 8);
if (strength < 100) return -1; // too weak to trust
return f[2] | (f[3] << 8);
}
return -1;
}
void setup() { Serial.begin(115200); oled.begin(SSD1306_SWITCHCAPVCC, 0x3C); }
void loop() {
int cm = readCm();
if (cm >= 0) big(cm < 50 ? "STOP" : "To the wall", cm, 0, "cm");
delay(50);
}
The lidar is on D0; disconnect it while uploading.
Low strength from dark paint; aim at the number plate or lower the strength limit.
Baud rate differs; check the TF-Nova's default in its manual.
It has a narrow beam and is not affected by soft surfaces, so readings are steadier.
Yes, on Serial2, which frees USB for debugging.
Yes, though range shortens in strong direct sun.
6 parts: Benewake TF-Nova Sensor Line Pattern Laser Beam LiDAR Sensor (Range: 0.1-14m) – UART/I2C/I/O, Generic Nano CH340 Development Board (Soldered), 0.96" OLED Display 128x64, DC Power Adapter (5.5x2.1mm), 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 intermediate project and takes about 2 hours. The build on this page has 5 steps.
No. This page has the complete, tested code (garage_lidar.ino).
About ₹5,469 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Benewake lidar frame format; Using signal strength to reject bad readings; Sharing the Nano's hardware UART.
Use it as a guide only; always watch where you are driving.
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.