Project showcase
Fire and Smoke Alarm

Fire and Smoke Alarm © GPL3+

This is an updated version of the fire alarm I made. it includes a gas sensor and an app for control

  • 8,162 views
  • 10 comments
  • 9 respects

Components and supplies

Apps and online services

About this project

This project was inspired by my mom who nearly had a gas accident at work

This project is an improvement to the first fire alarm I made ( check it out ). I realised there were a few problems with it so I decided to improve it by adding and changing a few things.

Things I changed/ added:

1.) I added the HC 05 Bluetooth module and created an app to control it. in the first version I realized there was no way of controlling the fire alarm except manually resetting the Arduino so I created an app to switch it on, off or reset the alarm.

2.) I added an MQ 2 Gas sensor to improve flame detection accuracy and give added functionality. in the previous version you could set off the alarm with any IR source within the range the IR receiver can detect to prevent that I added a gas sensor because there's no fire without smoke. I also added the gas sensor to detect dangerous gasses like CO present.

3.) I changed the resistance value for the IR receiver from 220 Ohms to 10K Ohms. I did this to increase the sensitivity to IR light within the acceptable wavelength.

Here are a few screenshot's of the app.

The app is still a little buggy but I intend on modifying it in the future and also make the UI a lot better.

If you have any questions or suggestions on how I can make this project better please leave a comment.

Code

The CodeArduino
#define flamePin A0
#define gasPin A1
#define buzzer1 10
#define buzzer2 9
#define greenLed 2
#define redLed 3
int flameVal;
int gasVal;
int btSwitch=49;
unsigned long curTime;
void(* resetFunc) (void) = 0;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(buzzer1, OUTPUT);
  pinMode(buzzer2, OUTPUT);
  pinMode(greenLed, OUTPUT);
  pinMode(redLed, OUTPUT);
  curTime=millis();
}

void loop() {
    // put your main code here, to run repeatedly:
   if(Serial.available() > 0){ // Checks whether data is comming from the serial port
      btSwitch = Serial.read(); // Reads the data from the serial port
   }
   if(btSwitch=='1'){digitalWrite(greenLed,HIGH);digitalWrite(redLed,LOW);}
   else if(btSwitch=='0'){digitalWrite(redLed,HIGH);digitalWrite(greenLed,LOW);}
   else if(btSwitch=='2'){resetFunc();}
   
   flameVal=analogRead(flamePin);
   gasVal=analogRead(gasPin);
   
   if (flameVal<1000 && gasVal>159 && btSwitch=='1'){
     buzzerCall();
   }
   else if(gasVal>159 && btSwitch=='1'){
     buzzerCall();
   }
}

void buzzerCall(){
    digitalWrite(greenLed,LOW);
    digitalWrite(redLed,HIGH);
    tone(buzzer1, 5000);
    delay(1000);
    noTone(buzzer1);
    tone(buzzer2, 1000);
    digitalWrite(redLed,LOW);
    delay(1000);
    noTone(buzzer2);
 }

Custom parts and enclosures

The apk
firealarm_EhojP1gcHJ.apk

Schematics

The Circuit
I couldn't find a MQ 2 fritzing diagram so i used a MQ 9 instead which has a similar pin out. Don't forget to disconnect the Rx and TX pins from the Bluetooth module before uploading your code else you will have issues uploading your code
Flame sensor v2 8cofesefwg

Comments

Similar projects you might like

Smoke Detection using MQ-2 Gas Sensor

by Aritro Mukherjee

  • 441,793 views
  • 90 comments
  • 261 respects

Complete Digital Clock Including Alarm and Motion Sensor

Project showcase by LAGSILVA

  • 31,591 views
  • 37 comments
  • 97 respects

DIY Arduino Fire Alarm System At Home

Project tutorial by Team MrModder

  • 25,650 views
  • 2 comments
  • 28 respects

Buzzer Alarm System With Help Of Arduino

by Team ONYX

  • 89,670 views
  • 12 comments
  • 50 respects

Laser Beam Alarm

Project in progress by Vrcg03 and mmgamitoc

  • 16,467 views
  • 8 comments
  • 24 respects
Add projectSign up / Login