Visitor Counter and Information Viewer at Photo Exhibitions using Embedded Systems and Web Services

- Photography is the art and production of images and light on a film or sensitized surface. It becomes a popular art as a hobby or for a living. Thus, many photography events are held such as photo exhibitions. The exhibition aims to show the work of art to the public or to promote the work so it can be profitable for the artist. One of the problems that arise from this photo exhibition is the need for the owner of the work or the event organizer to find out how many people have visited/seen a photo earnestly. This can be an indicator of public interest in the artwork. Counting manually is less effective to do considering the number of photos on display. Therefore, we need a tool that can be mass-produced at a relatively low cost to detect visitors to the photo site. The tool is based on a microcontroller (embedded system) which also uses the IoT concept. The tool is made using a NodeMCU microcontroller and PIR sensor. Based on the test results, the tool can count visitors with an accuracy rate of 82% and successfully displays information when visitors are detected and hides information when visitors leave the detection area.


INTRODUCTION
Photography is the art of producing images by using light on a film or a sensitized surface (Pebriany & Sanusi, 2020). This art can be done using a camera, with the lens as its main part. A camera lens mimics how the eyes work by trapping light reflected by an object. The captured light is used to burn a lightsensitive media chemically, to produce a shadow that is identical to the photo object. Along with the development of technology, the method of taking pictures is changed by using an image sensor (Irawan & Deli, 2021). Likewise, photography along with its techniques has also developed along with the development of the devices used to take pictures. Photography has become a popular art as a hobby or for a living (Arbi & Dewi, 2017). Thus, many photography events are held such as photo exhibitions. Photos on display can be in print or digital form. The exhibitions aim to show works of art to the public and get feedback such as opinions or interest from them. In addition to the photos on display, usually, it is also included with information about the photo. For example, the title, where the Paradigma, Vol. 24, No. 2, September 2022P-ISSN 1410-5063, E-ISSN: 2579 I Made Bhaskara Gautama, I Gusti Ngurah Wikranta Arsa, Ni Putu Virgi Savita 153 photo was taken, the photo model, and so on.
One of the problems that arise from this photo exhibition is the need for event organizers to find out how many people have visited/seen a photo earnestly. This can be an indicator of public interest in the artwork. Counting manually is less effective to do considering the number of photos on display. In addition, filling out visitor forms manually by visitors is also less effective because it depends on the awareness of visitors to fill out the form.
Based on these problems, it is necessary to make a device that can count the number of visits to a photo. Based on previous research, one of the techniques used to count the number of visitors is done using image processing, namely face detection (Inrawansyah, 2017;P et al., 2022). This method was successfully used to calculate the number of visitors to a building and visitors to the library. However, if this method is applied to calculate the number of visitors who view a photo, it will cost a lot because it requires a camera at each photo site and requires high computational capabilities to process images from many cameras. The next technique is to use embedded systems that utilize microcontrollers and sensors, such as Passive Infra-Red (PIR) sensors, ultrasonic sensors, or photodiode sensors (Adella et al., 2020;Almuttaqin & Nasir, 2021;Atika Sari et al., 2020;Fahmawaty et al., 2020). Some of these studies also use the IoT concept. This technique is more feasible to implement because the cost required to make a device in each photo is relatively cheap. Based on the results of previous studies, in this study, an embedded system that uses the IoT concept is created. In contrast to previous studies that used a combination of Arduino UNO and Raspberry Pi, this study uses NodeMCU because it already contains a Wi-Fi module so it can reduce the production costs. The sensor used is a PIR sensor. The difference from the previous research, the PIR sensor is placed in a special case to control the range of the sensor. This case is used to prevent the motion is counted as a visit even though visitors are just passing by in front of the photo site. In addition, the device can also display photo information automatically through the projector screen only if there are visitors who look at the photo earnestly. By using this device, it is expected to facilitate the needs of photo exhibition organizers at a relatively low cost for mass production. The device can also be used for other matters with the same purpose.

RESEARCH METHODOLOGY
This research consists of two main elements, which are a visitor detection device and a web server. The visitor detection and counter device are built by using a microcontroller that uses a PIR sensor. When a visitor is detected, the device will send data to the web server. On the web server, visitor data will increase by one each time the device sends data. The computer that is connected to a projector is used to display photo information when a visitor is detected. The projector device must be connected to a client computer that is connected to the web server and has already opened the web page to display the photo information. The conceptual model of this research is shown in Figure 1.   Source: (Gautama et al., 2022) A. Requirements Analysis At this phase, requirements analysis is carried out from the collected data. The analysis includes how the tool works, hardware and software requirements so that problems can be solved.

B. Device Design
At this phase, the device designs are made. The design of the device is described using a block diagram to show the relationship between the components that are used by the device. C. Implementation Implementation is done by assembling the Testing is done by examining the functionality of the device and whether it can detect visitors as expected and successfully send data to the web server.

Web Service Development
The website is built using the Agile method because the time to develop the website is limited. Figure 4 shows the Agile method using the Scrum model. Design, implementation, testing, deploying, and reviewing are done repeatedly to complete feature by feature. This iteration is called a Sprint. The website is used to receive sensor data from the device, save it into a database, and display photo information through the projector. The system can also be accessed to find out the number of visits to a photo site.

Device and Web Testing
This stage was carried out by comparing the actual number of visitors with the number of visitors based on data on the web server. The actual number of visitors is collected using the manual method through a form filled out by visitors.

Evaluation
Based on the results of the testing, an evaluation was carried out to determine the advantages and disadvantages of the device and web service, as well as suggestions for further research.  Figure 5 shows a block diagram and the model of the device. The PIR sensor is connected to the NodeMCU which is powered using a USB cable. The PIR sensor has three nodes, namely ground, output, and power input. The black wire is the ground that is connected to the GND pin on the NodeMCU. The yellow wire is the input connected to pin D1 on the NodeMCU. The red wire is the power input connected to pin 3V3 on the NodeMCU. b. Device Algorithm Figure 6 shows the flowchart of the algorithm that is used in the embedded system. The input from the sensor will be read every second. The potentiometer on the sensor is set as shown in Figure 7. Using these settings, the sensor detects motion in real-time. If the sensor starts to detect motion, there is a 10-second delay to see if the movement just passes or stays in place. If it's just a pass, the tool will not count the move as a visit. However, if the movement lasts for 10 seconds, then the movement is considered a visit. To detect visitors leaving the location, a 10-second delay is also used. If for 10 seconds there is no movement at all, then the visitor is considered to have left the location. Source: (Gautama et al., 2022) C. Implementation At this stage, device components are assembled based on the designs that have been made, and the code is developed based on the flowchart. Figure 8 shows the assembled device that being placed in the case. shows a piece of codes that are embedded into the microcontroller. Arduino IDE is used to write, compile, debug, and embed the codes into the microprocessor. The codes are written in C programming language. The embedded system also utilizes the built-in LED from the microcontroller which is used as an indicator of the presence or absence of detected visitors. Based on the tests carried out, the device has been able to detect visitors who are in the detection area for more than 10 seconds. However, if there is more than one visitor in the detection area with an interval of fewer than 10 seconds, only one visitor is counted.

Web Service Development
In accordance with the Scrum model, the following steps are carried out in this stage: -Backlog Breaking down the main work into small parts consisting of features/modules of the web service. The features are arranged based on a priority scale. -Sprints Implement features in accordance with the backlog that has been prepared. One sprint can be done by completing more than one feature according to the weight score of the feature.

-Review
Evaluate the features that have been completed for further testing. If something goes wrong at this stage, those features can be returned to the backlog to re-sprint.
A. Backlog Table 1 below shows the backlogs of the web service that was built. There are a total of four features developed. Each feature has a priority to work on. Estimation columns are filled with how many sprints it is required to complete the tasks. One sprint is done in 7 days or one week.
Tabel 1. Backlogs of the developed system.

ID Story
Estimation Priority 1 The system can store event logs consisting of the date and time when the visitor entered the area and when the visitor left the area. The system also stores event data that is currently active.
0.5 1 2 The system can process the data sent by the device. The data has a boolean type, namely 1 when a visitor enters the area and 0 when a visitor leaves the area.  Figure 10 below is a schema diagram that shows the structure of the table: Figure 10. Structure of logs table. Source: (Gautama et al., 2022) 2. Sprint ID #2 This sprint is completed by creating a single PHP file that implemented the algorithm shown in Figure 11. Testing is done by activating the device so that data is sent to the web server when the event is triggered. The data sent by the device is successfully processed by the web server with an indicator that the data is successfully stored in the database according to the event that occurred. Figure 11. Device data handling algorithm. Source: (Gautama et al., 2022) 3. Sprint ID #3 This sprint is completed by creating a PHP file that displays the data stored in the logs table. Figure 12 shows the mockup of the web page.   Figure 13 shows the results of the implementation. Based on the tests, this feature has functioned as needed. Figure 13. Logs page. Source: (Gautama et al., 2022)

Sprint ID #4
This sprint is completed by creating 2 PHP files. The first file is a web page that is accessed/displayed by a computer device connected to the projector. The page sends requests using AJAX periodically to the second page, to check for events that occur. The second page contains a script to check for event updates, for example, whether there are visitors who enter the area or visitors who leave the area which can be known based on real-time data in the logs table. Event data that is queried from the second page, is returned (response) in JSON format to the first page. On the first page, if no visitors have been detected yet, the web page displays only black color. If a visitor is detected, the display is created based on the mockup shown in Figure 14.  C. Review Based on the suitability test between the needs/stories and the implementation, all the developed features are working functionally so that no part is returned to the backlog and no new features need to be added to the backlog.

Device and Web Testing
Testing has not been carried out at the photo exhibition location yet, this is because photo exhibitions are still rarely found related to the COVID-19 pandemic situation, so community activities are limited. The trial was conducted at the STIKOM Bali library using two computers. The first computer was used for library members to record their visits to the library by filling out the form manually. The device was planted in this computer area. The second computer is used to display the information page, to find out whether the information appears when a visitor is detected. If there is a visitor who uses a computer to record his visit, the visitor spends some time so that the device also detects the visit. These two data are compared to test the level of accuracy of the device. The test was carried out for one day, on August 4, 2022. Table 2 shows the visit data recorded manually on the library system. Tabel 2. Visitor data that collected using the form. Table 3 shows the data stored in the logs table in the database. The data displayed is data recorded on August 4, 2022.
Tabel 3. Data collected by the device.

Evaluation
Based on the experiments, out of 33 visitors, only 27 were detected by the device (82% accuracy). The second computer successfully displays information when a visitor is detected and hides information when a visitor leaves the detection area. In addition, the device experienced one failure to update an event so the recorded data was NULL. Below are the discussions of the visits that were not successfully recorded by the device. The device cannot count more than one visitor who comes together or come alternately in a period of less than or equal to 10 seconds. If this happens, only one visitor has been detected. This is proven by the piece of data in Table 2 which is shown in Table 4  Source: (Gautama et al., 2022) In Table 4, the data in the second and third rows were recorded manually at almost the same time (interval of 20 seconds). When the first visitor leaves the detection area, there is a 10-second delay for the sensor to read the movement update. If within 10 seconds there is no movement at all, then the visitor is confirmed to have left the detection area. In this case, when the first visitor leaves the detection area, before 10 seconds, the second visitor enters the detection area. Thus, the device reads that the movement of the second visitor came from the first visitor who had been silent for some time less than 10 seconds. Table 5 shows two visitors recorded as one visitor, marked with a yellow row.

CONCLUSION
Based on this research, a device that is built using the IoT concept has been produced. The device can be Paradigma, Vol. 24, No. 2, September 2022P-ISSN 1410-5063, E-ISSN: 2579 I Made Bhaskara Gautama, I Gusti Ngurah Wikranta Arsa, Ni Putu Virgi Savita 159 used to detect visitors and display information at photography exhibitions or similar cases. The device is made using the NodeMCU as the main board and the PIR sensor is used to detect visitor movements. With modifications in sensor cases, sensor placement techniques, and detection algorithms, the device is able to detect visitors with an accuracy of 82%, send data to a web server, and display information only when visitors enter the detection area. The device is relatively inexpensive compared to previous studies, so it can be used if needed in large quantities but with a low budget. However, this tool has the disadvantage of not being able to count visitors correctly if more than one visitor comes at the same time or come alternately in less than 10 seconds.