Fire Alarm Using Arduino UNO/NANO/MEGA at Home

Introduction: Fire Alarm Using Arduino UNO/NANO/MEGA at Home

About: Hi! I am YK from Tech Genius, we are here with you to make this world smart using technology with you and me. so plz subscribe to this channel. Arduino and More... #Robotics #Arduino #Sensors #CircuitDesign #…

What does it do? When the Infrared diode sees the flame, it sends the digital out DO to also, the level of the flame is represented with Analog output

Step 1: Connection

DO = D2

BUZZER = 8

DO NOT USE SERVO

Step 2: CODE UPLODING

/*

* This is code for Flame Sensor module for Arduino

* watch the video:- https://youtu.be/zXgUw0JdLcg

* Other Arduino library and videos https://www.youtube.com/channel/UCNKaXZsJwhSNxG_D...

* Flame Sensor Module for Arduino

* Written by Y.K. from Tech Genius

* Permission granted to share this code given that this note is kept with the code. *

Disclaimer: This code is for educational purposes only.

*/

/*

What does it do? When the Infrared diode sees the flame, it sends the digital out DO to also, the level of the flame is represented with Analog output

*/ // 4 Infrared Obstacle code for

#define FLAME 2 // connect DO pin of sensor to this pin

#define ALARM 8 // pin 8 for Alarm

void setup() {

Serial.begin(9600);

Serial.println("Tech Genius");

pinMode(FLAME, INPUT);//define FLAME input pin

pinMode(ALARM, OUTPUT);//define ALARM output pin

}

void loop() {

int fire = digitalRead(FLAME);// read FLAME sensor

if( fire == HIGH)

{

digitalWrite(ALARM,HIGH);// set the buzzer ON

Serial.println("Fire! Fire!");

}else

{

digitalWrite(ALARM,LOW); // Set the buzzer OFF

Serial.println("OK");

}

delay(200);

}

Step 3: TESTING

TAKE SOME FLAME AND OPEN THE SERIAL MONITOR TO CHEAK THE PROJECT

Be the First to Share

    Recommendations

    • Micro:bit Contest

      Micro:bit Contest
    • Back to School: Student Design Challenge

      Back to School: Student Design Challenge
    • Space Contest

      Space Contest

    Comments