An innovative IoT-based solution for detecting LPG gas leaks and automating the gas cylinder booking process using Raspberry Pi Pico.
This project presents a smart gas safety system that addresses critical challenges associated with Liquefied Petroleum Gas (LPG) usage in households. It combines real-time gas leakage detection with automatic gas booking alerts based on cylinder weight monitoring.
- Real-time Gas Leakage Detection - Continuous monitoring using MQ-135 gas sensor
- Automatic Cylinder Weight Monitoring - Load cell tracks remaining gas
- SMS Alerts - Automatic notifications when cylinder is running low
- Emergency Response - Automatic valve lock and buzzer alarm on gas detection
- Remote Monitoring - WiFi-based connectivity for real-time status tracking
- Fire Detection - Integrated fire sensor for comprehensive safety
Gas leakage incidents in households pose significant safety hazards including:
- Risk of explosions and fires
- Health hazards (headaches, dizziness, nausea)
- Manual gas booking processes that lead to shortages
- No reliable remote monitoring systems
The system is built using the following key components:
| Component | Purpose |
|---|---|
| Raspberry Pi Pico | Main microcontroller for system control |
| MQ-135 Gas Sensor | Detects LPG leakage in the air |
| Fire Sensor | Detects flames and high temperatures |
| Load Cell | Measures the weight of gas cylinder |
| LCD Display | Shows real-time status and alerts |
| Buzzer | Audio alert for emergencies |
| WiFi Module | Enables remote monitoring and SMS alerts |
| Motor | Automatically locks the gas valve |
| Power Supply | Regulated power delivery |
lpg-leakage-detection/
├── README.md
├── code/
│ └── main.py
├── images/
│ ├── buzzer/
│ │ └── buzzer.jpg
│ ├── exhaust_fan/
│ │ └── exhaust_fan.jpg
│ ├── fire_sensor/
│ │ └── fire_sensor.jpg
│ ├── gas_sensor/
│ │ └── gas_sensor.jpg
│ ├── LCD/
│ │ └── LCD.jpg
│ ├── load_cell/
│ │ └── load_cell.jpg
│ ├── prototype/
│ │ └── prototype.jpg
│ ├── raspi/
│ │ └── raspi.jpg
│ └── WiFi/
│ └── WiFi.jpg
├── schematics/
│ └── circuit_diagram.pdf
└── documentation/
└── project_report.pdf
The buzzer serves as the audio alert mechanism for the system. It activates when gas leakage is detected above threshold levels, cylinder weight falls below minimum threshold, or fire is detected in the vicinity.
Specifications:
- Operating Voltage: 5V DC
- Sound Pressure: Greater than 85dB at 10cm
- Frequency: 2.5kHz
- Activation: GPIO Pin 8
- Purpose: Immediate audio alert during emergency conditions
Functionality: The buzzer provides continuous audible alerts until the hazardous condition is resolved, ensuring users are immediately aware of any safety concerns.
Integrated exhaust mechanism to help ventilate leaked gas and prevent accumulation in the kitchen area.
Purpose: Assists in clearing hazardous gas from the kitchen area during leakage events, working in conjunction with the valve locking mechanism.
Operation: Activates automatically when gas concentration exceeds safe limits to facilitate rapid gas dispersal.
Dedicated sensor for detecting flames and abnormal temperature conditions in the vicinity of the cooking appliance.
Specifications:
- Detection Range: Up to 1 meter
- Response Time: Less than 100 milliseconds
- Input Pin: GPIO Pin 21
- Logic: 1 = No Fire Detected, 0 = Fire Detected
- Sensitivity: Adjustable potentiometer
Functionality: Works in parallel with the gas sensor to provide comprehensive safety coverage, triggering maximum alert protocols when flames are detected.
Primary sensor for detecting LPG concentration in the air. This semiconductor-based sensor is specifically calibrated for household LPG detection.
Specifications:
- Sensor Type: Tin Dioxide (SnO2) Semiconductor
- Detectable Gases: LPG, Propane, Butane
- Sensitivity Adjustment: Potentiometer on module for fine-tuning
- Output Type: Analog signal
- Output Pin: ADC Pin 26
- Detection Threshold: Greater than 50ppm triggers alarm
- Warm-up Time: 24 hours for initial calibration
Calibration: The sensor requires calibration in a controlled environment with known LPG concentration to ensure accurate detection.
Real-time status display showing critical system parameters and alerts. The 16x2 character display provides clear, readable information to users.
Display Information:
- Current cylinder weight in grams
- Gas concentration level in ppm
- Fire detection status
- Booking alerts and system status
Specifications:
- Display Type: 16x2 Character LCD
- Interface Mode: 4-bit Mode
- GPIO Pins Used: 10, 11, 12, 13, 14, 15
- Refresh Rate: Real-time updates every 1 second
- Visibility: Clear in normal lighting conditions
Configuration: Connected via GPIO pins with register select, enable, and data pins configured for 4-bit operation mode.
Precision weight measurement sensor integrated with HX711 amplifier for accurate gas cylinder weight monitoring.
Specifications:
- Maximum Capacity: 100 kilograms
- Output Type: Digital signal via HX711 ADC
- Data Pin: GPIO 5
- Clock Pin: GPIO 6
- Measurement Range: 0 to 100kg with high precision
- Alert Threshold: Weight less than 100 grams triggers booking alert
Calibration Process: The load cell is zero-calibrated during system initialization to ensure accurate weight measurements. The tare function eliminates offset and provides baseline measurements.
Function: Continuous monitoring ensures users are alerted before gas runs completely out, preventing inconvenient situations.
The complete assembled system including PCB integration and protective housing designed for kitchen environment installation.
Features:
- Compact design suitable for kitchen installation
- All components integrated on custom PCB board
- Water-resistant casing for durability
- Easy installation and maintenance procedures
- Professional enclosure with labeled connections
Construction: The prototype integrates all sensors and actuators on a single printed circuit board, reducing wiring complexity and improving reliability.
The central processing unit of the system. This microcontroller board handles all sensor inputs, decision-making algorithms, and control outputs.
Specifications:
- Processor: ARM Cortex M0+ Dual Core @ 133MHz
- RAM: 264KB
- Flash Storage: 2MB for code and data
- GPIO Pins: 26 total (20 usable for external connections)
- ADC Channels: 3 channels for analog input
- Built-in WiFi: 2.4GHz wireless connectivity
- Programming Language: MicroPython
- Power Consumption: Optimized for low-power operation
Capabilities: Supports simultaneous sensor reading, data processing, control signal generation, and wireless communication.
Enables remote connectivity and cloud integration for monitoring and alerts. The WiFi module establishes secure communication between the IoT device and cloud servers.
Primary Functions:
- SMS alert transmission when gas level is low
- Remote monitoring via mobile application
- Secure data transmission with encryption
- Cloud storage of historical sensor readings
- Real-time status updates to user devices
Specifications:
- Wireless Protocol: WiFi 802.11b/g/n Standard
- Frequency Band: 2.4GHz
- Interface: UART Serial Connection at 9600 baud rate
- Transmission Range: Up to 100 meters in open space
- Data Security: Encrypted transmission protocols
Integration: Communicates with Raspberry Pi Pico via UART (Universal Asynchronous Receiver Transmitter) at 9600 baud rate.
The system operates on a continuous monitoring and response framework:
-
Initialization Phase: All sensors are calibrated and zeroed. System enters continuous monitoring mode.
-
Continuous Monitoring: Sensors continuously read gas concentration, temperature, cylinder weight, and fire presence at regular intervals.
-
Data Processing: Raspberry Pi Pico processes sensor data and compares values against predefined safety thresholds.
-
Alert Generation: When thresholds are exceeded, the system triggers appropriate responses:
- Gas concentration exceeds 50ppm: Buzzer activates and motor locks valve
- Cylinder weight falls below 100 grams: SMS alert sent to user for booking
- Fire is detected: Maximum alert protocol activated
- System status updates: Data transmitted via WiFi every 10 seconds
-
Remote Monitoring: All data is transmitted wirelessly to cloud servers for real-time monitoring via mobile application.
-
LCD Display: Real-time status is displayed on LCD with one-second refresh rate.
The system incorporates multiple safety mechanisms to protect users and property:
Automatic Response Systems
- Automatic Valve Lock: Motor-controlled solenoid valve closes immediately when gas leak is detected
- Dual Alert System: Both audio (buzzer) and visual (LCD display) alerts inform users
- Emergency Override: Manual controls available for critical situations requiring immediate intervention
Threshold-based Operation
- Customizable sensitivity settings for all sensors
- Graduated alert levels based on hazard severity
- Hysteresis in threshold detection to prevent false alarms
Data Logging and Analysis
- All events recorded with timestamp for post-incident analysis
- Historical data available for identifying patterns
- Audit trail for safety compliance verification
System Reliability
- Redundant sensor inputs for critical functions
- Continuous self-diagnostic checks
- Watchdog timer to detect system failures
The system operates based on the following safety thresholds:
| Parameter | Threshold Value | Action Taken | Priority |
|---|---|---|---|
| Gas Concentration | Greater than 50ppm | Alarm activation, Valve lock | Critical |
| Cylinder Weight | Less than 100 grams | SMS alert sent to user | High |
| Fire Detection | Fire detected | Maximum alert protocol | Critical |
| System Status Update | Every 10 seconds | WiFi data transmission | Routine |
| LCD Refresh | Every 1 second | Display update | Routine |
-
Component Preparation: Gather all components listed in hardware requirements. Verify proper functioning of each component before assembly.
-
PCB Assembly: Mount all sensors and components on the printed circuit board according to the provided circuit diagram. Ensure proper soldering of all connections.
-
Gas Sensor Calibration:
- Place the MQ-135 sensor in a controlled environment with known LPG concentration
- Adjust the sensitivity potentiometer until sensor readings accurately reflect gas concentration
- Record calibration parameters for future reference
-
Fire Sensor Testing:
- Test the sensor's response to flames or high temperatures
- Adjust sensitivity to ensure reliable fire detection without false alarms
-
Load Cell Calibration:
- Place the load cell assembly in its operational position
- Zero-calibrate the load cell using the system initialization routine
- Verify weight measurements with known test weights
-
Electrical Connections: Connect all sensors and actuators to designated GPIO pins according to circuit diagram specifications.
-
Power Supply Verification: Connect regulated power supply and verify stable voltage delivery to all components.
-
WiFi Module Configuration: Establish initial WiFi connection and configure network parameters.
# Clone the project repository
git clone https://github.com/yourusername/lpg-leakage-detection.git
# Navigate to project directory
cd lpg-leakage-detection
# Upload firmware to Raspberry Pi Pico
# Use Thonny IDE or similar tool for firmware installation
# Ensure MicroPython is installed on the Raspberry Pi Pico board
# Load main.py code to the device- Verify all GPIO connections
- Test sensor readings in safe environment
- Verify alarm and alert mechanisms
- Test WiFi connectivity and data transmission
- Perform full system integration test
The main program is written in MicroPython and implements the following core functionalities:
Core Modules:
- GPIO Control: Manages all input and output pins for sensors and actuators
- ADC Reading: Processes analog signals from gas and fire sensors
- HX711 Interface: Communicates with load cell amplifier for weight measurement
- LCD Control: Manages 4-bit mode communication with display
- WiFi Communication: Handles wireless data transmission
- Data Processing: Implements threshold detection and alert generation
- Real-time Control: Manages immediate responses to emergency conditions
Key Functions:
- Sensor initialization and calibration
- Continuous data acquisition loop
- Threshold comparison logic
- Alert generation and management
- LCD display update routine
- WiFi data transmission protocol
The project has been designed to achieve the following specific objectives:
-
Real-time Monitoring: Implement a robust gas level monitoring system using advanced sensors enabling real-time tracking of LPG levels within cylinders.
-
Proactive Alerting: Provide users with timely alerts when gas levels approach critical thresholds, eliminating unexpected gas shortages.
-
Enhanced Safety: Integrate gas and fire sensors for immediate detection of potential leakages or fire incidents associated with LPG usage.
-
Emergency Response: Employ an efficient alert mechanism including visual signals on LCD display and audible alerts through buzzer for immediate user notification.
-
Remote Access: Enable remote monitoring and control through online platform allowing users to check gas levels and receive alerts remotely.
-
Data Security: Implement robust security measures to safeguard user data during online transmissions, ensuring compliance with privacy regulations.
-
User Convenience: Streamline the gas booking process through automatic notifications and online ordering capabilities.
The implemented system has demonstrated the following performance characteristics:
- Accurate and reliable LPG leak detection within specified thresholds
- Dependable automatic valve locking mechanism
- Prompt SMS alert transmission for low cylinder levels
- Consistent real-time monitoring and display update
- Stable WiFi connectivity and remote monitoring capability
The proposed system provides advantages over traditional LPG leak detection systems:
- Significantly lower cost compared to conventional systems
- Easier installation without requiring professional technicians
- Higher reliability through integrated redundancy
- Automatic response capabilities reducing human reaction time
- Comprehensive monitoring combining multiple hazard detection
The system architecture provides a foundation for several planned enhancements:
-
Mobile Application Development: Create dedicated iOS and Android applications for improved user interface and remote monitoring capabilities.
-
Cloud Analytics Dashboard: Develop web-based dashboard for historical data analysis and pattern recognition.
-
Automated Delivery System: Integrate automatic CNG cylinder delivery coordination directly through the system.
-
Smart Home Integration: Develop compatibility with popular IoT and smart home platforms.
-
Predictive Maintenance: Implement machine learning algorithms for sensor maintenance prediction.
-
Multi-language Support: Expand interface language options for diverse user bases.
-
Historical Analysis Tools: Provide detailed reporting on gas usage patterns and safety events.
This project has been developed by a dedicated team of engineering students under faculty guidance:
Team Members:
- Bondila Saichakradhar (22BCE20352)
- Raghavaredddy Sricharan Reddy (22BCE7460)
- Mamidala Thoraj (22BCE8134)
- Gudi Harshavardhan Reddy (22BCE8704)
- Chinnapattu S Hari Krishna (22BCE9001)
- Kosiredddi Ram Sai Eswar (22BCE9148)
Faculty Guide: Dr. Varun Kumar Meregu, Department of Mathematics
[1] Mr. Sameer Jagtap, Prajkta Bhosale, Priyanka Zanzane, Jyoti Ghogare. "LPG Gas Weight and Leakage Detection System Using IoT." International Journal for Research in Applied Science and Engineering Technology, Volume 4, Issue 3, March 2016, Pages 716-720.
[2] Arun Raj, Athira Viswanathan, Athul T S. "LPG Gas Monitoring System." International Journal of Innovative Technology and Research, Volume 3, Issue 2, February 2015, Pages 1957-1960.
[3] S Shyamaladevi, V. G. Rajaramya, P. Rajasekar, P. Sebastin Ashok. "ARM7 Based Automated High-Performance System for LPG Refill Booking and Leakage Detection." Journal of VLSI Design and Signal Processing, Volume 3, Issue 2, 2014.
[4] S. Sharma, V. N. Mishra, R. Dwivedi, R. Das. "Classification of Gases and Odours Using Dynamic Response of Thick Film Gas Sensor Array." IEEE Conference on Sensors Journal, 2013.
This project is open-source and available for educational and research purposes under the MIT License. Users are encouraged to use, modify, and distribute the code for non-commercial applications.
Contributions to this project are welcome from the development community. To contribute:
- Fork the repository
- Create a feature branch for your contribution
- Make your improvements and modifications
- Submit a pull request with detailed description of changes
- Ensure all code follows the established coding standards
For questions, bug reports, or support regarding this project:
- Review the complete project documentation in the documentation folder
- Check the issue tracker on the GitHub repository for known issues
- Contact the development team through the repository's discussion forum
This system is designed to enhance safety in LPG handling but should not be considered a replacement for professional gas safety equipment and regular maintenance. Always follow local regulations, manufacturer guidelines, and professional safety standards for LPG installation, handling, and use. Professional gas safety audits are recommended before system deployment.
Development Status: Complete and Tested Last Updated: December 2025 Version: 1.0 Release
For detailed project documentation, circuit diagrams, and implementation guides, please refer to the documentation and schematics folders in the repository.