LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsLaser particle sensors pull air past a laser with a small fan and count the light scattered by each particle. The Asair APM10 reports PM1.0, PM2.5 and PM10 over UART in a Plantower-style frame that starts 0x42 0x4D; check the frame layout in Asair's datasheet for your version. The ESP32 reads it and shows the values on an OLED with a simple good/moderate/poor label.
Tick anything you already have and the total updates.
Asair APM10 laser PM sensor
Follow the colours: red is power, dark grey is ground, blue is a signal.
5 V USB supply.
pm_monitor.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 buf[32];
bool readFrame(int &pm25, int &pm10) {
while (Serial2.available() >= 32) {
if (Serial2.read() != 0x42 || Serial2.peek() != 0x4D) continue;
buf[0] = 0x42; Serial2.readBytes(buf + 1, 31);
uint16_t sum = 0;
for (int i = 0; i < 30; i++) sum += buf[i];
if (sum != (buf[30] << 8 | buf[31])) return false;
pm25 = buf[12] << 8 | buf[13]; // atmospheric PM2.5 (check datasheet offsets)
pm10 = buf[14] << 8 | buf[15];
return true;
}
return false;
}
void setup() { Serial2.begin(9600, SERIAL_8N1, 16, 17); oled.begin(SSD1306_SWITCHCAPVCC, 0x3C); }
void loop() {
int pm25, pm10;
if (readFrame(pm25, pm10)) {
const char* label = pm25 <= 30 ? "PM2.5 good" : pm25 <= 60 ? "PM2.5 moderate" : "PM2.5 poor";
big(label, pm25, 0, "ug/m3");
oled.setTextSize(1); oled.setCursor(0, 56); oled.print("PM10 "); oled.print(pm10); oled.display();
}
delay(200);
}
TX and RX swapped, or the sensor needs a 'start measurement' command; check the datasheet.
This version uses a different frame length; adjust the code to the datasheet.
Smoke, incense or cooking nearby; also keep the inlet clear of dust buildup.
They follow India's AQI breakpoints for PM2.5: up to 30 good, 31-60 satisfactory, higher is worse.
The fan and laser last years in normal use; switch it off between readings to extend life.
Yes, it is in the same frame; see the datasheet offset.
5 parts: Asair APM10 Laser Particle Detection Sensor – Digital PM2.5 Sensor Module, ESP32-WROOM-32 38-Pin Development Board, 0.96" OLED Display 128x64, 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 (pm_monitor.ino).
About ₹1,474 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
How laser particle counters work; Parsing a framed UART protocol with a checksum; What PM2.5 and PM10 numbers mean.
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.