Geolocation visitor to the Polinema library using QR Code and OTP code on internet of things based smart locker

— The library is one of the rooms or facilities used as a learning center. Data on library visitors with a locker at the Polinema library is in a different place, where the Polinema library locker are outside the library area which can be misused for storage of public goods. Visitors only enter the library area to ask for locker keys and leave items in the lockers, but visitors do not visit the library. To overcome this, a system was designed using a QR Code scan that can be used as a library visitor data system that can directly open the locker door using an OTP code, after getting the OTP code visitors can enter items and then lock them automatically. Application login testing can be done according to the system. Testing of open/closed locker markers and admins can access the locker if someone leaves the Library area. The coordinates of the GPS points for 4 visitors who came out of the Library area with a distance of 25,049m, 38,839m, 56,502m, and 64,904m were proven with a maximum distance of 20m. Comparison of the distance between Formula Haversine and Google Maps (distance between 2 points) obtained an accuracy rate of 0.236%.


I. INTRODUCTION
Currently, the development of technology in the field of electronics and communication is running so rapidly. Along with the increasing needs of society, technology plays a very important role in helping to facilitate human work, so a robot control system was created that can be controlled using a smartphones. The library is one of the rooms or facilities used as a forum for learning centers, study centers and information dissemination centers poured into books, magazines, literature and comics [1].
Data on library visitors with a locker at the Polinema library is in a different place, where the Polinema library locker is outside the library area so that it can be misused for storage of public goods where visitors only enter the library area to ask for a locker locker and leave items in the locker but visitors or students do not visit the library making the locker box not used as appropriate for library visitors only [2] [3].
Therefore, based on the problems above, in this study the author will design a study with the title "Geolocation of Visitors to the Polinema Library using QR Codes and OTP Codes on Internet of Things (IoT)-Based Smart Lockers." This system will create a tool using a QR Code scan that can be used as a library data system that can directly open the locker door using an OTP (One Time Password) code, after getting the OTP code visitors can enter locked items automatically.
Visitors are given a warning in the form of a pop up dialog box in the Android application while in the library to prevent visitors from leaving the library area. In addition, from the admin side, can monitor the location of library visitors with Google Maps. Visitors who leave the library area appear in the form of a dialog box and receive action in the form of a visitor's locker cannot be reopened before confirmation with the admin, the visitor is declared a violation and gets a fine.

A. System Block Diagram
Systematically, the workings of the tools that the system runs are made in the form of a block diagram shown in Fig. 1. In Fig. 1 the block diagram of the system will explain the work process of the system carried out during the study, the description of Figure 1 is as follows: When the visitor / client is a student who visits the Polinema library using his cellphone that is already connected to the internet network, then download the Polinema Library application. After downloading the Polinema Library application, visitors must register as the identity of the Polinema Student's personal data. At the time of this Register, the microcontroller and Android API have been created by entering the "user" and "password" where the MySQL database is stored in the ESP32 microcontroller. Scan the QRCode as a request locker number specified by the system [4].
The locker number that has been obtained from the system is used as a request for an OTP (One Time Password) Code with 2 codes (Enter / Exit). Login (In) = OTP for visitor access if they will enter goods after the end of the Login, and can open / close the locker more than 1x as long as the visitor is still in the Library area. Exit (Out) = OTP for access to visitors who will exit the Library area as well as Logout.
Login (in) = OTP for visitor access if you want to enter goods after visitors login and can open / close locker more than 1 time as long as visitors are still in the library area.
Exit (out) = OTP for access for visitors who will leave the Library area as well as logout.
Every visitor who is detected out of the library area, the system will reset the new OTP code. The OTP code is 4 digits [5]. When the visitor is in the library the system continues to run. On the admin side, Google Maps is used to point to the visitor area, only the admin can monitor the location of Library visitors.  indicator with green and red LED colors. 5) ESP32: control center between android application and smart locker. 6) Stepdown: to lower the power supply. is an electrical design that will be implemented. is an electrical design that will be implemented at the Malang State Polytechnic Library using a hardware system designed and integrated with the Android application. The parts of this circuit are divided into several parts including the power system or power, sensors or inputs, actuators or outputs. Proximity sensor is used as input which aims to detect the presence of objects / items that are in the locker. If the object / item detected is in the locker, the indicator on the proximity sensor will light up. At the output it uses Selenoid Door Lock as an automatic locker, Relay as on / off other components on the locker. The Fig. 6 shows the contents of the access box which is an implementation of Fig. 7. The circuit is an overall where ESP32 is connected to proximity, relay, stepdown, LED and buzzer.

2) Hardware Implementation Result
Microcontroller ESP32 which functions as the main component in the hardware to process input and output data coupled with Wi-Fi communication that is already available in it that can be connected to the internet network.
The relay serves as an on/off switch. In this system the relay is used on the opening or closing of automatic doors [8].
Proximity sensor is used as an input that aims to detect the presence of objects / objects that are inside the locker.
Stepdown here is used to lower the power supply on the 12V Power Supply to 5V. This is a discussion of the implementation of the Android Application software that has been made according to the plan. This is one of the Android applications of the Malang State Polytechnic Library that can be accessed by visitors. In this screen, if you have got the locker number specified by the system, then you will get the incoming and outgoing OTP code [9]. If the OTP code input is 7789, then there is a status of "Locker 1 open" then the locker can be opened. Vice versa, if you enter the outgoing OTP code, which is 4906, the status changes to "Locker 1 closed" as well as Logout. The monitoring web page is in the form of a Student identity by filling in the Name, NIM, Address, Email, Student Study Program and Cellphone Number connected to Siakad in Fig. 9. The monitoring web page is in the form of a Student identity by filling in the Name, NIM, Address, Email, Student Study Program and Cellphone Number connected to Siakad in Fig. 9. Figure 10. Geolocation Web Implementation

Proximity sensor
The sharing webpage on the geolocation site can read anyone who registers on the Malang State Polytechnic Library app. At this time, there are visitors coming out of the library area. In the image, there is a id_geo is the locker number, id_mhs is the OTP code, as well as longitude and latitude. From testing the Student Location Data page that exits the Library area, admins can read the location points of Library visitors on Google Maps. In the picture, there are 4 points that detect the location and there are Longitude and Latitude Visitors coming out of the Library area. From the admin side, the admin immediately performs the "Close Locker" action on the Locker Control page which means that the locker cannot be opened when the visitor returns to the library, therefore the Visitor committed a violation [10].

B. Haversine Formula and Distance Calculation
The results of the distance test are carried out to find out how far from the point between the library and visitors (meters), by entering the longitude and latitude values at each point using a predetermined distance formula. To prove the result of the distance, it is proved in the following formula [11].
The following is the result of a comparison between the calculation of the distance of the Haversine Formula which has been completed into two numbers behind the comma with the distance of Google Maps Distance (the distance between two points), the calculation is carried out from two user locations and the system displays the six closest tourism objects [12]. The following is the calculation formula and the tests carried out: Percentage Accuracy = 100% -100  The table above is the result of the Longitude and Latitude of the Library Location as well as visitors 1 to 4 visitors, each distance is proven based on the Formula Haversine Formula and also on Google Maps readings in order to get accurate results.
Based on the average percentage of distance calculation accuracy using Formula Haversine with Google Maps Distance calculation (distance between two points) obtained an accuracy result of 0.236%.
The percentage of distance between the two comparisons is very small, it is evident that between the distance of Formula Haversine and Google Maps is the same, only slightly different due to the accuracy that has been done at the beginning of searching for location points on Google Maps [13] [15].

IV. CONCLUSION
From the background, problem formulation, planning, and implementation as well as discussion, it can be concluded that: The results of testing the suitability of the OTP code, the implementation of the OTP code as an unlock locker can run well because the OTP code on the software and hardware is well synchronized. From the test results of the QR Code Scan, the implementation of the QR Code as a request locker number can run well.
Web Monitoring Admin can control the 4 available lockers and can run properly, if visitors exit the Library area only the admin can access. Admins who can monitor library visitor points through Google Maps are on the web Student Location Data page, the location points of library visitors in real time on Google Maps.
The Formula Haversine method is applied to measuring distances for visitors leaving the Library area on Google Maps. Based on the comparative analysis of the distance between Formula Haversine and Google Maps (the distance between 2 points) an accuracy rate of 0.236% was obtained.
In the research conducted, it is necessary to develop an android application, namely the addition of a fine feature for library visitors who leave the library area. Create new mechanics and designs as well as forms of innovation.