

GasGuard
IoT and ML-based LPG monitoring system with ESP32 leak detection, automatic valve shutoff, real-time mobile alerts and refill prediction. Built with React Native, Firebase and Python.
- Size
- 100 × 100 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 14
- Nets
- 37
- Pads
- 78
- Tracks, vias
- 178, 40
- Routed
- Yes
- KiCad
- KiCad 10.0 (file 20260206)
- Created
- 15 Jun 2026
- Updated
- 16 Oct 2026
Overview
GasGuard is an open-source printed circuit board by pasinduh2002, from the pasinduh2002/GasGuard repository on GitHub, published under the MIT licence. It is a 2-layer board of 100 × 100 mm with 14 parts on 37 nets, routed with 178 tracks and 40 vias.
It is built around the AM2302. Its parts include 8 connectors, 3 ICs and 2 resistors. It belongs with the home automation and IoT boards of this library.
Main components
1README
README.md🔥 GasGuard
IoT & Machine Learning-Based LPG Monitoring and Safety System
Individual Design Project · 2026
Smart Monitoring · Early Detection · Safer LPG Usage
📌 Overview
GasGuard combines ESP32 sensors, automatic valve control, Firebase, and a React Native app to monitor LPG usage, detect leaks, and predict refill dates.
✨ Features
| Safety & Monitoring | Mobile & Delivery |
|---|---|
| Live LPG weight and percentage | Customer and supplier dashboards |
| Gas leak detection and alerts | Usage and cost tracking |
| Automatic valve shutoff | ML-based refill prediction |
| Temperature and humidity | Refill ordering and order tracking |
| Local LCD and buzzer alerts | Maps, location sharing, and chat |
🏗️ Architecture
Sensors → ESP32 → Firebase → React Native App
↓ ↑
Alarm + Valve Control ML PredictionsLeak detection and valve control operate locally without internet.
🧰 Technology Stack
🔌 Hardware
| Component | Connection |
|---|---|
| ESP32 DevKit V1 | Main controller |
| MQ-5 | GPIO 34 |
| DHT22 | GPIO 27 |
| 20 kg Load Cell + HX711 | DT: 25 · SCK: 26 |
| 16×2 I²C LCD | SDA: 21 · SCL: 22 |
| MG995 Servo | GPIO 13 |
| Buzzer | GPIO 19 |
| Green / Red LEDs | GPIO 23 / 32 |
| LM2596 | Voltage regulation |
Servo: separate regulated power line with common ground.
🚨 Leak Response
Gas Detected
↓
Red LED + Buzzer + LCD Warning
↓
Servo Closes Valve
↓
Firebase Event + Mobile Alert🤖 Depletion Prediction
| Item | Result |
|---|---|
| Model | Multiple Linear Regression |
| Dataset | 180 records · 5 kg cylinder |
| Inputs | 9 engineered features |
| Train / Test | 80% / 20% |
| Test R² | 0.9883 |
| MAE | 1.618 days |
| RMSE | 1.877 days |
| 5-Fold CV R² | 0.9316 ± 0.1093 |
Inputs include LPG weight, usage rate, rolling consumption, and refill history.
Limited dataset; performance across other households and cylinder sizes is not established.
📂 Repository
GasGuard/
├── assets/
├── Database/
├── GasGuard_App/
├── GasGuard_App Apk/
├── GasGuard_Diagnostics_Tools/
├── GasGuard_ML/
├── NewFullcode/
├── Testing_Codes/
├── LICENSE
└── README.md🚀 Quick Start
Firmware
Open NewFullcode/ in Arduino IDE, install dependencies, configure Wi-Fi/Firebase, and upload to ESP32.
Mobile App
cd GasGuard_App
npm install
npx react-native run-androidConfigure Firebase and Google Maps before running.
Machine Learning
cd GasGuard_ML
pip install numpy pandas scikit-learn matplotlib
python gasguard_model_training.py📸 Gallery
🔮 Next Steps
- Larger datasets and multiple cylinder sizes
- Battery backup and improved weight filtering
- Valve-fault monitoring
- Stronger authentication and Firebase App Check
- Long-term testing and delivery tracking
🔐 Security
Keep credentials out of Git. Configure Firebase Authentication, database rules, and API-key restrictions.
⚠️ Safety
Educational prototype - not a certified LPG safety system. Do not use it as a replacement for certified detectors, approved valves, or professional inspections.
👨💻 Developer
WALP Harsha
Electronics & Telecommunication Engineering Undergraduate
General Sir John Kotelawala Defence University · Sri Lanka 🇱🇰
📄 License
See LICENSE.
🔥 GasGuard · Smart Monitoring. Early Detection. Safer LPG Usage.
Parts
14| Qty | Value | Footprint | References |
|---|---|---|---|
| 2 | 10K | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R3, R4 |
| 2 | Conn_01x02 | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | J3, J4 |
| 1 | AM2302 | Sensor:ASAIR_AM2302_P2.54mm_Vertical | U3 |
| 1 | Buzzer | Buzzer_Beeper:Buzzer_12x9.5RM7.6 | BZ1 |
| 1 | Conn_01x04 | Connector:FanPinHeader_1x04_P2.54mm_Vertical | J7 |
| 1 | Green LED | Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical | J8 |
| 1 | I2c | Connector:FanPinHeader_1x04_P2.54mm_Vertical | J5 |
| 1 | MQ5 | Connector:FanPinHeader_1x04_P2.54mm_Vertical | J10 |
| 1 | RED LED | Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical | J9 |
| 1 | Servo | Connector:FanPinHeader_1x03_P2.54mm_Vertical | J6 |
| 1 | YAAJ_DCDC_StepDown_LM2596 | chinese:YAAJ_DCDC_StepDown_LM2596 | U2 |
| 1 | ~ | 30pin:ESP32_30pin | U4 |
Questions
How big is the GasGuard PCB?
It measures 100 × 100 mm and has 2 copper layers, 1.6 mm thick.
What parts does the GasGuard use?
14 parts, built around the AM2302. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the GasGuard KiCad files?
From the pasinduh2002/GasGuard repository on GitHub, at the commit this page was made from: the board is GasGuard_KiCAD_Files/GasGuard.kicad_pcb and its schematic GasGuard_KiCAD_Files/GasGuard.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the GasGuard design in my own project?
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).
Similar boards
- 4 layers101.6 × 141.7 mm

- 2 layers46.5 × 38.1 mm

Mainboard smd
OpenHumidistat/hardware
KiCAD design files for PCBs for the OpenHumidistat humidity controller
30 parts4 - 2 layers

Mars rover navigation system
tjiuce/rover
Rover Navigation Optimization System (R-NOS): An ESP32-powered autonomous robotic prototype designed for real-time environmental monitoring.
4 parts4 - 2 layers

Weather balloon V1.0
Launchpad-Incubator/weather-balloon
The research repository for Launchpad's flat-packed weather balloons.
3 parts2 - 2 layers

Priject 2 ESP32 build
Aanuoluwap/555blinker
This repository contains electronics design projects created using KiCad.
12 parts1MIT - 2 layers125 × 68 mm

- 2 layers94 × 68.5 mm

- 2 layers
