Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO-Based Fire Detection System with GSM Alert and LCD Display

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Fire Detection System with GSM Alert and LCD Display

Circuit Documentation

Summary

This circuit is a fire detection and alert system. It utilizes various sensors to detect fire, gas, and temperature anomalies. When a hazard is detected, the system activates a water pump, a buzzer, and an LED indicator. Additionally, it sends an SMS alert using a GSM module. The system is controlled by an Arduino UNO microcontroller, and it displays status information on a 16x2 I2C LCD.

Component List

  1. KY-026 Flame Sensor

    • Pins: AO, GND, VCC, DO
    • Description: Detects the presence of flame or fire.
    • Purpose in Circuit: Provides analog output to indicate flame intensity.
  2. DS18B20 Temperature Sensor

    • Pins: GND, VCC, OUT
    • Description: Measures temperature.
    • Purpose in Circuit: Provides temperature readings to the microcontroller.
  3. MKE-S07 MQ-3 Alcohol Sensor

    • Pins: GND, 5V, SIG
    • Description: Detects alcohol concentration in the air.
    • Purpose in Circuit: Provides analog output to indicate alcohol levels.
  4. Buzzer Module

    • Pins: GND, Vcc, I/O
    • Description: Emits sound when activated.
    • Purpose in Circuit: Alerts users when a hazard is detected.
  5. LED: Two Pin (red)

    • Pins: Cathode, Anode
    • Description: Emits light when activated.
    • Purpose in Circuit: Visual indicator for hazard detection.
  6. Water Pump

    • Pins: VCC, GND
    • Description: Pumps water when activated.
    • Purpose in Circuit: Extinguishes fire when a hazard is detected.
  7. 16x2 I2C LCD

    • Pins: GND, VCC, SDA, SCL
    • Description: Displays information.
    • Purpose in Circuit: Shows system status and sensor readings.
  8. Arduino UNO

    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
    • Description: Microcontroller.
    • Purpose in Circuit: Controls the entire system.
  9. MQ-5 Gas Sensor

    • Pins: VCC, GND, Digi Out, Analog out
    • Description: Detects gas concentration in the air.
    • Purpose in Circuit: Provides analog output to indicate gas levels.
  10. 12v Relay

    • Pins: NO, COM, NC, IN, DC-, DC+
    • Description: Switches high-power devices.
    • Purpose in Circuit: Controls the water pump.
  11. SIM900A GSM Module

    • Pins: GND, DB9-3 (RXD), DB9-2 (TXD), 5V, 3VR, 5VR, 3VT, 5VT, VCC, Ring, RESTART, RESET, STATUS
    • Description: Sends SMS alerts.
    • Purpose in Circuit: Sends SMS when a hazard is detected.
  12. 5v Battery

    • Pins: Positive, Negative
    • Description: Provides 5V power supply.
    • Purpose in Circuit: Powers the Arduino UNO and other 5V components.
  13. 12v Battery

    • Pins: +, -
    • Description: Provides 12V power supply.
    • Purpose in Circuit: Powers the water pump and relay.

Wiring Details

KY-026 Flame Sensor

DS18B20 Temperature Sensor

MKE-S07 MQ-3 Alcohol Sensor

Buzzer Module

LED: Two Pin (red)

Water Pump

16x2 I2C LCD

Arduino UNO

MQ-5 Gas Sensor

12v Relay

SIM900A GSM Module

5v Battery

12v Battery

Code Documentation

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SoftwareSerial.h>
#include <OneWire.h>
#include <DallasTemperature.h>

// Pin definitions
const int flameSensorPin = A3;
const int gasSensorPin = A0;
const int tempSensorPin = A1;
const int smokeSensorPin = A2;
const int waterPumpPin = 8;
const int buzzerPin = 9;
const int ledPin = 10;

// GSM module pins
SoftwareSerial gsm(6, 7); // RX, TX

// Temperature sensor setup
OneWire oneWire(tempSensorPin);
DallasTemperature sensors(&oneWire);

// LCD setup
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  Serial.begin(9600);
  gsm.begin(9600);
  sensors.begin();
  lcd.begin(0x27, 16, 2);
  lcd.backlight();

  pinMode(waterPumpPin, OUTPUT);
  pinMode(buzzerPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  pinMode(flameSensorPin, INPUT);
  pinMode(gasSensorPin, INPUT);
  pinMode(smokeSensorPin, INPUT);

  lcd.setCursor(0, 0);
  lcd.print("Fire Detection");
  lcd.setCursor(0, 1);
  lcd.print("System Ready");
  delay(2000);
  lcd.clear();
}

void loop() {
  sensors.requestTemperatures();
  float temperature = sensors.getTempCByIndex(0);
  int flameValue = analogRead(flameSensorPin);
  int gasValue = analogRead(gasSensorPin);
  int smokeValue = analogRead(smokeSensorPin);

  lcd.setCursor(0, 0);
  lcd.print("Temp: ");
  lcd.print(temperature);
  lcd.print("C");

  lcd.setCursor(0, 1);
  lcd.print("Flame: ");
  lcd.print(flameValue);

  lcd.print(" Gas: ");
  lcd.print(gasValue);

  lcd.print(" Smoke: ");
  lcd.print(smokeValue);

  if (flameValue > 500 || gasValue > 300 || smokeValue > 300 || temperature > 50) {
    digitalWrite(waterPumpPin, HIGH);
    digitalWrite(buzzerPin, HIGH);
    digitalWrite(ledPin, HIGH);
    sendSMS();
  } else {
    digitalWrite(waterPumpPin, LOW);
    digitalWrite(buzzerPin, LOW);
    digitalWrite(ledPin, LOW