FlameGuard: Arduino-Based Fire Detection System
by 1041085 in Circuits > Arduino
57 Views, 1 Favorites, 0 Comments
FlameGuard: Arduino-Based Fire Detection System

In this project, I’ll show you how to make a simple but effective Arduino-based fire alarm system using a flame sensor and a buzzer. This setup detects fire or high heat sources and instantly triggers a loud alarm — just like a mini emergency system!
This is a great beginner-friendly project to explore sensors, buzzers, and simple electronics. Whether you're building a DIY safety gadget for your room, a school project, or just learning Arduino, this Instructable will walk you through it step by step.
No advanced skills needed just basic components!
Supplies

Main Controller:
- Arduino Uno (x1)
- Buy on Amazon
Core Components:
- Breadboard (x1)
- Buy on Amazon
- RGB LED – Common Cathode (x1)
- Buy from Canada Robotix
- Red LED (x2)
- Buy on Amazon
- Piezo Buzzer (x1)
- Buy on Amazon
- 7-Segment Display (x1)
- Buy on Amazon
- Flame Sensor Module (x1)
- Buy from SunFounder
- Slide Switch (x1)
- Buy on Amazon
️ Supporting Components:
- 330Ω Resistors (x5)
- Buy on Amazon
- 10kΩ Resistors (x2)
- Buy on Amazon
- NPN Transistors (x2)
- Buy on Amazon
- 100µF Capacitors (x2)
- Buy from BluePack Nova
Wiring the Fire Detection System
















Step 1 – Building the Multivibrator Circuit
Place two red LEDs near the center of your breadboard. Above each LED, insert a capacitor so that the negative leg of the LED connects to the positive leg of the capacitor.
Place two NPN transistors in the center such that their emitter pins face each other.
Step 2 – Powering the Multivibrator
Connect a 330 ohm resistor from the positive rail to the positive leg of each LED.
Connect a 10k ohm resistor from the bottom positive rail to the negative leg of each capacitor.
Use jumper wires to connect the emitters of both NPN transistors to the ground rail.
Step 3 – Wiring the Multivibrator
Connect the negative leg of each LED to the collector pin of the corresponding transistor.
Connect the negative leg of each capacitor to the base pin of the opposite transistor
Refer to diagrams if you're unsure.
Step 4 – Setting Up the RGB LED
Place your Common Cathode RGB LED above the multivibrator.
Connect the longest leg (common cathode) to the top ground rail through a 330 ohm resistor.
Step 5 – Connecting the Flame Sensor
Connect the VCC pin of the flame sensor to the top power rail.
Connect the GND pin of the flame sensor to the top ground rail.
Step 6 – Wiring the 7-Segment Display
Place the 7-segment display on the left-middle section of the breadboard.
Connect both of its common pins to the top power rail using 330 ohm resistors.
If needed, bridge the bottom common pin to the top power rail using a jumper wire.
Step 7 – Adding the Buzzer
Place the buzzer to the top right of the 7-segment display.
Connect its negative leg to the ground rail using a 330 ohm resistor.
The positive leg will go to the Arduino later.
Step 8 – Installing the Slide Switch
Put your slide switch on the bottom right of the breadboard near the 7-segment display.
Connect the middle pin of the switch to the top power rail.
Connect the left pin of the switch to the 5V pin on the Arduino Uno.
This will allow the Arduino to detect whether the system should be on or off.
Step 9 – Connecting the 7-Segment Display to the Arduino
Use jumper wires to connect the 7-segment display segments to the following pins on the Arduino Uno:
Segment A to digital pin 7
Segment B to digital pin 8
Segment C to digital pin 4
Segment D to digital pin 3
Segment E to digital pin 2
Segment F to digital pin 6
Segment G to digital pin 5
Step 10 – Connecting the RGB LED to the Arduino
Connect the three color legs of the RGB LED as follows:
Red leg to digital pin 9
Green leg to digital pin 11
Blue leg to digital pin 10
Step 11 – Connecting the Buzzer to the Arduino
Connect the positive leg of the buzzer to digital pin 12 on the Arduino Uno.
Step 12 – Connecting the Flame Sensor to the Arduino
Connect the DO (Digital Output) pin of the flame sensor to analog pin A0 on the Arduino Uno.
This allows the Arduino to read fire detection signals.
Step 13 – Controlling the Multivibrator with Arduino
Connect the bottom power rail of the breadboard to digital pin 13 on the Arduino Uno.
This way, the Arduino can turn the multivibrator circuit on and off through code.
Step 14 – Connecting the Slide Switch to the Arduino
Connect the middle pin of the slide switch to analog pin A5 on the Arduino Uno.
This allows the Arduino to read the state of the switch and respond accordingly.
Step 15- Changing the sensor to a Sensitive Flame Sensor (Optional)
If you are having trouble operating the flame sensor and testing it with a controlled lighter or you dont have a adult to test the flame sensor with a fire, simply replace the Flame sensor with a KY- 026 Flame sensor which you can test with a phone's flashlight for easier use!
Look At The Schematic Added For More Understanding!
Coding the Fire Detection System

Due to the fact that this project consists of many components and relies on quite a lot of input components, I have attached the code and have summarized what the code does below.
Firstly, I start the code by initializing different variables for pins for all of my different components above the void setup, like all the 7-segment display legs and all of the input components. Next, inside the void setup, I have put all of the pinMode statements that identify if one pin will take an input or give output.
After the void setup, I have declared all of the different functions. Five of the functions include the ones that are needed for the 7-segment display, and they basically give the signal for each letter in FIRE, so that when I call the function F, it prints F on the 7-segment display, and so on.
Next, I have a function for the RGB LED that basically takes in 3 parameters and sets them to the color of the RGB, so I can call the command setColor and give it different values for different colors.
Now after declaring all of the functions, we are in void loop. The first thing I do in void loop is change slideState to be the current state of the slide switch, and lastSlideState to LOW. This gives me two variables that I could use in the future to determine the past history of the slide switch.
Then I put an if statement that says: if the slide switch was ON and it is turned OFF, turn everything including the buzzer and multivibrator OFF. I did the same for if it is HIGH and it was LOW before. (This makes sure that the fire alarm doesn’t falsely go off when I restart the system.)
Then I update the lastSlideState to the current slideState, which makes sure it is constantly getting updated.
Next, I make an if statement that states that when the slide switch is OFF, turn all of the components to LOW and OFF so they don’t sense anything or make a noise, and it ends the program when it’s LOW, so when we turn it ON it can start the program and start detecting again.
Next in the void loop, after the if statement (which means the slide switch is HIGH), the program starts reading the values and turns the RGB green if there is no fire.
Next, I put an if statement for when the sensor detects 0, which means it detects fire. It turns the multivibrator ON and starts a for loop for the buzzer. Once that ends, the function for the seven-segment display is called, which basically says the letters FIRE with a half-second delay three times and then turns off.
The code has been linked below: