Build your Fire Alarm System at home with Arduino UNO. In this tutorial, you will learn all steps to DIY Arduino fire alert system by yourself. In this project, we need IR based flame sensor to detect firelight, and it gives a signal to Arduino where buzzer connected to provide us with the output as fire alert.
There is two type of flame sensors available one is Analog and other Digital. Some sensor has both feature you can use easily just need little bit changes on the sketch, not an issue at all. We will use both sensors and here will be both source code available in the relevant section.
Build fire alarm or fireplace detector the use of Flame sensor and Arduino board. The sensor mainly detects IR (Infra purple) light wavelength between 760 nm – 1100 nm (nanometer) that emitted from fire flame. Most of the fire sensors got here with the YG1006 sensor which is an excessive velocity and excessive sensitive NPN silicon photograph transistor. It’s miles included with black epoxy, for the reason that sensor is touchy to infrared radiation. Through using this concept assignment you can recognize the way to screen and alert approximately hearth flame, it is maximum appropriate for fireplace combating robotic, fire alarm and so forth.
What you will need:- Arduino UNO ( Any)
- Flame Sensor.
- Buzzer.
- Jumper wires.
- 9V supply.
The cost is around about ten bucks for this fire alarm system. You can but all the stuff from any online site like Amazon, eBay, Aliexpress…
Flame Sensor circuit diagram:Now you need to wiring all the components with each other correctly. See below for both type of sensors.
If you have Digital sensor connect as per shown in the image.
In case you have A0 (Analog sensor) then wiring will be as in the picture.
Code for Digital flame sensor. (D0)
// http://www.mrmodder.com visits for more Arduino Projects //
int Buzzer = 13; // Use buzzer for alert
int FlamePin = 2; // This is for input pin
int Flame = HIGH; // HIGH when FLAME Exposed
void setup() {
pinMode(Buzzer, OUTPUT);
pinMode(FlamePin, INPUT);
Serial.begin(9600);
}
void loop() {
Flame = digitalRead(FlamePin);
if (Flame== HIGH)
{
Serial.println("HIGH FLAME");
digitalWrite(Buzzer, HIGH);
}
else
{
Serial.println("No flame");
digitalWrite(Buzzer, LOW);
}
}
Source Code for A0 Analog flam sensor.
// http://www.mrmodder.com visits for more Arduino Projects //
const int analogPin = A0; // Flame Sensor (A0) to Arduino analog input pin A0
const int BuzzerPin = 13; // Buzzer output pin
const int threshold = 400; // Flame level threshold (You can vary the value depends on your need)
void setup() {
pinMode(BuzzerPin, OUTPUT);
// initialize serial communications:
<b>Serial</b>.begin(9600);
}
void loop() {
// read the value of the Flame Sensor:
int analogValue = analogRead(analogPin);
<b>Serial</b>.println(analogValue); //serial print the FLAME sensor value
if (analogValue > threshold) {
digitalWrite(BuzzerPin, HIGH);
<b>Serial</b>.print("High FLAME");
}
else if (analogValue = threshold){
<b>Serial</b>.print("Low FLAME");
digitalWrite(BuzzerPin, HIGH);
delay(400);
digitalWrite(BuzzerPin, LOW);
}
else {
digitalWrite(BuzzerPin, LOW);
<b>Serial</b>.print("No flame");
}
delay(1);
}
Upload the relevant code to Arduino Board test flame sensor it can detect fire from according to my testing maximum 3 feet. However, it depends on sensor quality it may be different on your sensor.
The users also Read:
For more project Surf on Mr-Modder Dot COM. If you like must share it with others. In case you stuck on any step just comment below I will soon solve your issue.
Comments