Prototype of Automatic Door and Fire Alarm System Based on IoT

This research discusses the development of a prototype of an automatic door and fire alarm system based on the Internet of Things (IoT) utilizing IR sensors to detect people, servo motors to automate door opening, flame detectors for fire detection, MQ-2 sensors for smoke detection, and Telegram as a notification medium. The integration of these technologies aims to enhance security and automation in home or office environments. IR sensors are used to detect people approaching the door, while servo motors provide a solution for door automation. Flame detectors and MQ-2 are employed to detect potential fires by issuing early warnings. This system communicates through the Telegram application to notify users. Testing conducted indicates that IR sensors can detect the presence of people up to a distance of 5cm to activate the micro servo opening the door. The flame detector effectively detects fire up to a distance of 30cm, while the MQ-2 sensor detects smoke up to a distance of 20cm; both generate output signals to activate the micro servo, LED, and buzzer for fire alarms, as well as sending notifications via Telegram to the building owner.


I. INTRODUCTION
The pace of scientific and technological advancement, particularly in electronics, is accelerating in today's world.This acceleration is attributed to the progression of human civilization and culture towards greater sophistication [1].The positive impact can be seen through the use of various automatic equipment that simplifies human daily activities.Certainly, with this automatic equipment, humans can carry out their various activities more efficiently.One striking example is the use of automatic doors.Automatic doors are crucial facilities in various buildings or locations with high mobility, such as offices, shopping centers, hospitals, and others.However, in reality, some still use manual doors that require time and effort, especially in locations with high mobility that require a quick process, such as in convenience stores.The use of manual doors in such places is considered inefficient.Furthermore, manual doors can also pose difficulties for individuals with disabilities or special needs, such as people with physical impairments.
Fire is an occurrence that nobody desires.It can lead to substantial damages, including both material losses and loss of lives [2].Based on global data on occupational health and safety accidents (K3), the most severe fatalities due to factory fires occur in almost every country in the world, ranking below natural disasters such as earthquakes/tsunamis [3].In fire situations, early detection and swift action are crucial to minimize losses and avoid serious hazards.Therefore, an efficient and reliable fire alarm system is needed to provide timely protection and notifications.
Internet of Things (IoT), often referred to as IoT, is an embedded system aimed at expanding the usage of continuously connected internet connectivity [4].The Internet of Things (IoT) continues to grow and become increasingly popular in the world of Information Technology, bringing about the latest innovations.In recent decades, IoT has captured users' attention by introducing the concept of a global infrastructure connecting physical objects, enabling flexible and universal connectivity anywhere, anytime, and by anyone [5].
Current technological developments can be applied in the design of automatic doors and fire alarm systems.There are already many sensors that can be used.One example is the utilization of IR (Infra Red) sensors that can detect the presence of people, Micro servos that can operate door opening and closing, MQ-2 sensors that can detect smoke, and also flame detectors that can detect the presence of fire that can cause a fire.Additionally, Telegram can be used as a notification system for building owners.These three sensors and devices are installed in a microcontroller based on NodeMCU so that they can work optimally.

II. RELATED WORKS/LITERATURE REVIEW
The research by Abdha Falky Rabb and Rahmat Hidayat (2023) titled "Design of Automatic Door Using PIR Sensor Based on Arduino" aims to design an automatic door system involving the integration of automatic control combined with sensors and servo motors.According to this study, the system is activated by turning on the microcontroller via an adapter connected to the Arduino Board.Once the microcontroller is activated, the PIR sensor starts detecting.Arduino then receives information from the PIR sensor and sends commands to the servo motor to control the door's movement, whether to open or close it.Without microcontroller activation, the PIR sensor will not be able to detect changes.Testing of the system and sensors shows satisfactory results in the use of PIR sensors, which can operate well where the PIR sensor is able to detect motion to be used as input signal to Arduino to control the servo.However, the sensor is unable to detect objects at distances greater than 3.5 meters, and there is no testing conducted on the response time of servo motor movement when the PIR sensor detects an object [6].
The research by Dian Indriani, Muhammad Subhan, Eka Rahmawati (2021) titled "Arduino-Based Fire Alarm System Using Flame Detector and MQ-2 Sensor," aims to develop a fire alarm system designed and constructed to identify early signs of fire and then provide warning signals for evacuation procedures.This system can react automatically or manually to fires and is integrated with fire extinguishing installation systems.The design utilizes a flame detector module and an MQ-2 sensor module for gas detection.Testing of the system and sensors yielded satisfactory results in the operation of the flame detector and MQ-2 sensor.Both sensors are effective in detecting the presence of fire and gas, which then trigger the Arduino to activate the buzzer and LED as indicators.However, in the testing, the flame detector placed at a distance of 40 cm only managed to detect fire in 3 out of 7 trials, resulting in limited activation of the buzzer and LED.Additionally, at distances of 30 cm and 40 cm, the MQ-2 sensor only successfully detected smoke with concentrations below 1.20 PPM, which was insufficient to activate the buzzer and LED [7].
The research by Siswanto, Thoha Nurhadian H, Muhamad Junaedi (2020) titled "Prototype Smart Home with IoT (Internet of Things) Concept Based on NodeMCU and Telegram" aims to develop a Prototype Smart Home with IoT (Internet of Things) Concept Based on NodeMCU and Telegram.This system is designed to utilize Telegram Messenger as an input tool and as a notification medium within the system.When a message arrives, the message data will be read by the program for verification purposes.If the verification process fails, the system will not respond and will return the message for re-entry.If the verification process is successful, the BOT will respond by sending an input signal to the microcontroller for processing.After the microcontroller completes the processing, the output signal (on/off) will be forwarded to the relay, which will then transmit it to output components such as the Solenoid Door Lock, LED lights, and Buzzer.The Telegram and microcontroller are capable of processing commands and running programs according to the given commands.However, in the first and second input stages, if the ESP8266 microcontroller module receives unstable connections, it may cause delays in sending input signals and confirming output [8].

III. METHODS
The method applied in this research is Research and Development (R&D), which is a research technique focusing on the development and testing of specific items to ensure their adequacy level.Research and Development (R&D) is a process or series of steps involved in creating a new product or improving existing ones.Development research is a type of research that serves as a bridge between basic research and applied research, aiming to bridge the gap between the two [9].The Research and Development method consists of 6 stages: a. Problem Identification: The first step is to identify the problem or challenge that needs to be solved.This involves a deep understanding of the issue or situation that needs to be addressed.b.Literature Study Data Collection: After identifying the problem, the next step is to collect data and conduct a literature study to gain a better understanding of the context of the problem.This information helps in developing more targeted solutions.c.System Design: After having sufficient understanding, the third step involves designing the system or solution.This includes designing the structure or framework to solve the identified problem.d.System Testing: After designing, the next step is to test the system or solution that has been created.The goal is to ensure that the solution works well and can address the existing problem.e. Implementation: After successful testing, the designed solution or system is implemented or put into operation.This involves applying the solution in the real environment or implementing necessary changes.
f. Evaluation: The final step is to evaluate the results of the implementation.This evaluation helps in assessing how far the implemented solution can solve the problem and whether further improvements or refinements are needed.The research design can be seen in Fig. 1 Fig. 1 Research Design Internet of Things (IoT) is an advanced technology that fundamentally refers to a network of devices and systems worldwide connected through the internet and capable of sharing data simultaneously.This technology involves the use of sensors and software for communication, control, connectivity, and data exchange among interconnected devices via the internet, without requiring cables to assist in its functioning [10].
ESP8266 module is a microcontroller integrated with Wi-Fi connectivity capabilities.This module is equipped with a processor and memory that allows integration with various sensors and actuators through GPIO pins [11].
NodeMCU V3 is an electronic board built on the ESP8266 chip, equipped with microcontroller capabilities and Wi-Fi connectivity for internet access.This board has various I/O pins that support the development of Internet of Things (IoT) projects focusing on monitoring and control.NodeMCU V3 ESP8266 can be programmed using the Arduino compiler through the Arduino IDE.Physically, NodeMCU ESP8266 has a USB port (mini USB) that facilitates the programming process [12].
IR (Infra Red) sensor is a detection device that uses the reflection of infrared light to identify obstacles.When obstructed, the intensity of the reflected light can be adjusted via a potentiometer, resulting in a HIGH or LOW value.Its main components are the IR transmitter and receiver.[13].
Flame detector is a tool to prevent fires by identifying flames through the spectrum of infrared and ultraviolet light.The identification process uses optical methods, and the results are transmitted to the flame detector unit with a microprocessor.The microprocessor distinguishes the spectrum of light from flames with a delay system of 2-3 seconds, reducing the possibility of false alarms.This sensor uses an infrared (IR) transducer as its main detection element, detecting light absorption at specific wavelengths and distinguishing the light spectrum of flames from other sources.[14].
Micro servo is a rotary actuator designed with a closed-loop feedback control system (servo), allowing for adjustment and verification of the angle position of the motor's output shaft [16].
Telegram is a messaging application that operates based on the cloud, developed for use on smartphones and laptops with a focus on superior security and performance.The application is compatible with various mobile operating systems, including iPhone, Android, and Windows Phone.Additionally, Telegram can also be accessed on laptops running operating systems such as PC/Mac/Linux, macOS, and it is also available for use through web browsers [17].
Telegram Bot is a tool that can be programmed to execute various simple processes [18].This can be done through the dashboard provided by the system or by using a wrapper to create specific processes aa

IV. RESULTS
The purpose of creating a block diagram is to facilitate the realization process of the system to be built.Here is the block diagram of the automatic door control prototype system using Infrared Sensor (IR), MQ-2 Sensor, Flame Detector based on NodeMCU ESP8266, The working system can be seen in Fig. 2   The scheme shown in Fig. 3 is the design of the prototype device built using NodeMCU V3 ESP8266, where in the assembly of the device, an infrared sensor is used to detect people, an MQ-2 sensor is used to detect the presence of smoke, a flame detector is used for fire detection, a micro servo is used to move the door, LED as an indicator if fire or smoke is detected, and a buzzer as an alarm if fire or smoke is detected.It illustrates the connection of the GND (ground) pins from NodeMCU connected to the negative (-) line on the breadboard, while the 5 V power voltage is connected to the positive (+) line.All components are connected using jumper cables.The operating principle of the automatic door system and fire alarm includes three main inputs: information received from the IR sensor readings, flame detector, and MQ-2 sensor.If the data from the IR sensor readings indicate a high level, the microcontroller will instruct to open the door and close it after 3 seconds.On the otherhand, if the input value from the flame detector or MQ-2 sensor is high, the microcontroller will issue instructions to turn on the LED and buzzer, send a notification to Telegram, and open the door.The following are the testing steps to be conducted: a. Preparation of the automatic door prototype and fire alarm system.b. Preparation of a lighter as the source of fire and a gas source object.c.Measurement of the distance between the sensor and the object at a distance of 1 cm for the IR sensor and 5 cm for the flame detector and MQ-2 sensor.d.Testing the micro servo if it moves when the sensor reads.e. Observation of the activation or non-activation of the buzzer when the sensor is directed towards the fire or gas object.f.Repeating steps c to e with variations in the distance between the sensor and the object at 2 cm, 3 cm, 4 cm, and 5 cm for the IR sensor, and 10 cm, 20 cm, 30 cm, and 40 cm for the flame detector and MQ-2 sensor.

of the System Block Diagram
Fig. 4 and Fig. 5 shows that after the infrared sensor detects the presence of a person in front of the door, the door will automatically open and close after three seconds.

A. IR Sensor Testing
The IR sensor testing is conducted to determine whether the sensor can function properly and to identify the sensor's range limit for detecting objects in front of the door, as well as whether the micro servo can move after the sensor detects an object.The results of the IR sensor testing can be seen in Table 1 below.Based on the test results from the mentioned table, it is concluded that the IR sensor operates effectively, capable of detecting objects up to a maximum distance of 5cm.This is evidenced by the sensor's success in producing output signals that can be used to send signals to the NodeMCU ESP8266 and move the micro servo.

B. Flame Detector Testing
The testing was conducted on the flame detector sensor with the aim of assessing its performance, ensuring its optimal operation, and determining the maximum distance of the sensor in detecting fire.The results of the Flame Detector testing can be seen in Table 2 below.The results of the above test indicate that the flame detector can work well and detect fire up to a distance of 30cm but cannot detect fire at a distance of 40cm.This shows that with the presence of output signals from the flame detector, they can be used to provide signals to the NodeMCU ESP8266 and activate the buzzer, LED, move the micro servo, and send notifications to Telegram.

C. MQ-2 Sensor Testing
The test is conducted to verify the effectiveness of the MQ-2 sensor in detecting smoke.This is important to ensure that the sensor can provide accurate and reliable responses to the presence of smoke generated by a fire.This step is taken as part of the integration testing between the MQ-2 sensor, buzzer, LED, micro servo, and Telegram.Make sure that all components interact well and provide responses according to the desired conditions.The results of the MQ-2 sensor test can be seen in Table 3 below.
The test results of the MQ-2 sensor above indicate that the sensor can only detect smoke within a range of 20cm and cannot detect it within ranges of 30cm and 40cm.The output signal from the MQ-2 sensor can be used to send a signal to the NodeMCU ESP8266.Additionally, this signal can trigger the buzzer sound, turn on the LED, move the micro servo, and send notifications through the Telegram application.

V. DISCUSSION
The result of this research is a prototype automatic door device and alarm system that sends notifications via Telegram when there is fire or smoke detected inside the room, providing early detection of fire incidents.From the conducted tests, it can be concluded that the system operates effectively, as evident in Table 4 below.This research has successfully integrated IR sensor, flame detector, Telegram, and MQ-2 sensor with the automatic door prototype.The integration of the Telegram application as a notification medium has proven to be reliable in providing direct information to users.The speed and availability of this communication have a positive impact on responses to emergency situations.However, the flame detector, with testing conducted five times at each distance, was only able to detect fire up to a distance of 30cm to provide output signals for activating the micro servo and opening the door, LED, and buzzer for fire alarm, and Telegram for notification to the building owner.Meanwhile, the MQ-2 sensor, with testing conducted five times at each distance, was only able to detect smoke up to a distance of 20cm to provide output signals for activating the micro servo and opening the door, LED, and buzzer for fire alarm, and Telegram for notification to the building owner.It is hoped that further research can extend the detection range of the sensors even further.

VI. CONCLUSIONS
During the device development process, numerous limitations are inevitably encountered.Recommendations for further enhancement of this device's performance involve incorporating notification options or integrating with other platforms to expand the system's reach in providing alerts to users.Improving energy efficiency across all components, especially sensors and motors, can increase system durability and reduce environmental impact.Developing a more intuitive user interface can enhance system usability and make it easier for users to understand and operate the device.

Fig. 2
Fig. 2 System Block DiagramFlowchart is a visual scheme that depicts the stages and sequential operations in a program.Typically, flowcharts play a role in determining problem-solving strategies that need to be analyzed and evaluated more deeply.The flowchart can see in Fig.2

Fig. 5
Fig. 5 Prototype of Automatic Door and Fire Alarm System