AI Project Updated
AI Project Updated
ARTIFICIAL INTELLIGENCE
MRUTYUNJAI MOHAN
X-D
TABLE OF CONTENTS
ABTRACT
SYSTEM CONFIGURATION
SOFTWARE REQUIREMENTS
PROJECT DESIGN
SOURCE CODE
OUTPUT SCREEN
CONCLUSION
REFERENCE
ABSTRACT
The Smoke and Fire Detector System is a safety
technology designed to detect the presence of
smoke or fire in an environment and provide early
warning signals to prevent damage or injury. This
thesis presents the design, implementation, and
evaluation of a smart fire detection system that
utilizes sensors, microcontrollers, and integrated
communication systems to monitor potential fire
hazards. The system employs smoke sensors,
temperature sensors, and gas sensors to detect
fire-related phenomena. The data is processed by
a microcontroller and presented via a user-
friendly interface to alert users promptly. The
thesis outlines the hardware and software
requirements, describes the system configuration,
and provides insight into the project design and
source code. Additionally, an evaluation of the
system's performance is provided, demonstrating
the effectiveness of the system in real-world
scenarios.
SYSTEM CONFIGURATION
The Smoke and Fire Detection System consists of several key
components working together to detect fire hazards. The system
configuration includes:
screen.
o ESP8266WiFi Library (optional for IoT
1. Sensor Interface
4. Alarm System
#include <MQ2.h>
#include <LiquidCrystal.h>
#include <DHT.h>
// Pin configuration
int smokePin = A0; // MQ-2 smoke sensor pin
int tempPin = 2; // DHT22 sensor pin
int buzzerPin = 8; // Buzzer pin
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // LCD initialization
DHT dht(tempPin, DHT22); // DHT22 sensor object
MQ2 smokeSensor(smokePin); // Smoke sensor object
void setup() {
lcd.begin(16, 2); // Initialize LCD
dht.begin(); // Initialize DHT sensor
pinMode(buzzerPin, OUTPUT); // Set buzzer pin as output
lcd.print("Fire Detector System");
delay(2000); // Show initial message for 2 seconds}
void loop() {
float temp = dht.readTemperature(); // Get temperature reading
int smokeLevel = smokeSensor.read(); // Get smoke sensor value
// Display sensor readings on LCD
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Temp: ");
lcd.print(temp);
lcd.print(" C");
lcd.setCursor(0, 1);
lcd.print("Smoke: ");
lcd.print(smokeLevel);
// Check if smoke level exceeds threshold
if (smokeLevel > 300 || temp > 50) { // Threshold for smoke and
temperature
digitalWrite(buzzerPin, HIGH); // Trigger buzzer
lcd.setCursor(0, 1);
lcd.print("ALERT! FIRE DETECTED!");
} else
{digitalWrite(buzzerPin, LOW); // Turn off buzzer }
delay(1000); // Delay before next reading}
OUTPUT SCREEN
The output screen, displayed on an LCD or LED display, will show real-time sensor
readings such as:
Example display:
Temp: 26.5 C
Smoke: 150