Fire Detection System Using Arduino, MQ2, and Flame Sensor
Abstract
This project presents a dual-sensor fire detection system designed to detect
early-stage fires in indoor environments. It combines smoke detection via an
MQ2 gas sensor and flame detection via a flame sensor module, providing both
visual (LED) and auditory (buzzer) alerts. Implemented on the Arduino UNO
platform, the system is modular, cost-effective, and ready for IoT
integration , making it suitable for domestic safety applications and
prototyping.
1. Introduction
Fire hazards remain a major risk to life and property. Conventional fire alarm
systems, while effective, can be expensive and inaccessible in low-resource
areas. The proposed system addresses this gap by integrating smoke and flame
detection in a simple, low-cost setup. Key advantages include:
* Dual-sensor redundancy reduces false negatives.
* Immediate alerts via LED and buzzer.
* Arduino-based design allows scalability and customization.
2. System Architecture
2.1 Hardware Components
| Component | Purpose
|
| - | - |
| Arduino UNO | Microcontroller to process sensor data and control
outputs |
| MQ2 Gas Sensor | Analog smoke detection
|
| Flame Sensor Module | Digital flame detection
|
| Buzzer | Auditory alert
|
| LED (red) | Visual alert
|
| Resistors | Pull-down or current-limiting for stable readings and
LED |
2.2 Circuit Design
1. MQ2 Gas Sensor
* VCC → 5V
* GND → GND
* AOUT → A0 (analog read)
* Function: Measures smoke concentration; values above a threshold trigger an
alert.
2. Flame Sensor Module
* VCC → 5V
* GND → GND
* DO (digital output) → D2 (digital read)
* Function: Detects presence of flame; digital HIGH or LOW signals indicate
detection.
3. LED and Buzzer
* LED anode → D13, cathode → 220Ω resistor → GND
* Buzzer positive → D8, negative → GND
* Function: Activated when either smoke or flame is detected.
2.3 System Block Diagram
```
[MQ2 Gas Sensor] →|
|→ Arduino UNO → [LED + Buzzer]
[Flame Sensor] → |
```
Logic: Fire alert triggers when `MQ2_value > smokeThreshold` OR `Flame
sensor = HIGH`.
3. Software Implementation
The system is programmed in Arduino IDE with the following key
functionalities:
1. Sensor reading
* MQ2: `analogRead(A0)` → smoke density
* Flame sensor: `digitalRead(D2)` → flame presence
2. Threshold comparison
* Smoke threshold: adjustable (default 400)
* Flame sensor: digital HIGH indicates flame detected
3. Alert control
* LED (D13) and Buzzer (D8) activated when either sensor exceeds threshold
4. Serial monitoring
* Real-time data display for debugging and calibration
Code snippet (logic) :
```cpp
if (mq2Value > smokeThreshold || flameState == HIGH) {
digitalWrite(BUZZER, HIGH);
digitalWrite(LED, HIGH);
} else {
digitalWrite(BUZZER, LOW);
digitalWrite(LED, LOW);
}
```
4. Testing and Simulation
* MQ2 smoke simulation : Analog slider in Wokwi or real-world smoke source
* Flame sensor simulation : Use a small flame (candle) or digital HIGH input in
Wokwi
* LED + Buzzer : Confirm immediate visual and auditory alerts
Test Scenarios :
1. Smoke only → system triggers
2. Flame only → system triggers
3. Both → system triggers
4. No smoke or flame → system remains idle
5. Results and Discussion
* Dual-sensor redundancy ensures higher reliability.
* Visual and auditory alerts provide immediate warning.
* Threshold values can be calibrated for environmental conditions.
* Modular design allows integration with IoT notifications or automated
extinguishing systems.
7. Conclusion
The dual-sensor fire detection system is a low-cost, reliable, and modular
solution suitable for prototyping and small-scale deployment. Combining smoke
and flame detection improves reliability and ensures rapid response, making it
ideal for educational exhibitions or practical safety applications.
8. References
1. MQ2 Gas Sensor Datasheet – [SparkFun]([Link]
2. Flame Sensor Module KY-002 Datasheet – [Arduino Project
Hub]([Link]
3. Arduino UNO Technical Specs –
[Arduino]([Link]
4. Wokwi Arduino Simulator – [Wokwi]([Link]