Mirko Pavleski
Published © GPL3+

Arduino flame detector with alarms

This Arduino project is very simple to make and has a huge practical application.

BeginnerFull instructions provided1 hour159
Arduino flame detector with alarms

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
IR Flame Detector module
×1
Water pump with hoses
×1
5V Relay module
×1
LED (generic)
LED (generic)
×2
Buzzer
Buzzer
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free

Story

Read more

Schematics

Schematic

...

Code

Code

C/C++
...
//Arduino Flame Detector

 int relayPin = 5;
 int buzzerPin = 2;
 int flamePin = 8;
 int TONE1 = 900;     // First tone frequency
 int TONE2 = 1200;    // Second tone frequency
 int DURATION = 500;  // Duration of each tone in milliseconds
 int blueled = 3;
 int redled = 4;
 int Flame = HIGH;

void setup() 
{
  Serial.begin(9600);
  pinMode(buzzerPin, OUTPUT);
  pinMode(relayPin, OUTPUT);
  pinMode(redled, OUTPUT);
  pinMode(blueled, OUTPUT);
  digitalWrite(redled, LOW);
  digitalWrite(blueled, LOW);
  digitalWrite(relayPin, LOW);
  pinMode(flamePin, INPUT);
  
}

void loop() 
{
  Flame = digitalRead(flamePin);
  if (Flame == LOW)
  {
     digitalWrite(buzzerPin, LOW);
     digitalWrite(redled, LOW);
     digitalWrite(blueled, LOW);
     digitalWrite(relayPin, LOW);
     noTone(buzzerPin);
  }
    
  else
  {
    digitalWrite(relayPin, HIGH);
    tone(buzzerPin, TONE1);
    digitalWrite(redled, HIGH);
    digitalWrite(blueled, LOW);
    delay(DURATION);
    tone(buzzerPin, TONE2);
    digitalWrite(redled, LOW);
    digitalWrite(blueled, HIGH);
    delay(DURATION);
  }
}

Credits

Mirko Pavleski
173 projects • 1401 followers
Contact

Comments

Please log in or sign up to comment.