LPG gas leak alarm
A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.
Shop by category
Shop all componentsCO2 tells you whether a room needs fresh air; PM2.5 tells you whether the outside air is clean enough to let in. The Sensirion SCD30 is a true NDIR CO2 sensor that also reports temperature and humidity over I2C. The Nova SDS011 is a laser particle sensor with a fan that sends PM2.5 and PM10 once a second in a 10-byte serial frame. One ESP32 reads both, so you can decide: open the window if CO2 is high and PM2.5 is low, or run a purifier if both are high.
Tick anything you already have and the total updates.
Sensirion SCD30 NDIR CO2 sensor
Nova SDS011 PM2.5 / PM10 sensor
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB 5 V; both sensors together draw up to about 100 mA.
air_station.inoVerify & upload in Electrolark#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 oled(128, 64, &Wire, -1);
#include <SparkFun_SCD30_Arduino_Library.h>
SCD30 co2;
float pm25 = -1, pm10 = -1;
void readSds() { // AA C0 pm25L pm25H pm10L pm10H id1 id2 sum AB
while (Serial2.available() >= 10) {
if (Serial2.read() != 0xAA) continue;
uint8_t f[9];
Serial2.readBytes(f, 9);
if (f[0] != 0xC0 || f[8] != 0xAB) continue;
uint8_t sum = 0;
for (int i = 1; i <= 6; i++) sum += f[i];
if (sum != f[7]) continue;
pm25 = (f[1] + f[2] * 256) / 10.0;
pm10 = (f[3] + f[4] * 256) / 10.0;
}
}
void setup() {
Wire.begin();
Serial2.begin(9600, SERIAL_8N1, 16, 17);
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C); oled.setTextColor(WHITE);
co2.begin();
}
void loop() {
readSds();
if (!co2.dataAvailable()) { delay(200); return; }
int ppm = co2.getCO2();
oled.clearDisplay(); oled.setTextSize(1); oled.setCursor(0, 0);
oled.print("CO2 "); oled.print(ppm); oled.println(" ppm");
oled.print("PM2.5 "); oled.print(pm25, 0); oled.print(" PM10 "); oled.println(pm10, 0);
oled.print(co2.getTemperature(), 1); oled.print(" C "); oled.print(co2.getHumidity(), 0); oled.println(" %");
oled.setCursor(0, 44); oled.setTextSize(1);
if (ppm > 1000 && pm25 < 60) oled.print("Open a window");
else if (ppm > 1000) oled.print("Stuffy AND smoky:\nair out briefly, purify");
else if (pm25 > 60) oled.print("Keep windows shut,\nrun a purifier");
else oled.print("Air is good");
oled.display();
}
SDS011 TX is not on GPIO16, or its fan has no 5 V.
Check the SCD30 I2C wires; it can take a few seconds after power-up.
Give it fresh outdoor air now and then, or do a forced calibration at 420 ppm.
CO2 and PM2.5 need different sensing methods; no single cheap sensor does both well.
Only under cover; the SDS011 must stay dry and the SCD30 is made for indoor air.
Yes, add MQTT or a Google Sheet over the ESP32's Wi-Fi.
6 parts: Sensirion SCD30 NDIR CO₂, Temperature & Humidity Sensor Module – I²C/UART Output, Nova Sensor PM Sensor SDS011 High Precision Laser PM2.5/PM10 Air Quality Detection Sensor – UART/PWM Output, 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.
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 (air_station.ino).
About ₹5,403 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
NDIR CO2 vs laser particle sensing; Reading one sensor over I2C and one over UART; Combining two readings into one decision.
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.