Home Safety Report (Final) 1 Finished

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

A

PROJECT REPORT
On

“HOME SAFETY SYSTEM USING IoT”


Submitted in partial fulfilment of
the requirements for the award of the Degree of
BACHELOR OF SCIENCE
IN

Electronics and Telecommunication

by
Mr. SOUMYAPRADA RATH (Roll. No :202153044)

Mr. AYUSH BHANJA (Roll No: 202153008)

Mr. SHREEMAN ANIRUDHA SENAPATI (Roll No: 202153034)

Under the esteemed guidance of


Mr. Deepak ku. Mohapatra Mr. Umakanta Samantasinghara

(External Guide) (Internal Guide)

DEPARTMENT OF ELECTRONICS AND TELECOMMUNICATION

BJB AUTONOMOUS COLLEGE

BHUBANESWAR.

2023-24

1
CERTIFICATE

This is to certify that Mr./ Miss SOUMYAPRADA RATH,

AYUSH BHANJA, SHREEMAN ANIRUDHA SENAPATI

bearing Roll Nos 202153044, 202153008, 202153034 are the

students of IMSc.ETC of BJB Autonomous College, Bhubaneswar

have undergone a project work on HOME SAFETY SYSTEM

USING IoT, at N-TECHNOLOGY from JANUARY 20 to

MARCH 25 under my supervision & guidance.

Certified that to the best of my knowledge, this work done

here is very correct and accurate. During this period they have

shown knee interest, dedication and hard work for the

development of this project

I wish all success in their future endeavour.

Signature of the Guide with seal

Name:

Designation:

2
Dept. of Electronics and Telecommunication

BJB (Autonomous) college

Bhubaneswar

BONAFIED CERTIFICATE

This is to certify that Mr./ Miss SOUMYAPRADA RATH,

AYUSH BHANJA, SHREEMAN ANIRUDHA SENAPATI

bearing Roll Nos 202153044, 202153008, 202153034 are the

students of IMSc.ETC of BJB Autonomous College, Bhubaneswar

have undergone a project work on HOME SAFETY SYSTEM

USING IoT, at N-TECHNOLOGY from JANUARY 20 to

MARCH 25 under our supervision & guidance.

Certified that to the best of our knowledge this work

done here is very correct and accurate. During this period they

have shown keen interest, dedication and hard work for the

development of this project

We wish all success in their future endeavour.

Sign. of External Sign. Of HOD

Examiner Dept. Of IMSc(ETC)

3
ACKNOWLEDGEMENT

No project is the outcome of the individual effort. Right from

its inception to the completion of the project, we are benefited

by the suggestions and valuable inputs from many people.

Without their help, we would not have been able to complete

this project. So, we seize this opportunity to thank all of them

who have helped us to complete this project.

We would like to express our deep sense of gratitude to our

external guide Mr./Miss DEEPAK KU. MOHAPATRA his/her

inspiring guidance and cooperation for the successful

completion of the project.

We would also like to express our hearty thanks

to our internal project guide Mr./Miss. UMAKANTA

SAMANTASINGHAR who has provided continuous guidance

and suggestions to undertake and complete the project work in

his esteemed organization.

We are also very much thankful to the Head of the

Department and other faculty members, for their support and

cooperation to the successful completion of the project.

Signature of the Student(s)

4
DECLARATION

We do hereby declare that this project report on “HOME

SAFETY SYSTEM USING IoT” is original and the result of our

own work.

This project has not been published elsewhere or

submitted to any other college/University or institute for the

award of any degree or diploma. This is being submitted for the

partial fulfilment of my Bachelor of Science in Electronic and

Telecommunication degree.

Signature

Place: BJB (AUTONOMOUS) COLLEGE

Date: 13/04/2024

5
CONTENT

SL NO. TOPICS PAGE NO.

1. Cover page i

2 Certificate from Industry/Organization ii

3. Certificate from Department iii

4. Acknowledgement iv

5. Declaration v

6. Content vi

7 Abstract 7

8 Introduction 8

9 Project Overview & Methodology 10

10 Hardware/Software requirements and working 12


principle
11 Component Study and review 24

12 Dataflow diagram/Block Diagrams 25

13 Circuit Analysis & Design 26

14 Coding & Testing 28

15 Advantages & Limitations 32

16 Conclusion & Future Scope 34

17 References 35

6
ABSTRACT

IOT or internet of things is an upcoming technology that allows us to control hardware devices through
the internet. Here we propose to use IOT in order to control home appliances, thus automating modern
homes through the internet. This system uses two loads to demonstrate as house lighting and a fan.
Our user-friendly interface allows a user to easily control these home appliances through the internet.
For this system we use a NODE MCU microcontroller. This microcontroller is inbuilt with a esp8266
wifi module to get user commands over the internet. Relays are used to switch loads. Here two sensor
that is flame sensor and gas sensor is used to continue measure the fire and poisonous gas. If room gas
level or detects fire in the home it activates the buzzer and send notification to the IOT terminal. The
entire system is powered by a 12 V transformer. After receiving user commands over the internet,
microcontroller processes these instructions to operate these loads accordingly and. Thus, this system
allows for efficient home automation over the internet.

With the rapid advancement of technology, the concept of the Internet of Things (IoT) has
gained significant attention, particularly in the domain of home safety and security. This abstract
presents an innovative IoT-based home safety system integrated with fire and gas sensors aimed at
enhancing residential safety measures. The proposed system employs a network of interconnected
sensors and actuators to monitor and respond to potential fire and gas leakage incidents promptly. The
core components of the system include fire and gas sensors strategically positioned within the
household premises. These sensors continuously monitor environmental parameters such as
temperature, smoke density, and gas concentrations. In the event of any abnormality detected by the
sensors, real-time alerts are generated, triggering immediate actions to mitigate the potential risks.

The IoT-based architecture of the system enables seamless communication between the
sensors, actuators, and a central control unit. Utilizing wireless communication protocols such as Wi-
Fi or Bluetooth, the sensors relay data to the control unit, which analyses the information and initiates
appropriate responses. Additionally, the system can be accessed remotely via smartphone applications
or web interfaces, providing homeowners with real-time monitoring and control capabilities from
anywhere. Upon detecting a fire outbreak, the system activates various safety measures autonomously.
This may include triggering alarms to alert occupants, activating sprinkler systems to suppress the fire,
and communicating with emergency services for swift intervention. Similarly, in the case of gas leaks,
the system can automatically shut off the gas supply and ventilate the affected area to prevent the
escalation of hazards.

7
INTRODUCTION

In an era characterized by rapid technological advancements and increasing concerns


regarding home safety, the integration of Internet of Things (IoT) technologies has
emerged as a promising solution. The fusion of IoT with traditional safety systems
has paved the way for innovative approaches to mitigate risks and enhance protection
within residential environments. This report delves into the development and
implementation of an IoT-based home safety system, specifically focusing on the
utilization of fire and gas sensors. The primary objective of this system is to
proactively detect and respond to potential fire and gas leakage incidents, thereby
safeguarding lives and property.

The integration of fire and gas sensors within the IoT framework enables real-
time monitoring and remote management capabilities, empowering homeowners
with greater control and visibility over their safety environment. Leveraging the
connectivity and data processing capabilities of IoT devices, the system enhances
situational awareness and facilitates timely interventions in the event of emergencies.
Furthermore, the report explores the technical specifications, design considerations,
and operational functionalities of the IoT-based home safety system. It examines the
underlying architecture, sensor deployment strategies, communication protocols,
and alarm mechanisms essential for effective hazard detection and response.
Through a comprehensive analysis of case studies, experimental results, and user
feedback, this report aims to evaluate the efficacy, reliability, and practicality of the
proposed IoT-based home safety system. By highlighting its strengths, limitations,
and potential areas for improvement, it seeks to provide valuable insights for
researchers, developers, and stakeholders interested in enhancing residential safety
through IoT technologies. In recent years, the integration of smart technologies into
our homes has revolutionized the way we interact with our living spaces. Among
these advancements, the concept of the Internet of Things (IoT) has emerged as a
transformative force, offering unprecedented levels of connectivity and automation.
One of the most critical applications of IoT in the realm of home automation is the
implementation of home safety systems. These systems utilize interconnected
sensors, actuators, and intelligent algorithms to monitor, analyse, and respond to
potential safety hazards in real-time. The traditional approach to home safety relied
heavily on passive measures such as smoke detectors and carbon monoxide alarms,
which provided limited functionality and required manual intervention in case of
emergencies. However, with the advent of IoT technologies, the landscape of home
safety has undergone a profound evolution. IoT-based home safety systems offer a
holistic approach to safeguarding residential properties, incorporating a diverse array
of sensors and smart devices to detect and mitigate various threats effectively.

8
Central to the functionality of IoT-based home safety systems are sensors capable of
detecting a wide range of environmental parameters. These sensors can monitor
factors such as temperature, humidity, smoke, gas concentrations, and even motion,
providing comprehensive coverage of potential safety risks. By continuously
analysing the data collected from these sensors, the system can identify anomalies
and trigger appropriate responses to address emerging threats promptly. Moreover,
the connectivity enabled by IoT technologies allows for seamless communication
between the various components of the home safety system. Wireless protocols such
as Wi-Fi, Bluetooth, and Zigbee facilitate the exchange of information between
sensors, actuators, and a centralized control unit. This interconnectedness not only
enables real-time monitoring but also allows homeowners to remotely access and
manage their safety systems through smartphones, tablets, or web interfaces. The
incorporation of automation and intelligent algorithms further enhances the
capabilities of IoT-based home safety systems. Machine learning algorithms can
analyse historical data to identify patterns and anomalies, enabling the system to
anticipate potential hazards and take proactive measures to prevent accidents.
Additionally, the system can automate responses to detected threats, such as
activating alarms, shutting off utilities, or even contacting emergency services
autonomously.

In summary, IoT-based home safety systems represent a significant


advancement in residential safety management. By leveraging the power of IoT
technologies, these systems offer unparalleled levels of monitoring, control, and
automation, thereby enhancing the overall safety and security of our homes. As the
IoT ecosystem continues to evolve, the potential for further innovations in home safety
systems remains vast, promising safer and more resilient living environments for
homeowners worldwide.

9
PROJECT OVERVIEW & METHODOLOGY

Overview:
The project aims to develop an IoT-based home security system with integrated fire and gas sensors.
The system will provide real-time monitoring and alerts for detecting fire or high gas levels in the
home environment. Additionally, it will include control mechanisms such as activating a buzzer alarm
and triggering relays to turn on/off devices like fans and lights.

Methodology
Requirement Analysis

 Identify the key requirements of the home security system, including sensor types,
communication protocols, and user interface preferences.
 Define the functionalities such as sensor data processing, alarm triggering, and remote
monitoring.

System Design

 Design the system architecture, including hardware and software components.


 Select appropriate sensors (fire sensor, gas sensor), microcontroller, Wi-Fi module, and other
peripherals.
 Determine the communication protocols for sensor data transmission and integration with the
Blynk cloud platform.

Hardware Implementation:

 Assemble the hardware components based on the system design.


 Connect the sensors to the microcontroller, ensuring proper wiring and signal integrity.
 Integrate additional hardware such as buzzer and relays for alarm and control functionalities.

Software Development

 Develop firmware for the microcontroller to handle sensor data acquisition, processing, and
communication.
 Implement algorithms for detecting fire/smoke levels and gas concentrations based on sensor
readings.
 Integrate the Blynk library for IoT connectivity and create a user interface for remote
monitoring/control.

10
Testing and Validation

 Conduct comprehensive testing of the system to verify its functionality and reliability.
 Test sensor accuracy, alarm triggering mechanisms, and remote monitoring features.
 Validate the system's response under different scenarios, including fire/smoke detection and
gas level variations.

Documentation and Report in

 Document the entire development process, including hardware schematics, software code,
and test results.
 Prepare a project report outlining the project overview, methodology, implementation
details, and test findings.
 Provide recommendations for future improvements and enhancements to the system.

11
HARDWARE/SOFTWARE REQUIREMENTS

Hardware Requirements:
1. Microcontroller: ESP32.

3. Fire Sensor: Smoke detector or flame sensor.

4. Gas Sensor: MQ series gas sensor for detecting harmful gases like carbon monoxide (CO).

5. Buzzer: Audible alarm for alerting occupants in case of fire or high gas levels.

6. Relays: Electromechanical relays for controlling devices such as fans and lights.

7. Power Supply: Suitable power source to power the microcontroller and peripherals.

8. Breadboard/Jumper Wires: For prototyping and connecting components.

9. Enclosure: Housing to protect the circuitry and components.

Software Requirements:
1. Arduino IDE: Integrated Development Environment for programming the microcontroller.

2. Blynk Library: Library for interfacing Arduino with the Blynk cloud platform.

3. Libraries for Sensors: Install libraries required for interfacing with fire and gas sensors.

4. Blynk Mobile App: For monitoring and controlling the security system remotely via a smartphone
or tablet.

5. Text Editor: Optionally, a text editor for documenting code and project details.

6. Internet Connection: Required for connecting the Wi-Fi module to the Blynk cloud platform.

12
WORKING PRINCIPLE
POWER SUPPLY

Description:
Power supply is the circuit from which we get a desired dc voltage to run the other circuits. The voltage
we get from the main line is 230V AC but the other components of our circuit require 5V DC. Hence a
step-down transformer is used to get 12V AC which is later converted to 12V DC using a rectifier. The
output of rectifier still contains some ripples even though it is a DC signal due to which it is called as
Pulsating DC. To remove the ripples and obtain smoothed DC power filter circuits are used. Here a
capacitor is used. The 12V DC is rated down to 5V using a positive voltage regulator chip 7805. Thus
a fixed DC voltage of 5V is obtained.

A 5V regulated supply is taken as followed:

Each of the blocks is described in more detail below:

 Transformer - steps down high voltage AC mains to low voltage AC.


 Rectifier - converts AC to DC, but the DC output is varying.
 Smoothing - smooths the DC from varying greatly to a small ripple.
 Regulator - eliminates ripple by setting DC output to a fixed voltage.

Transformer

Transformer is the electrical device that converts one voltage to another with little loss of power.
Transformers work only with AC. There are two types of transformers as Step-up and Step-down
transformer. Step-up transformers increase voltage, step-down transformers reduce voltage. Most
power supplies use a step-down transformer to reduce the dangerously high mains voltage to a safer
low voltage. Here a step down transformer is used to get 12V AC from the supply i.e. 230V AC.

13
Rectifiers

A rectifier is a circuit that converts AC signals to DC. A rectifier circuit is made using diodes. There
are two types of rectifier circuits as Half-wave rectifier and Full-wave rectifier depending upon the
DC signal generated.

Half-wave Rectifier

It is the rectifier circuit that rectifies only half part of the AC signal. It uses only a single diode. It only
uses only positive part of the AC signal to produce half-wave varying DC and produce gaps when the
AC is negative.

Full-wave Rectifier:

It is also called as Bridge Rectifier. A


bridge rectifier can be made using four
individual diodes, but it is also available
in special packages containing the four
diodes required. It is called a full-wave
rectifier because it uses the total AC wave
(both positive and negative sections).

14
Smoothing
Smoothing is performed by a large value electrolytic
capacitor connected across the DC supply to act as a
reservoir, supplying current to the output when the
varying DC voltage from the rectifier is falling. The
diagram shows the unsmoothed varying DC (dotted line) and the smoothed DC (solid line). The
capacitor charges quickly near the peak of the varying DC, and then discharges as it supplies current to
the output. Here a capacitor of 330uF is used as a smoothing circuit.

Voltage regulation

Voltage regulators produce fixed DC output voltage from variable DC (a small amount of AC on it).
Normally we get fixed output by connecting the voltage regulator at the output of the filtered DC. It
can also used in circuits to get a low DC voltage from a high DC voltage (for example we use 7805 to
get 5V from 12V). There are two types of voltage regulators

1. fixed voltage regulators (78xx, 79xx)

2. Variable voltage regulators (LM317)

In fixed voltage regulators there is another classification

15
1. Positive voltage regulators

2. Negative voltage regulators

Positive voltage regulators


This includes 78xx voltage regulators. The most commonly used ones are 7805 and 7812. 7805 gives
fixed 5V DC voltage if input voltage is in (7.5V-20). You may sometimes have questions like, what
happens if input voltage is <7.5 V or some 3V, the answer is that regulation won't be proper. Suppose
if input is 6V then output may be 5V or 4.8V, but there are some parameters for the voltage regulators
like maximum output current capability, line regulation etc. won't be proper. Remember that
electronics components should be used in the proper voltage and current ratings as specified in
datasheet. You can work without following it, but you won't be able to get some parameters of the
component.
Negative voltage regulators
Mostly available negative voltage regulators are of 79xx family. The mainly available 79xx IC's are
7905,7912 1.5A output current ,short circuit protection, ripple rejection are the other features of 79xx
IC's.

Many of the fixed voltage regulators have 3 leads and look like power transistors, such as the 7805
(+5V 1A) regulator shown on the above. If adequate heat sinking is provided then it can deliver up to
maximum 1A current. For an output voltage of 5v-18v the maximum input voltage is 35v and for an
output voltage of 24V the maximum input voltage is 40V.For 7805 IC, for an input of 10v the minimum
output voltage is 4.8V and the maximum output voltage is 5.2V. The typical dropout voltage is 2V.

16
CIRCUIT DIAGRAM OF POWER SUPPLY

POWER SUPPLY

Circuit Diagram

WORKING

The above circuit obtains power from a 230V AC mains supply voltage and fed into a step
down transformer for transforming higher voltage supply to lower one. The transformer TR1 can be
of 230V primary, 15V secondary and 1A step down transformer. The stepped down voltage can be fed
into the bridge rectifier made of four 1N4007 diodes for the conversion of AC supply to DC one.

17
IC regulator pin out

The output from the bridge rectifier was filtered by the capacitor C1 to offer a steady DC level to
the input pins of the regulators used in the above circuit. The DC voltage is then fed in to the IC 7805 which
is a 5V regulator and also to the IC 7812 which was a 12V regulator. The output obtained from the 7805 &
7012 are 5V and 12V respectively. Capacitors C3 and C4 are employed at the outputs are used to give a
steady voltage at the output terminal. A LED D5 was connected through the current limiting resistor R1 for
indicate the state of the device.

This kind of circuits are highly useful where two dual range of DC voltages are used to power the
operation of a circuit. Varying the voltage regulator IC’s 7805 or 7812 with 7806 and 7808 to obtain 6V and
8V as output. But each IC have minimum and maximum voltage requirements, so make sure you build in
such a way to meet the requirements.

ESP 32
Getting Started
About Arduino ESP32
Welcome to the Arduino ESP32 support documentation! Here you will find important information on
how to use the project. ESP32 is a single 2.4 GHz Wi-Fi-and-Bluetooth SoC (System On a Chip)
designed by Espressif Systems.

ESP32 is designed for mobile, wearable electronics, and Internet-of-Things (IoT) applications.
It features all the state-of-the-art characteristics of low-power chips, including fine-grained clock
gating, multiple power modes,and dynamic power scaling. For instance, in a low-power IoT sensor
hub application scenario, ESP32 is woken-up periodically and only when a specified condition is
detected. Low-duty cycle is used to minimize the amount of energy that the chip expends.

18
The output of the power amplifier is also adjustable, thus contributing to an optimal trade-off
between communication range, data rate and power consumption.

The ESP32 series is available as a chip or module.

Supported SoC’s
Here are the ESP32 series supported by the Arduino-ESP32 project:

SoC Stable Development Datasheet


ESP32 Yes Yes ESP32
ESP32-S2 Yes Yes ESP32-S2
ESP32-C3 Yes Yes ESP32-C3
ESP32-S3 No Yes ESP32-S3
See Boards for more details about ESP32 development boards.

Arduino Core Reference


This documentation is built on the ESP32 and we are not going to cover the common Arduino API. To
see the Arduino reference documentation, please consider reading the official documentation.

Arduino Official Documentation: Arduino Reference.

Windows Linux macOS

19
Supported IDEs
Here is the list of supported IDE for Arduino ESP32 support integration.

Arduino IDE Platform IO


See Installing Guides for more details on how to install the Arduino ESP32 support .

Support
This is an open project and it’s supported by the community. Fell free to ask for help in one of the
community channels.

Community
The Arduino community is huge! You can find a lot of useful content on the Internet. Here are some
community channels where you may find information and ask for some help, if needed.

 ESP32 Forum: Official Espressif Forum.


 ESP32 Forum - Arduino: Official Espressif Forum for Arduino related discussions.
 ESP32 Forum - Hardware: Official Espressif Forum for Hardware related discussions.
 Gitter
 Espressif MCUs (Discord)
 ESP32 on Reddit

Issues Reporting
Before opening a new issue, please read this:

Be sure to search for a similar reported issue. This avoids duplicating or creating noise in the GitHub
Issues reporting. We also have the troubleshooting guide to save your time on the most common issues
reported by users.

For more details about creating new Issue, see the Issue Template.

If you have any new idea, see the Feature request Template.

20
RELAY

Definition

A relay is an electrically operated switch. Current flowing through the coil of the relay creates
a magnetic field which attracts a lever and changes the switch contacts. The coil current can be on or
off so relays have two switch positions and they are double throw (changeover) switches.

Relays allow one circuit to switch a second circuit which can be completely separate from the
first. For example a low voltage battery circuit can use a relay to switch a 230V AC mains circuit.
There is no electrical connection inside the relay between the two circuits; the link is magnetic and
mechanical.

The coil of a relay passes a relatively large current, typically 30mA for a 12V relay, but it can
be as much as 100mA for relays designed to operate from lower voltages. Most ICs (chips) cannot
provide this current and a transistor is usually used to amplify the small IC current to the larger value
required for the relay coil. The maximum output current for the popular 555 timer IC is 200mA so
these devices can supply relay coils directly without amplification. Current flowing through a relay
coil creates a magnetic field which collapses suddenly when the current is switched off. The sudden
collapse of the magnetic field induces a brief high voltage across the relay coil which is very likely to
damage transistors and ICs. The protection diode allows the induced voltage to drive a brief current
through the coil (and diode) so the magnetic field dies away quickly rather than instantly. This prevents
the induced voltage becoming high enough to cause damage to transistors and ICs.
The relay's switch connections are usually labeled COM, NC and NO:

 COM = Common, always connect to this, it is the moving part of the switch.

 NC = Normally Closed, COM is connected to this when the relay coil is off.

 NO = Normally Open, COM is connected to this when the relay coil is on.

21
Schematic diagram

22
Comparison between Relay and Transistor
Like relays, transistors can be used as an electrically operated switch. For switching small DC currents
(< 1A) at low voltage they are usually a better choice than a relay. However transistors cannot switch
AC or high voltages (such as mains electricity) and they are not usually a good choice for switching
large currents (> 5A). In these cases a relay will be needed, but note that a low power transistor may
still be needed to switch the current for the relay's coil! The main advantages and disadvantages of
relays are listed below:

Advantages of relays

 Relays can switch AC and DC, transistors can only switch DC.
 Relays can switch high voltages, transistors cannot.
 Relays are a better choice for switching large currents (> 5A).
 Relays can switch many contacts at once.

Disadvantages of relays

 Relays are bulkier than transistors for switching small currents.


 Relays cannot switch rapidly (except reed relays), transistors can switch many times per
second.
 Relays use more power due to the current flowing through their coil.
 Relays require more current than many ICs can provide, so a low power transistor
may be needed to switch the current for the relay's coil.

23
COMPONENT STUDY AND REVIEW:

Wi-Fi Module (ESP8266 or ESP32):

 ESP8266 and ESP32 are popular Wi-Fi modules known for their low cost and integrated Wi-
Fi capabilities.
 ESP8266 is suitable for basic IoT applications, offering Wi-Fi connectivity at a lower price
point.
 ESP32 provides more features such as Bluetooth support, higher processing power, and more
GPIO pins.
 Both modules can be programmed using the Arduino IDE and have extensive community
support.

Fire Sensor (Smoke Detector or Flame Sensor):

 Smoke detectors are commonly used for fire detection in home security systems.
 They typically consist of a smoke chamber and a sensing element that detects smoke particles.
 Flame sensors are another option for detecting flames directly, commonly used in industrial
settings.
 Consider factors such as detection range, sensitivity, and response time when choosing a fire
sensor.

Gas Sensor (MQ series gas sensor):

 MQ series gas sensors are widely used for detecting various gases, including carbon monoxide
(CO), methane (CH4), and LPG.
 They operate based on the principle of gas conductivity, where gas molecules adsorb onto the
sensor surface, changing its resistance.
 MQ sensors are affordable and easy to use but may require calibration for accurate gas
concentration measurements.
 Consider the specific gas(s) to be detected and the sensitivity of the sensor when selecting an
MQ series sensor.

Buzzer:

 Buzzer or piezo buzzers are commonly used for generating audible alarms in electronic
systems.
 They produce sound when an alternating voltage is applied to them, making them suitable for
alerting users in case of emergencies.
 Consider factors such as sound output level, frequency, and power requirements when choosing
a buzzer for the home security system.

Relays:

24
 Relays are electromechanical switches used for controlling high-power devices with low-
power signals.
 They consist of a coil and contacts, where energizing the coil closes or opens the contacts,
controlling the connected device.
 Choose relays with appropriate current and voltage ratings based on the devices (e.g., fans,
lights) to be controlled.
 Solid-state relays (SSRs) are also an option, offering faster switching and no mechanical wear,
but they may be more expensive.

Power Supply:

 Ensure the power supply can provide stable and sufficient voltage and current for the
microcontroller, sensors, and other components.
 Consider factors such as input voltage range, output voltage/current, efficiency, and safety
features (e.g., overcurrent protection, short circuit protection).
 Choose a power supply that meets the specific requirements of the components and provides
reliable operation.

DATAFLOW DIAGRAM/BLOCK DIAGRAM

25
CIRCUIT ANALYSIS & DESIGN:

1. Microcontroller Interface:
o Connect the Arduino Uno to the Wi-Fi module (ESP8266 or ESP32) using UART
communication for internet connectivity.
o Utilize digital and analog pins of the Arduino Uno for interfacing with sensors (fire sensor, gas
sensor), buzzer, and relays.

2. Sensor Interface:
o Connect the fire sensor output to a digital pin of the Arduino Uno for detecting fire or smoke
presence.
o Interface the gas sensor output with an analog pin of the Arduino Uno to measure gas
concentration levels.
o Ensure proper voltage levels and signal conditioning for accurate sensor readings.

3. Buzzer Alarm:
o Connect the buzzer to a digital pin of the Arduino Uno to generate audible alarms.
o Trigger the buzzer alarm when the fire sensor detects smoke/fire or when gas concentration
exceeds the threshold level.

4. Relay Control:
o Utilize digital pins of the Arduino Uno to control the relays for switching devices such as fans
and lights.
o Activate the relay connected to the fan when smoke/fire is detected to exhaust the fumes.
o Activate the relay connected to the light when smoke/fire is detected for illumination and
evacuation assistance.

5. Power Supply:
o Provide a stable power supply to the Arduino Uno, sensors, Wi-Fi module, and other
components.
o Use a regulated power supply or batteries with appropriate voltage and current ratings.
o Ensure proper grounding and decoupling capacitors to minimize noise and ensure reliable
operation.

26
6. Protection Mechanisms:
o Implement overcurrent protection for the components to prevent damage in case of faults.
o Include surge protection devices or transient voltage suppressors to protect against voltage
spikes and transients.
o Use fuses or circuit breakers as necessary to protect against overcurrent conditions.

7. PCB Design Considerations:


o Design a printed circuit board (PCB) layout that minimizes signal interference and ensures
proper routing of connections.
o Arrange components on the PCB to optimize space utilization and facilitate assembly and
maintenance.
o Include mounting holes and labels for easy identification and installation.

8. Testing and Validation:


o Verify the functionality of each circuit block through simulation and prototyping.
o Test the response of the system under various scenarios, including fire/smoke detection and
gas level variations.
o Validate the reliability and accuracy of sensor readings, alarm triggering mechanisms, and
relay control.

9. Optimization and Refinement:


o Fine-tune the circuit design to optimize performance, minimize power consumption, and
improve reliability.
o Consider feedback from testing and user requirements for refinement and iteration of the
design.
o Document the finalized circuit design, including schematics, PCB layout, and component
specifications.

27
CODING AND TESTING

CODING
#define BLYNK_TEMPLATE_ID "TMPL3ryZci95U"

#define BLYNK_TEMPLATE_NAME "iotsystem63"

#define BLYNK_AUTH_TOKEN "sKDb3wS4prP7Bo6nYr6etz-sK6jz3PcX"

// Comment this out to disable prints and save space

#define BLYNK_PRINT Serial

#include <WiFi.h>

#include <WiFiClient.h>

#include <BlynkSimpleEsp32.h>

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,20,4);

char auth[] = BLYNK_AUTH_TOKEN;

char ssid[] = "admin";

char pass[] = "12345678";

String fire_status="";

int buzzer=25;

void setup() {

lcd.init(); // initialize the lcd

// Print a message to the LCD.

lcd.backlight();

Serial.begin(9600);

Blynk.begin(auth, ssid, pass);

28
pinMode(buzzer, OUTPUT);

pinMode(32, INPUT);

pinMode(13, OUTPUT);

pinMode(12, OUTPUT);

digitalWrite(13 , LOW);

digitalWrite(12 , LOW);

void loop() {

Blynk.run();

int fire= digitalRead(32);

int gas_value = analogRead(34);

int gas_map = map(gas_value ,2000, 2800, 0, 100);

if(gas_map > 30)

digitalWrite(buzzer , HIGH);

delay(1000);

digitalWrite(buzzer , LOW);

if(gas_map < 30)

digitalWrite(buzzer , LOW);

29
if(fire==0)

fire_status="fire detected!!!";

digitalWrite(buzzer , HIGH);

delay(1000);

digitalWrite(buzzer , LOW);

if(fire==1)

fire_status=" NO Fire ";

digitalWrite(buzzer , LOW);

if(gas_map >30 || fire==0)

digitalWrite(12 , HIGH);

digitalWrite(13 , HIGH);

delay(20000);

if(gas_map < 30 && fire==1)

digitalWrite(12 , LOW);

digitalWrite(13 , LOW);

Serial.print("-");

Serial.print(gas_value);

Serial.println("-");

30
if(gas_map <1){gas_map=0;}

lcd.setCursor(0,0);

//lcd.print("Fire:");

lcd.print(fire_status);

//lcd.print("ug/M3 ");

lcd.setCursor(0,1);

lcd.print("co2:");

lcd.print(gas_map);

lcd.print(" % ");

Blynk.virtualWrite(V0, fire_status);

Blynk.virtualWrite(V1, gas_map);

31
ADVANTAGES
FIRE SENSOR

 Certainty of avoiding the outbreak and spread of fire


 Retaining access to protected areas at any time
 Proactive and permanent fire protection to secure business processes and valuable goods
 Protecting multiple hazards with just one system
 Fire protection without any interruption - no refilling or replacement needed
 Absolute safety for human beings through using breathable air - no nitrogen injection
 Environmentally friendly - no chemicals used
 Easy to install and maintain
 Very small footprint and little building space needed
 Scalable to any size of protected areas and number of protected compartments
 No design limitations
 No damages by fire, released water, foam or other extinguishing agents
 No excessive piping, no nozzles, no pressurized cylinders, no leaking
 No false discharges , no discharge failures, no loss of work time , no interruptions of working
processes, no consequential costs
 No disruption of working processes, no consequential costs, no closing of unusable areas due
to fire damages, clean-up or repair

GAS SENSOR
 Non-conductive: In comparison to traditional firefighting methods, Gas Suppression
Systems do not conduct electricity and therefore create a safer means if extinguishing
electrical fires.

 Quick Response: Not only will a gas suppression system quickly extinguish a fire,
reducing the amount of damage caused by the ignition itself, but also can minimise
the amount of damage caused by smoke and soot the occurs as a by-product of the
fire.

 Minimal Damage: The damage caused by the fire is not the only concern when
dealing with a business fire, the residue or water left behind by a traditional fire
extinguisher can be extremely damaging to items like electronics. With a gas
suppression system, your business will be back up and running much quicker, as there
is much less clean up required in the aftermath of the fire’s extinction.

 Protect Employees and Occupants: Since a gas suppression system can be used in
rooms that are both occupied and unoccupied (system dependant), there is no need for

32
evacuation before the system is triggered and therefore the fire will be extinguished
faster, protect your valuable human resources.

 Eco – Friendly: Clean agent gas suppression systems such as the Novec 1230, are
environmentally friendly and will not contribute to the depletion of the earth’s ozone.

LIMITATIONS
While IoT-based home safety systems incorporating fire and gas sensors with an ESP32 MCU
offer promising advancements in residential security, several limitations warrant
consideration:

Reliability Concerns: IoT devices are susceptible to connectivity issues, such as network
outages or signal interference, compromising the reliability of real-time monitoring and
response.

Security Risks: The interconnected nature of IoT devices introduces vulnerabilities to cyber
threats, including hacking and data breaches, potentially compromising sensitive information
or allowing unauthorized access to the system.

Limited Compatibility: Compatibility issues may arise when integrating IoT devices from
different manufacturers or utilizing proprietary communication protocols, hindering seamless
interoperability and system scalability.

Power Dependency: IoT devices, including the ESP32 MCU, rely on power sources, such as
batteries or electrical outlets. Power failures or drained batteries can render the system non-
functional, undermining its effectiveness during emergencies.

Maintenance Requirements: Regular maintenance, including software updates, battery


replacements, and sensor calibrations, is necessary to ensure optimal performance and
accuracy, imposing additional time and resource burdens on users.

33
CONCLUSION
while IoT-based home safety systems integrating fire and gas sensors with an ESP32
MCU present a promising solution for enhancing residential security, they are not
without their limitations. Despite advancements in technology, concerns surrounding
reliability, security, compatibility, power dependency, maintenance, environmental
factors, privacy, and cost persist and must be addressed to realize their full potential.
However, these limitations should not overshadow the significant benefits that IoT-
based home safety systems offer. By providing real-time monitoring, early detection
of potential hazards, and prompt response capabilities, these systems have the
potential to save lives, prevent property damage, and offer peace of mind to
homeowners. To mitigate the identified limitations, a multifaceted approach is
required. This includes investing in robust cybersecurity measures to safeguard
against cyber threats, ensuring interoperability and compatibility through
standardization efforts, implementing efficient power management solutions to
mitigate power dependency issues, and establishing clear maintenance protocols to
uphold system integrity and reliability. Additionally, ongoing research and
development efforts aimed at improving sensor accuracy, optimizing communication
protocols, and enhancing user experience are essential for driving innovation in the
field. Furthermore, collaboration between stakeholders, including manufacturers,
policymakers, regulatory bodies, and consumers, is crucial for addressing privacy
concerns, promoting transparency, and fostering trust in IoT-based home safety
systems. Ultimately, while challenges exist, the potential of IoT-based home safety
systems to revolutionize residential security cannot be overstated. With careful
consideration of these limitations and concerted efforts to overcome them, IoT-based
home safety systems have the opportunity to become indispensable tools in
safeguarding homes and communities against fire and gas-related hazards.

34
REFERENCES

1.Foltýnek P, Babiuch M and Šuránek P. Measurement and data processing from Internet of Things
modules by dual-core application using ESP32 board. Meas. Control. 2019; 7-8. DOI:
10.1177/0020294019857748.
2.Dokic K, Martinovic M and Radisic B. Neural Networks with ESP32 - Are Two Heads Faster than
One? Conference on Data Science and Machine Learning Applications, CDMA 2020. DOI:
10.1109/CDMA47397.2020.00030.
3.Biswas SB. and Tariq Iqbal M. Solar Water Pumping System Control Using a Low Cost ESP32
Microcontroller. 2018 IEEE Canadian Conference on Electrical & Computer Engineering
(CCECE). DOI: 10.1109/CCECE.2018.8447749.
4.Kodali RK and Valdas A. MQTT Based Monitoring System for Urban Farmers Using ESP32 and
Raspberry Pi. International Conference on Green Computing and Internet of Things, ICGCIoT 2018.
DOI: 10.1109/ICGCIoT.2018.8752995.
5.Ram CRS, Ravimaran S, Krishnan RS, Ismail, M, et al. Internet of Green Things with autonomous
wireless wheel robots against green houses and farms. Int. J. Distrib. Sens. Netw. 2020; 6. DOI:
10.1177/1550147720923477.
6.Harsh N. Shah, Zishan Khan, Abbas Ali Merchant, Moin Moghal, Aamir Shaikh, Priti Rane,
“IOT Based Air Pollution Monitoring System”, International
Journal of Scientific & Engineering Research, Vol. 9, Issue 2, Feb.2018, pp. 62-66.
7.C. Xiaojun, L. Xianpeng and X. Peng, “IOT-based air pollution monitoring and forecasting
system,” 2015 International Conference on Computer and
Computational Sciences (ICCCS), Noida, 2015, pp. 257-260, doi: 10.1109/ICCACS.2015.7361361.
8.S. Kumar and A. Jasuja, “Air quality monitoring system based on IoT using Raspberry Pi,” 2017
International Conference on Computing, Communication and
Automation (ICCCA), Greater Noida, 2017, pp. 1341-1346, doi: 10.1109/CCAA.2017.8230005.
9.S. Dhingra, R. B. Madda, A. H. Gandomi, R. Patan and M. Daneshmand, “Internet of Things
Mobile–Air Pollution Monitoring System (IoT-Mobair),” in IEEE
Internet of Things Journal, vol. 6, no. 3, pp. 5577-5584, June 2019, doi: 10.1109/JIOT.2019.2903821

35
36

You might also like