Gas Leak Detection and SMS Alert System with Dual Sensor Monitoring
Dual Gas Sensor Safety System with Arduino, MQ-2 Flammable Gas Detection, MQ-9 Carbon Monoxide
Detection, GSM SMS Alerts, and RTC Timestamping
Category: Embedded Systems, Safety, Gas Detection, SMS Alert
Tools & Technologies: Arduino, MQ-2 Gas Sensor (Flammable), MQ-9 Gas Sensor (CO), SIM800L GSM Module,
DS1307 RTC, 16x2 I2C LCD, Buzzer, LED Indicators, Arduino IDE
Status: Completed
Introduction
This project implements a dual-sensor gas leak detection system for residential and industrial
safety applications. The system uses an MQ-2 sensor for detecting flammable gases (LPG, propane,
methane) and an MQ-9 sensor specifically for carbon monoxide (CO) detection. When either sensor
detects gas concentrations above configurable thresholds, the system triggers an audible buzzer
alarm, activates indicator LEDs, and sends detailed SMS alerts via the SIM800L GSM module to
pre-configured emergency contacts. Each SMS includes the gas type, concentration percentage, and
precise date/time from the DS1307 RTC module. The system also sends restoration SMS when gas levels
return to safe ranges, providing complete event lifecycle tracking.
System Overview
Aim and Objectives
Aim:
Design and develop a dual-sensor gas leak detection system with GSM SMS
alerting and RTC timestamping for comprehensive safety monitoring.
Objectives:
- Detect flammable gases (LPG, propane, methane) using the MQ-2 sensor with configurable
threshold.
- Detect carbon monoxide (CO) using the MQ-9 sensor for toxic gas monitoring.
- Send detailed SMS alerts with gas type, concentration, date, and time via SIM800L GSM.
- Provide audible buzzer alarm and visual LED indicators for immediate local notification.
- Display real-time gas status and date/time on 16x2 I2C LCD with transitioning screens.
- Send restoration SMS when gas levels return to safe ranges for complete event tracking.
Features & Deliverables
- Dual Gas Sensing: MQ-2 for flammable gases and MQ-9 for carbon monoxide with
independent threshold monitoring.
- SMS Emergency Alerts: Detailed SMS with gas type, concentration %, and
timestamp sent to emergency contacts via GSM.
- Restoration Notifications: "No Harmful Gas Detected" SMS sent when conditions
return to safe levels.
- RTC Timestamping: DS1307 provides accurate date/time for all alert events and
LCD display.
- LCD Status Display: 16x2 LCD with transitioning screens showing date/time and
gas concentration status.
- Audible Alarm: Toggling buzzer pattern on gas detection for immediate occupant
notification.
- Visual Indicators: Dedicated LED per gas sensor for quick visual identification
of which gas is detected.
Process / Methodology
Hardware Assembly
Components: Arduino, MQ-2 Sensor, MQ-9 Sensor, SIM800L GSM, DS1307 RTC, 16x2 I2C LCD, Buzzer, 2×
LEDs.
- Connected MQ-2 and MQ-9 gas sensors to analog inputs for independent gas concentration readings.
- Integrated SIM800L GSM module via SoftwareSerial for SMS communication.
- Configured DS1307 RTC via I2C for accurate real-time clock and date tracking.
- Assembled in a wall-mountable enclosure for permanent installation.
Software Development
- Implemented analog-to-percentage gas concentration mapping for both sensors.
- Programmed SMS alert logic with gas type identification and timestamp inclusion.
- Created LCD screen transition routine showing alternating date/time and gas status views.
- Added state tracking to prevent duplicate alerts and send one-time restoration messages.
Testing & Calibration
- Calibrated MQ-2 and MQ-9 sensor thresholds against known gas concentrations.
- Tested SMS delivery reliability and latency across different network conditions.
- Validated restoration SMS logic after gas concentration drops below threshold.
Challenges & Solutions
- Challenge: MQ sensor warm-up period causing false readings during initial
power-on.
Solution: Implemented a warm-up delay period and ignored readings during the
first 60 seconds after power-on.
- Challenge: GSM module power spikes causing Arduino brown-out resets.
Solution: Used separate power regulation with bulk capacitors for SIM800L power
supply.
- Challenge: Cross-sensitivity between MQ-2 and MQ-9 sensors for overlapping gas
types.
Solution: Used independent thresholds and identified gas type based on primary
sensor sensitivity.
Results & Impact
- Dual Detection Coverage: Successfully detected both flammable gases and carbon
monoxide independently.
- Rapid Alerting: SMS delivered within seconds of threshold breach with accurate
gas identification.
- Complete Event Tracking: Alert and restoration SMS provided full lifecycle
monitoring of gas events.
- Timestamped Records: RTC-based timestamps enabled post-incident analysis of gas
leak timing.
Future Enhancements
- Add WiFi connectivity for cloud-based gas event logging and historical analysis.
- Implement automatic gas valve shutoff relay for critical leak situations.
- Add additional sensors (smoke, temperature) for comprehensive fire and gas safety.
- Develop mobile app for real-time monitoring and alert configuration.
Demonstration / Access
- GitHub Repository: Coming
soon
- Live Demonstration Video: Coming
soon