Skip to content
Free Delivery on Orders Above Rs 999/- Pan-India
Cash on Delivery Available for Orders above Rs.500/- and Upto Rs 3000/-
SAVE more when you BUY more. Upto 30% Off on BULK PURCHASE
GST Invoices for Your Business
Dedicated Technical Support Team
Safely Delivering Genuine Products PAN INDIA

Fire Alarm System Using Arduino: Full Build Guide

Fire Alarm System Using Arduino: Full Build Guide
-
Written By - Robocraze -
📅 Updated on 14 Aug 2026
Summarize with AI
✅ Prompt copied

Summary

A fire alarm system can be built as a simple Arduino project using a flame sensor and buzzer. The sensor detects infrared light associated with a flame, Arduino processes the signal, and the buzzer provides an immediate audible warning. This makes the project useful for learning sensor interfacing, digital inputs, and basic safety automation.

In this tutorial, you'll build a fire alarm system using Arduino, wire the flame sensor and buzzer, upload the Arduino code, test the detection system, and explore practical upgrades.

How to Build a Fire Alarm System Using Arduino

What You Need

  • Arduino Uno – Processes the flame sensor signal
  • Flame Sensor Module – Detects infrared light from flames
  • Active Buzzer Module – Produces the alarm sound
  • Breadboard – Enables temporary circuit prototyping
  • Jumper Wires – Connects the circuit components
  • USB Cable – Powers and programs the Arduino

These are the same core components specified in the existing project, which uses an Arduino Uno, flame sensor, active buzzer, breadboard, jumper wires, and USB cable

Safety Note: This is an educational prototype, not a replacement for a certified residential or commercial fire alarm. Never rely on a DIY circuit as your primary fire protection system.

Components and Supplies

16x2 LCD (Blue) with I2C Interface - 16x2 blue LCD with I2C for Arduino, Raspberry Pi & IoT. -LCD Display -Robocraze16x2 LCD (Blue) with I2C Interface - 16x2 blue LCD with I2C for Arduino, Raspberry Pi & IoT. -LCD Display -Robocraze

16x2 LCD (Blue) with I2C Interface

16x2 LCD (Blue) with I2C Interface This is a great LCD module for different types of Arduino projects. If you want to display your results and see the output, the 16x2 LCD Display is the perfect component for DIY Arduino projects. The values shown on the 16x2...
Rs 229/-
Rs 229/-
Rs 345/-
Save Rs 116/-
128x48 Green LCD - 128x48 green graphic LCD for electronics projects & industrial use. -LCD Display -Robocraze

128x48 Green LCD

128x48 Green LCD This is a basic 128 character by 48 line display. Utilizes the extremely common HD44780 parallel interface chipset (datasheet). Interface code is freely available. You will need ~11 general I/O pins to interface to this LCD screen. Includes LED backlight. Package...
Rs 968/-
Rs 968/-
Rs 1,047/-
Save Rs 79/-
7 inch LCD Capacitive Touch Panel – 7" capacitive LCD with HDMI & USB for Raspberry Pi - LCD Display - Robocraze7 inch LCD Capacitive Touch Panel – 7" capacitive LCD with HDMI & USB for Raspberry Pi - LCD Display - Robocraze

    7 inch LCD Capacitive Touch Panel with HDMI and USB Cable

    7 inch LCD Capacitive Touch Panel with HDMI and USB Cable This 7 inch LCD Capacitive Touch Panel is not only for mini-PCs, but it can also work as a computer monitor just like any other general HDMI screen. This Display supports Raspbian, Ubuntu,...
    Rs 4,599/-
    Rs 4,599/-
    Rs 5,123/-
    Save Rs 524/-
    Arduino Uno R3 Board compatibleArduino Uno R3 Board compatible

      Arduino Uno R3 Board compatible

      Arduino Uno R3 Compatible Board  The Arduino Uno R3 ATMEGA328P Development Board is more than just a microcontroller board; it's a gateway to endless possibilities in the world of electronics and programming. For hobbyists, students, and makers, it stands out as the best Arduino Uno...
      Rs 420/-
      Rs 420/-
      Rs 699/-
      Save Rs 279/-
      Heat Flame Sensor - Detects fire & high temperatures for safety. -Flame Sensor -RobocrazeHeat Flame Sensor - Detects fire & high temperatures for safety. -Flame Sensor -Robocraze

        Heat Flame Sensor

        Heat Flame Sensor This tiny Flame sensor infrared receiver module ignition source detection module is Arduino compatible and can use to detect flame or wavelength of the light source within 760nm~1100nm also useful for Lighter flame detect at a distance of 80 cm.  Greater the flame, the farther the test...
        Rs 33/-
        Rs 33/-
        Rs 53/-
        Save Rs 20/-
        4Pin KY-026 Flame Sensor Module - Detects fire & flame sources for safety systems. -Flame Sensor -Robocraze4Pin KY-026 Flame Sensor Module - Detects fire & flame sources for safety systems. -Flame Sensor -Robocraze

          4Pin KY-026 Flame Sensor Module

          4Pin KY-026 Flame Sensor Module This 4Pin Flame Sensor Module is used to detect fire/flame sources or other light sources of the wavelength in the range of 760nm 1100 nm. It is based on the YG1006 sensor which is a high speed and high...
          Rs 39/-
          Rs 39/-
          Rs 54/-
          Save Rs 15/-

          Parts Required

          Component Purpose
          Arduino Uno Main controller for the alarm
          Flame Sensor Module Detects a nearby flame
          Active Buzzer Provides audible fire warning
          Breadboard Holds temporary circuit connections
          Jumper Wires Connects modules to Arduino
          USB Cable Programs and powers Arduino

          How the Fire Alarm System Works

          The operating principle is straightforward.

          The flame sensor continuously monitors its surroundings for infrared light within the range associated with a flame. When the sensor detects a flame, its digital output changes state. Arduino reads this signal and activates the buzzer. When the flame is removed, the buzzer switches off.

          The basic sequence is:

          Flame detected → Sensor sends signal → Arduino processes input → Buzzer activates

          This makes a fire alarm system using Arduino a useful beginner project for understanding how a sensor can trigger an automated response.

          Components Required

          Component Overview

          Circuit Connections

          The project uses just two active modules: the flame sensor and the buzzer.

          Flame Sensor to Arduino

          Flame Sensor Pin Arduino Connection
          VCC 5V
          GND GND
          DO Digital Pin D2

          Buzzer to Arduino

          Buzzer Pin Arduino Connection
          Positive (+) Digital Pin D8
          Negative (-) GND

          The original circuit uses the flame sensor's digital output on D2 and the buzzer on D8.

          Before powering the circuit, check the polarity of the buzzer and confirm that the sensor's VCC and GND connections are correct.

          Build the Circuit Step by Step

          Step 1: Place the Components

          Place the Arduino Uno, flame sensor, and active buzzer on your work surface. Position the components so that the jumper wires can be connected without becoming tangled.

          A breadboard makes this stage easier because the connections can be changed without soldering.

          Step 2: Connect the Flame Sensor

          Connect:

          • Flame sensor VCC → Arduino 5V
          • Flame sensor GND → Arduino GND
          • Flame sensor DO → Arduino D2

          The digital output is the signal Arduino uses to determine whether the sensor has detected a flame.

          Step 3: Connect the Buzzer

          Connect the buzzer's positive terminal to Arduino D8 and its negative terminal to GND.

          The buzzer will act as the alarm output whenever Arduino detects the programmed flame condition.

          Step 4: Check the Wiring

          Before connecting the Arduino to your computer, inspect every connection.

          Pay particular attention to:

          • VCC and GND connections
          • Flame sensor output pin
          • Buzzer polarity
          • Arduino pin numbers

          A wiring mistake can prevent the alarm from working even when the code is correct. The original tutorial also recommends verifying the complete circuit before powering it.

          Arduino Fire Alarm System

          Upload the Arduino Code

          Once the circuit is assembled, connect the Arduino Uno to your computer and open the Arduino IDE.

          The basic program continuously reads the flame sensor and activates the buzzer when the sensor reports a detected flame.

          sensor reports a detected flame.


          const int flameSensor = 2;
          const int buzzer = 8;
          
          void setup() {
            pinMode(flameSensor, INPUT);
            pinMode(buzzer, OUTPUT);
          
            digitalWrite(buzzer, LOW);
          
            Serial.begin(9600);
          }
          
          void loop() {
            int flameState = digitalRead(flameSensor);
          
            if (flameState == LOW) {
              digitalWrite(buzzer, HIGH);
              Serial.println("Fire Detected!");
            }
            else {
              digitalWrite(buzzer, LOW);
              Serial.println("No Fire");
            }
          
            delay(200);
          }

          The original project uses the same pin assignments and logic: the flame sensor is read on D2, the buzzer is controlled through D8, and the Serial Monitor displays either "Fire Detected!" or "No Fire."

          Understanding the Code

          The code is built around a simple sequence: read the flame sensor → determine whether a flame is detected → control the buzzer → display the status.

          1. Define the Pins


          const int flameSensor = 2;
          const int buzzer = 8;

          These lines assign the Arduino pins used by the flame sensor and buzzer. The flame sensor is connected to D2, while the buzzer is connected to D8.

          Using named variables instead of repeatedly writing pin numbers also makes the code easier to modify later.

          2. Configure the Components

          Inside setup(), the pins are configured according to their functions:


          pinMode(flameSensor, INPUT);
          pinMode(buzzer, OUTPUT);

          The flame sensor provides information to the Arduino, so it is configured as an INPUT. The buzzer receives a control signal from the Arduino, so it is configured as an OUTPUT.

          The buzzer is initially switched off:


          digitalWrite(buzzer, LOW);

          The Serial Monitor is also initialized:


          Serial.begin(9600);

          This allows the Arduino to display messages such as "Fire Detected!" and "No Fire" while the project is running.

          3. Read the Flame Sensor

          The loop() function continuously reads the sensor:


          int flameState = digitalRead(flameSensor);

          The sensor's digital output is stored in the flameState variable. The Arduino can then use this value to determine whether the programmed detection condition has occurred.

          4. Trigger the Alarm

          The if statement determines what happens when the sensor detects a flame:


          if (flameState == LOW) {
              digitalWrite(buzzer, HIGH);
              Serial.println("Fire Detected!");
          }

          When the sensor returns LOW, the Arduino activates the buzzer by setting D8 to HIGH. It also prints "Fire Detected!" to the Serial Monitor.

          If the detection condition is not present, the else block keeps the buzzer switched off:


          else {
              digitalWrite(buzzer, LOW);
              Serial.println("No Fire");
          }

          This creates the basic decision-making logic behind the fire alarm system using Arduino.

          5. Add a Short Delay

          Finally:


          delay(200);

          The Arduino waits for 200 milliseconds before reading the sensor again. The loop then repeats continuously, allowing the system to monitor the flame sensor and respond to changes.

          In simple terms, the complete logic is:

          Read sensor → Check sensor state → Activate or deactivate buzzer → Display status → Repeat

          This same input-processing-output structure is useful well beyond this project and forms the foundation of many Arduino-based automation systems.

          Test the Fire Alarm System

          Once the code is uploaded, open the Serial Monitor in the Arduino IDE and set the baud rate to 9600.

          The system should continuously display the sensor status. When the flame sensor detects a flame, the Arduino should activate the buzzer and display a corresponding alert.

          For testing, keep the flame source at a safe distance and never leave it unattended.

          A basic test sequence is:

          1. Power the Arduino.
          2. Confirm that the buzzer remains off without a detected flame.
          3. Introduce a small flame within the sensor's detection range.
          4. Check that the buzzer activates.
          5. Remove the flame and confirm that the buzzer switches off.

          This confirms that the sensor, Arduino program, and alarm output are communicating correctly.


          Adjusting the Flame Sensor

          Most flame sensor modules include a small potentiometer that allows you to adjust their detection sensitivity.

          If the buzzer activates when there is no flame, the sensor may be too sensitive. If it fails to detect a nearby flame, the sensitivity may need adjustment.

          Make small changes to the potentiometer and test the sensor again.

          Keep in mind that environmental factors such as sunlight and other infrared sources can affect the sensor. A simple flame sensor should therefore be treated as an educational detection mechanism rather than a certified fire-detection device.

           

          Troubleshooting Common Problems

          Problem Possible Cause Solution
          Buzzer doesn't activate Incorrect wiring Check D8, VCC, and GND connections
          Flame isn't detected Sensor sensitivity is too low Adjust the sensor's potentiometer
          Buzzer stays ON Sensor detects infrared light continuously Reposition the sensor and adjust sensitivity
          Serial Monitor shows incorrect output Wrong baud rate Set Serial Monitor to 9600 baud
          Arduino doesn't respond Code or USB connection issue Recheck the sketch and USB connection

          Testing each component independently can make troubleshooting much easier.


          How to Improve the Project

          The basic fire alarm system using Arduino is intentionally simple, but several additions can make the project more informative and capable.

          Add an LED Indicator

          A red LED can indicate an alarm condition while a green LED can show that the system is operating normally.

          This provides visual feedback in addition to the buzzer.

          Add an LCD or OLED Display

          A display can show messages such as:

          • System Ready
          • Fire Detected
          • Sensor Monitoring

          This is particularly useful for educational demonstrations.

          Add a Temperature Sensor

          A temperature sensor can provide another measurement alongside flame detection. Arduino could then evaluate both temperature and flame-related inputs before triggering an alert.

          Using multiple sensors can make the system more robust than relying on a single input.

          Add Remote Notifications

          An ESP32 or another communication module can extend the project beyond a standalone alarm.

          For example, the system could potentially:

          • Send an alert to a phone
          • Log detection events
          • Display sensor readings remotely
          • Connect to an IoT dashboard

          This turns a basic Arduino experiment into a broader monitoring project.


          Where You Can Take the Project Next

          Once you're comfortable working with sensors and automated alerts, you can apply the same Arduino concepts to other practical projects.

          For example, an RFID-based Smart Attendance System uses a microcontroller to detect identification cards and record attendance automatically. It introduces a different type of sensor input while following the same basic principle of input → processing → output.

          You can also explore access-control applications with Build Your Own Smart Door Lock Using Arduino, where an RFID reader and servo motor are combined to create an automated locking mechanism.

          These projects demonstrate how the same fundamentals can be applied to different real-world automation problems.


          Safety Considerations

          A DIY Arduino circuit should not be used as the primary fire protection system in a home, school, laboratory, or commercial building.

          Certified smoke and fire alarms use dedicated sensors, testing standards, alarm levels, backup power, and safety certifications that a basic Arduino project does not provide.

          For this reason, treat this project as an educational prototype for learning about sensors and automation. Keep any test flame small, controlled, and away from flammable materials.


          Final Thoughts

          A fire alarm system using Arduino is a straightforward project that demonstrates how a microcontroller can monitor an environment and respond automatically to a detected condition.

          The basic setup requires only an Arduino Uno, flame sensor, buzzer, breadboard, and jumper wires. From there, you can add LEDs, displays, temperature sensors, or wireless connectivity to explore more advanced monitoring systems.

          The most important lesson is the underlying design pattern: a sensor provides an input, the Arduino processes that information, and an output device responds to the detected condition. Once you understand that workflow, you can apply it to a wide range of electronics, robotics, and automation projects.

          Excerpt

          Build a working fire alarm using Arduino and a flame sensor. Complete parts list, circuit diagram and code for a simple, reliable safety project.
          Prev Post
          Next Post

          Leave a comment

          Please note, comments need to be approved before they are published.

          Thanks for subscribing!

          This email has been registered!

          Shop the look

          Choose Options

          Edit Option
          Back In Stock Notification
          Compare
          Product SKU Description Collection Availability Product Type Other Details

          Choose Options

          this is just a warning
          Login
          Shopping Cart
          0 items
          FREE SHIPPING!
          ₹100 OFF
          ₹200 OFF
          ₹999
          ₹2500
          ₹4900
          WhatsApp Chat Chat