hIOTron
Created December 16, 2019 © GPL3+

Interfacing Flame Sensor with Arduino

In this project, we interface Flame Sensor with Arduino which helps to build Fire Alarm System.

Interfacing Flame Sensor with Arduino

Things used in this project

Story

Read more

Code

Run a program

Arduino
int buzzer = 8;
int LED = 7;
int flame_sensor = 4;
int flame_detected;

void setup()
{
  Serial.begin(9600);
  pinMode(buzzer, OUTPUT);
  pinMode(LED, OUTPUT);
  pinMode(flame_sensor, INPUT);
}

void loop()
{
  flame_detected = digitalRead(flame_sensor);
  if (flame_detected == 1)
  {
    Serial.println("Flame detected...! take action immediately.");
    digitalWrite(buzzer, HIGH);
    digitalWrite(LED, HIGH);
    delay(200);
    digitalWrite(LED, LOW);
    delay(200);
  }
  else
  {
    Serial.println("No flame detected. stay cool");
    digitalWrite(buzzer, LOW);
    digitalWrite(LED, LOW);
  }
  delay(1000);
}

Credits

hIOTron

hIOTron

78 projects • 2 followers
hIOTron is an internet of things based company that offers an IoT Platform, products, IoT Solutions, and IoT Training.

Comments