An Arduino-based fire detection alarm that uses an MQ-2 gas/smoke sensor to monitor air quality in real time, displays status on a 16x2 I2C LCD, and triggers a buzzer and LED alert on smoke detection.
The Fire Alarm System is a smoke and fire detection project built on an Arduino UNO. An MQ-2 gas sensor continuously reads analog smoke levels and classifies them into three severity tiers — LOW, MEDIUM, and HIGH. The system displays the current status on a 16x2 I2C LCD screen and activates a buzzer and LED indicator when dangerous smoke levels are detected.
- 🌫️ Three-tier detection — classifies smoke levels as LOW, MEDIUM, or HIGH based on configurable thresholds
- 📺 Real-time LCD display — 16x2 I2C LCD shows live status and smoke level
- 🔔 Buzzer alert — audible alarm triggers only at HIGH smoke level
- 💡 LED indicator — lights up at MEDIUM and HIGH levels as a visual warning
- 🖥️ Serial monitoring — raw sensor values streamed via Serial Monitor (9600 baud) for calibration and debugging
| Component | Quantity |
|---|---|
| Arduino UNO | 1 |
| MQ-2 Gas / Smoke Sensor | 1 |
| 16x2 I2C LCD Display | 1 |
| Piezo Buzzer | 1 |
| LED (Blue) | 1 |
| Resistor (220Ω) | 1 |
| Breadboard | 1 |
| Jumper Wires | As needed |
| Component | Pin | Arduino Pin |
|---|---|---|
| MQ-2 Sensor | VCC | 5V |
| MQ-2 Sensor | GND | GND |
| MQ-2 Sensor | AOUT | A0 |
| LCD (I2C) | VCC | 5V |
| LCD (I2C) | GND | GND |
| LCD (I2C) | SDA | A4 |
| LCD (I2C) | SCL | A5 |
| Buzzer | Signal | Digital 8 |
| LED (+ 220Ω resistor) | Anode | Digital 9 |
Built and simulated in Tinkercad
Breadboard View:
Schematic View:
- Arduino IDE (1.8.x or 2.x)
LiquidCrystal_I2Clibrary
Install the library via Arduino IDE Library Manager:
Sketch → Include Library → Manage Libraries → Search "LiquidCrystal I2C" → Install
- Clone the repository
git clone https://github.com/deep-chatterjee/Fire-Alarm-System.git
cd Fire-Alarm-System-
Open the sketch
- Open
Fire_Alarm_System.inoin the Arduino IDE - Select your board: Arduino UNO
- Select the correct COM port
- Open
-
Upload to your board
- Click Upload
- Open Serial Monitor (baud rate:
9600) to view live sensor readings
MQ-2 sensor reads analog smoke level (0–1023)
↓
Compare against thresholds
┌──────────┬───────────┬──────────┐
│ < 300 │ 300–449 │ ≥ 450 │
│ LOW │ MEDIUM │ HIGH │
└──────────┴───────────┴──────────┘
↓ ↓ ↓
LCD: SAFE LCD: Warning LCD: FIRE ALERT!!!
Buzzer: OFF Buzzer: OFF Buzzer: ON
LED: OFF LED: ON LED: ON
Thresholds can be adjusted in the sketch to suit your environment and sensor:
int lowThreshold = 300; // Below this → SAFE
int mediumThreshold = 450; // Between low & medium → WARNING
// Above medium → FIRE ALERTFire-Alarm-System/
├── Fire_Alarm_System.ino # Arduino sketch
├── Fire_Alarm_System_Circuit.png # Tinkercad breadboard view
├── Fire_Alarm_System_Schematic.png # Tinkercad schematic view
└── README.md
- Reading and interpreting analog sensor output from an MQ-2 gas sensor
- I2C communication protocol for driving an LCD display with only two signal wires
- Multi-threshold classification logic for graduated alert levels
- Coordinating multiple output peripherals (LCD, buzzer, LED) based on sensor state
- Add a temperature sensor (DHT11/DHT22) for combined fire and heat detection
- Implement PWM buzzer tones that escalate with smoke severity
- Send SMS or push notifications via GSM module (SIM800L) or Wi-Fi (ESP8266)
- Log sensor data to an SD card for historical analysis
- Add a manual reset button to silence the alarm
Deep Chatterjee
GitHub
This project is licensed under the MIT License — see LICENSE for details.

