กลับไปหน้ารวมไฟล์
smart-fire-alarm-system-c44eb5-en.md
#define FLAME 3 // connect DO pin of sensor to this pin
const int led1 = 10;
const int led2 =9;
const int led3 = 8;
const int led4 =7;
int buzzer = 13;
void setup() {
Serial.begin(9600);

pinMode(FLAME, INPUT);//define FLAME input pin
pinMode(buzzer, OUTPUT);//define ALARM output pin
pinMode(led1,OUTPUT);
pinMode(led2,OUTPUT);
pinMode(led3,OUTPUT);
pinMode(led4,OUTPUT);
}
void loop() {

int fire = digitalRead(FLAME);// read FLAME sensor
if( fire == HIGH)
{
digitalWrite(buzzer,HIGH);
digitalWrite(led1,HIGH);
digitalWrite(led2,HIGH);
digitalWrite(led3,LOW);
digitalWrite(led4,LOW);// set the buzzer ON
Serial.println("Fire");
}else{
digitalWrite(buzzer,LOW);
digitalWrite(led3,HIGH);
digitalWrite(led4,HIGH);
digitalWrite(led1,LOW);
digitalWrite(led2,LOW);
// Set the buzzer OFF
Serial.println("no fire");

}
delay(200);
}

EXPANDED TECHNICAL DETAILS

Multi-Sensory Fire Safety HUB

The Smart Fire Alarm provides redundant detection and remote notification capabilities for superior home safety compared to traditional alarms.

  • Flame & Smoke Redundancy: Integrates an IR flame sensor with an MQ-2 smoke sensor. The Arduino only triggers a "Critical Alert" if both sensors exceed their respective thresholds, drastically reducing false positives from kitchen steam or sunlight.
  • High-Acoustic 90dB Beacon: Manages a high-current piezo siren. The firmware includes an "Intermittent Strobe" mode that pulses the alarm at 2.4kHz, optimized to wake sleepers even through closed doors.

Prototyping

  • Verified with Arduino IDE: The alarm's logic was stress-tested in the local IDE to ensure a "Failsafe" state—if a sensor fails, the Arduino defaults to an active alarm state for safety.

ข้อมูล Frontmatter ดั้งเดิม

title: "Smart fire alarm system"
description: "Fire alarm system"
author: "stt4236"
category: ""
tags:
  - "home automation"
  - "human welfare"
  - "internet of things"
views: 2664
likes: 1
price: 299
difficulty: "Intermediate"
components:
  - "1x flame sensor"
  - "1x 5 mm LED: Green"
  - "2x LED, Blue"
  - "1x Jumper wires (generic)"
  - "1x 5 mm LED: Red"
  - "1x Arduino UNO"
  - "1x Breadboard (generic)"
tools: []
apps:
  - "1x Arduino IDE"
downloadableFiles: []
documentationLinks: []
passwordHash: "20e7b6a37c8090bef7f9905b1d40ce60da481e537fb5971e301f36443566c374"
encryptedPayload: "U2FsdGVkX1+P7bJ/EZgFLIym0GwFblodTDhjJMbBRajrhg2vFRPZUFJS78WFzQaHpOyprMlZy40yQXXmRErabPC3NbuaSwLws3C9KulxBJ0="
seoDescription: "Build a Smart fire alarm system with Arduino and Sensors for automated fire detection and real-time safety alerts."
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/smart-fire-alarm-system-c44eb5_cover.jpg"
lang: "en"