Skip to content

Aadhitya-12007/IoT-based-Fire-Alarm-System-using-Raspberry-Pi-Pico-W

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

IoT-Based Fire Alarm System using Raspberry Pi Pico W

Hardware IoT

An intelligent, multi-sensor fire detection system powered by the Raspberry Pi Pico W. By combining temperature, gas, and 360-degree smoke sensing with real-time Wi-Fi connectivity, this project overcomes the limitations of traditional single-sensor alarms, ensuring faster emergency response and minimizing false positives.

Overview

This project provides end-to-end automation—from detection and computation to communication. When a fire is detected, the system validates the threat across multiple sensors, calculates the severity of the fire, and instantly sends a detailed alert with GPS coordinates via Telegram, while simultaneously triggering local visual and auditory alarms.

The low-cost, modular design makes it highly adaptable for various fire monitoring applications, from home safety to industrial spaces.

Key Features

  • Combines data from temperature, humidity, gas, and smoke sensors for reliable fire confirmation.
  • Utilizes four strategically placed smoke sensors for comprehensive monitoring.
  • Employs cross-sensor validation to filter out false positives and confirm genuine fire events.
  • Uses the Pico W's Wi-Fi to POST immediate alerts via the Telegram Bot API.
  • Automatically computes a "fire-size score" based on sensor readings.
  • Telegram alerts include sensor values, severity classification, GPS location, and a recommendation for the number of fire trucks required.
  • Triggers an onboard buzzer and LEDs for immediate on-site notification.

Hardware Requirements

To build this system, you will need the following components:

  • 1x Raspberry Pi Pico W (Microcontroller with Wi-Fi)
  • 4x Analog Smoke/Fire Sensors (Positioned for 360° coverage)
  • 1x MQ-2 Gas Sensor (For combustible gases)
  • 1x DHT11 or DHT22 Sensor (For temperature and humidity)
  • 1x NEO-6M GPS Module (For location tracking)
  • 1x Active Buzzer (For local auditory alarm)
  • LEDs (For power, network status, and local visual alarm)
  • Jumper wires and breadboard/PCB

System Workflow

  1. The Pico W continuously samples all connected sensors at fixed intervals.
  2. The system applies threshold comparisons to the incoming data.
  3. Multi-sensor logic is used to confirm a genuine fire event (e.g., high temperature and smoke detected).
  4. Action Execution (If Fire Detected):
    • Computes the fire-size severity score.
    • Activates the local buzzer and alarm LEDs.
    • Composes a detailed Telegram message including GPS coordinates.
    • Sends the POST request via Wi-Fi to the Telegram Bot API.

Getting Started

Prerequisites

  • Ensure you have Thonny IDE or your preferred MicroPython editor installed (in Windows OS or Linux if preferred). This project was compiled and MCU was flashed using Thonny IDE for Windows OS.
  • Flash your Raspberry Pi Pico W with the latest MicroPython firmware.
  • Install the Telegram app on your phone and create a bot using BotFather to get your API token and Chat ID.

Installation & Setup

  1. Hardware Connections:

    • Connect the DHT11/22, MQ-2, and the four smoke sensors to the analog/digital pins of the Pico W as defined in the code.
    • Connect the NEO-6M GPS module via UART.
    • Connect status LEDs and the buzzer to their respective GPIO pins.
  2. Configure Credentials:

    • Open main.py (or your configuration file).
    • Enter your Wi-Fi SSID and Password.
    • Enter your Telegram Bot Token and your personal Chat ID.
  3. Run the Code:

    • Upload the script to your Pico W using Thonny.
    • Run the script to start the monitoring system.

Contributing

Contributions are welcome! If you have suggestions for improving the sensor logic, adding new features, or optimizing the code, please feel free to fork the repository and submit a pull request.

About

Combining temperature, gas and smoke sensors with Pico W’s connectivity overcomes limitations of single-sensor alarms.​ End-to-end automation (detection → computation → communication) accelerates emergency response and reduces human error.​ The low-cost, modular design can be adapted for fire monitoring.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages