Header Ads

How to Make Fire alarm Using Flame Sensor with Arduino

Overview

In this video tutorial, we will learn how to detect fire and make a fire alarm using a flame sensor with Arduino. This is very easy to make and useful project for the people of electronics lovers.

You can watch the following video below:-

Components Required

The required components list for this project given below:-
  • Arduino Uno
  • Flame Sensor
  • 16*2 Lcd Display 
  • 10k Potentiometer
  • 220-ohm Resistor
  • Buzzer
  • Breadboard
  • Some Jumper Wire

Pinout

Circuit Schematic

The circuit diagram of the fire sensor interfacing with Arduino has been given below:-
Fig: Arduino and flame sensor interfacing

Circuit Description

Source Code

The source code is given below:-
    #include <LiquidCrystal.h>  
 LiquidCrystal lcd(2, 3, 4, 5, 6, 7);  
   
 #define flamePin 10  
 #define buzzerPin 11 
   
 void setup() {  
  Serial.begin(9600);  
  lcd.begin(16, 2);   
   
  pinMode(buzzerPin,OUTPUT);   
  pinMode(flamePin,INPUT);  
    
  lcd.setCursor(0, 0);  
  lcd.print("Calibrating");  
   for(int i = 0; i <15; i++){  
    if (i==4)  
    {  
      lcd.setCursor(0, 1);  
      lcd.print(".");  
     }  
     else lcd.print(".");  
    delay(500);  
    }  
   lcd.setCursor(11, 1);  
   lcd.print("Done");  
   delay(1000);  
   lcd.clear();   
   lcd.setCursor(1, 0);  
   lcd.print("Sensor Active");  
   delay(1500);  
   lcd.clear();  
 }  
   
 void loop() {  
    
 int Flame = digitalRead(flamePin);  
   
  if (Flame == LOW)  
  {  
    digitalWrite(buzzerPin,HIGH);  
    lcd.setCursor(0, 0);  
    lcd.print(" Flame : ");  
    lcd.print("Flame");  
    lcd.setCursor(0, 1);  
    lcd.print(" is Detected");  
    Serial.print(Flame);  
    Serial.print("\t");  
    Serial.print("Flame is Detected");    
  }  
  else if (Flame == HIGH)  
  {  
    digitalWrite(buzzerPin,LOW);  
    lcd.setCursor(0, 0);  
    lcd.print("Flame : ");  
    lcd.print("No Flame");  
    Serial.print(Flame);  
    Serial.print("\t");  
    Serial.println("No Flame");    
  }  
    
  delay(300);  
  lcd.clear();  
 }  


No comments

Powered by Blogger.