Design And Build A Room Security System Based On Internet Of Things (IOT)

Workspace or home security systems required special attention, especially in the issue of locks for room security that must be unique, not easily opened by unauthorized people to enter the room. In this research, indoor security systems applied Internet of things (IoT), the use of MQTT Broker which functions as a getway for data transactions between publishers and subscribers, power supply and ESP8266. The method to building the smart doorlock was use prototype method, designed  the system and design diagrams, used UML (Unified Manipulation Language), the analysing problem used the PIECES method. The use of the MQTT broker functions as a gateway to connect publishers, subscribers, power supplies and the ESP8266 wifi module which functions as a gateway between devices to the mobile. The result of this researched was prototype the smart door lock system using IoT.


INTRODUCTION
Safety is an important thing in everyday life. Security provides comfort and serenity for everyone so that they can carry out their daily routine properly. Security can be started from home or office security. Door locks play an important role in home and office security systems. A poor security system has made the place a target for theft or other similar crimes. Therefore, security is needed and is absolute.
Currently, most of the security systems on house keys are manual security systems in the form of a conventional padlock or key [1].Technology has developed rapidly, many tools are created to facilitate human work and even replace human work. PIN or Personal Identification Number is an easy and affordable security system compared to biometrics. However, seniors or parents have difficulty remembering the PIN. RFID or Radio Frequency Identification was a technology that utilizes radio waves as a medium to identify a unique object, both living and inanimate objects [2]. From the various problems above, an automatic security key is needed to replace the conventional key. This automatic security lock is a QR Code or Quick Response Code lock and is a better solution.

I. METHODS
The method of collecting research data using aobservation, is a systematic investigation by collecting information related to an object of study, where direct observations are made on the object of research for office spaces that use conventional security locks, how to change the door entry access from a conventional lock to an automatic security lock, and the proposed system does not yet exist.
The analysis method is used to analyze the smart door loock system, in order to identify the cause of the problem using the PIECES method (Performance, Information, Economic, Control, Efficiency, Service) [4].With PIECES analysis, several causes of the problem can be obtained which can be concluded clearly and more specifically on the point of the problem so that it helps in making a Smart Door Lock system.

II. RESULT AND DISCUSSION
In building this system, the following needs to be prepared, namely: a. Functional Requirements The Scan Qr Code system prototype and automatic security keys based on internet of things (IoT) have several functional requirements, these functional requirements contain the requirements of what processes can be carried out by the Scan Qr Code system prototype and automatic security keys based on internet of things ( IoT). Among them are being able to perform Qr Code Scanning to open or lock doors and the system can lock or open doors anytime and anywhere. b. Non-Functional Requirements The prototype of the QR Code Scan System and the automatic security key based on the internet of things (IoT) has several non-functional requirements. This non-functional requirement includes the minimum specifications that the system software and hardware must have. Non-functional requirements include 5V and 12 V power supply, MQTT Broker, Solenoid, ESP8266 Wifi Module, 5V Relay, Datab Scheme of Smart Door Lock based on Internet of Things (IoT)

Fig 1. IoT Smart door lock system
In Figure 1., it consists of a Mobile (Smartphone) as a user device in which an automatic security key application is available for scanning Qr Code, MQTT Broker as a place for data to be sent and shared between client to client and callback recipient, ESP8266 as a medium of contact and data entry and exit, Relay as a component to connect and cut off the electric current (Switch) in the Smart Door Lock tool, Power supply as a power provider of 12 V. And Solenoid as a door lock / opener. Using 1 Esp8266 Wifi Module which functions as a gateway / connection between devices to the database,in this circuit the GPIO0 Esp pin is connected to the Relay pin. c. Power Supply Using 1 power supply that functions as a power provider of 12 V which is connected to the Relay pin. d. Solenoid Using 1 Solenoid which functions as an opening and locking the door connected to the relay pin and power supply.
How the Smart Door Lock Tool Works  Figure 3. Smart Door Lock Worksstarting with initialization, then MQTT broker will send and share data between client to client via ESP6288. This process will identify the QR Code, if the QR Code matches the one stored in the database, the Solenoid door lock will unlock for 30 seconds then it will automatically lock again. If the QR Code is wrong then the door remains closed. Design UML (Unified Modeling Language) is a "tool / language" that has become the industry standard for visualizing, designing and documenting software systems. UML offers a standard  ) is a "too. In the login activity, the system will display a login form, then if the user has entered the Email and In the login activity, the system will display a login form, then if the user has entered the Email and Password, the database will check whether the user data is correct or incorrect. If appropriate, the user will be directed to scan the Qr Code on the Smart Door Lock application, if it is wrong the system will direct to check and re-input the login data according to the data in the database Registration functions as the process of registering a user on the application in order to enter and access the application.

Login
Login functions as the process of accessing the application to enter and access the application, all usecases have dependencies (include) with login. Because all usecases won't work otherwise

Fig 6. Activity Diagram of Register
In the registration activity, the system will display a login form, then the user will press the button Register to be redirected to the registration page by the system. User will fill in the data for account creation then the system will verify and save the data. The user will be redirected back to the login page to enter the Smart door Lock application.

Application Class Diagram
Class diagram that describes the relationship. The tbl_user class existsattribute id_user, name, email, username, password, and has a method StarLogin (). Then the log_Activity class has attributes id_activity, id_user, time_login, and has a show method().

Fig 9. Splash Screen Display Smart Door Lock Prototype Testing
Tests are carried out to determine the results of the systems and tools that have been made and analyzed to test the feasibility of the system being made.
Testing Data Sending from Android to MySQL Database This test is to see whether the data inputted via Android has entered the database. Testing is done by doing a scanner on the Qr Code which gives the command to open the door via Android and the MySQL database can be seen the changes that have occurred and the time required. The following tests are listed in Table 2: It can be seen in experiment 6 that the time on Android to scan the Qr Code shows 18.41.04 and the time when the database receives data shows 1. 18.41.04. This shows that the data transmission time is less than 1 second on the Smart Door Lock Application Testing

Fig 10. Equipment testing
Testing the Smart Door Lock Equipment Tool testing is done by testing the response of the tool and seeing the output of the tool. The following tool testing is shown in Figure 10 to open the door for taking and using the stopwatch, the time data taken starts

IV. CONCLUSION
From the research results, it can be concluded as follows:from several tests of smart door lock applications that have been done. The lock and unlock function on the prototype smart door lock worked well, this can be seen. In the table Table3 Test Data of the Smart Door Lock Equipment Users do not need to worry about the difficulty of running the system because it has been designed to be easily used by all users.