Web-Based Scheduling Application and Motion Sensor Using Arduino Mega

− Waste will appear in a building including lights, air conditioners or fans that no one is using. One reason for this is due to a lack of discipline culture. Culture turns off electrical appliances when they are not used that are less. Use of PHP language and MySQL database. Motion sensors that use infrared passively or better known as PIR (Passive Infra Red) can be used for security. The microcontroller itself is a chip or IC (Integrated circuit) that can be programmed using a computer. The purpose of this research is to find out how to make a web application that can control electronic equipment in buildings, to find out how to make a motion sensor circuit with Arduino Mega so that electronic devices can be active. or off, to find out which is more efficient between using web applications and motion sensors in buildings. The results of this research are that in making a web walker application that can control electronic equipment in buildings requires: web server (hosting), internet connection, ethernet shield, arduino mega, module relay and the use of motion sensors with Arduino Mega, the sensitivity level and time delay can be adjusted. giving a signal when there is movement of a human object.


INTRODUCTION
The development of technology today is very helpful for humans, one of which is helping to control the use of electric power at the Nadhatul Ulama University, West Sumatra, where buildings that have lots of space will cause many problems. One of them is related to the efficiency of the power usage monitoring system. This waste is caused by lights, air conditioners, or fans that don't have any users. This problem occurs when someone is not disciplined to turn off the lights when they are not needed. Real examples are lights, air conditioners, and fans in university buildings where the process of turning them on and off is manually controlled by someone. Employees sometimes forget to turn it off when the room is not used for teaching and learning. Forgetting to turn will also be a problem. Lecturers who are already on the fourth floor have to come down to make sure the controllers turn on the lights. This will affect the harmonious relationship between lecturers and campus employees..
The web application can be a solution to the above problems. Besides being able to run on the network the installation process is also easy. The use of language PHP and MySQL database can be utilized. Where the benefits can run on various operating systems if it has been placed on the server and can be accessed anywhere as long as having a network connection. Human error will be minimized. Wasteful use of electric power will also be suppressed. Motion sensors that use passive infrared better known as PIR (Passive Infra-Red) can be used for security. This tool will detect infrared waves generated by living creatures within its range and will issue an output that can be utilized. In this research will be investigated how the coverage detection sensor, living creatures, and anything that can be detected by these sensors. This plan will be implemented by researchers in the classroom. It can also be installed in the workspace at the company. This sensor will detect the presence or absence of people. If there is someone then the light will stay alive. However, if no light will die.
Arduino is an electronic device or an electronic circuit board open-source in which there are main components of a chip microcontroller with the type of firm Atmel AVR. The microcontroller itself is a chip or IC (integrated circuit) that can be programmed using a computer. The purpose of embedding the program in the microcontroller is that electronic circuits can read input, process the input, and then generate the desired output. So microcontroller serves as the brain that controls the input, process, and output of an electronic circuit. (Christopher, 2015). A. Web-Based Applications Client-server is a paradigm in information technology that refers to a way to distribute applications into two sides: the client and the server. In the client/server model, an application is divided into two separate parts, but it still a unity there are client component and a server component. The client component is also often referred to as the frontend, while the server component is referred to as the backend. The client component and application is running in a workstation and receive input data and users [1]. The client component will prepare the data entered by the user by using specific processing technology and send it to the server components that run on the server machine. Generally in the form of a request to several services that are owned by the server. The server component will accept the request and the client as well as the direct and reversed the results of such processing to the client. Clients also receive information on the results of the data process performed by the server and display it to the user to use applications that interact with the user [2]. An example of s simple client/server applications is web designed by using Active Server Pages (ASP), or PHP.PHP or ASP scripts will be executed on the webserver (Apache or Internet Information Services), while the scripts that run on the client-side will be executed by the web browser on the client computer. Client-server resolves the issue on which the software uses the database so that each computer does not need to be installed database. The method of the client database server can be installed on a computer as a server and the application is installed on the client [3]. If it is explained briefly it can be argued that the server (Apache Web server) task is to serve a client request. Client (e.g. Firefox browser) the duty is to ask service on the server. An explanation of the relationship of client/server is mainly in the process that occurs in an HTML-based website, PHP, and MySQL, which are further explained with pictures and explanations as follows [4].

B. Motion sensor
Infrared is electromagnetic radiation of a wavelength longer than visible light, but shorter than radio wave radiation. It means below (infra = under, in Latin) red, red is the color of visible light with the longest wavelengths. Infrared radiation has a range of three orders and has a wavelength between 700 nm and 1 mm. Sensors PIR Passive Infrared often called Pyroelectric or IR motion sensors [5]. PIR sensor can detect motion, especially coming from the man while in range (range) sensor. This sensor has advantages such as its shape is small, inexpensive, low power consumption, easy to use, and durable. For this reason, these sensors are widely used in applications in the home and for business purposes [6]. PIR (Passive Infra-Red) can be used for security. This tool will detect infrared waves generated by living creatures within its range and will issue an output that can be utilized. In this research will be investigated how the coverage detection sensors and living beings or anything that can be detected by these sensors [7]. PIR (Passive Infrared Receiver) is an electronic component in the form of an infrared-based sensor. PIR sensor is not like the IR sensor that has an IR LED and phototransistor. PLR, unlike IR LEDs that emit anything. PIR sensor only responds to energy and passive IR rays possessed by each object detected by it. Objects that can be detected by these sensors typically are living beings, like humans, cats, dogs, and something that has large enough volume. In the PIR sensor, some parts have their respective functions, namely Fresnel lens, IR Filter, Pyroelectric sensor, Amplifier, and Comparator [8]. The PIR sensor works by capturing the heat energy generated from the passive infrared light beam which every object is above zero temperature. For example, the human body has a body temperature of around 36 ° C. The radiation of infrared light is captured by a pyroelectric sensor which is the core of this PIR sensor. Infrared cause Pyroelectric sensor consisting of gallium nitride, cesium nitrate, and lithium tantalate generate electric current. Infra-red can generate electric current causes bring heat energy. The process is almost the same as the electric current formed when sunlight on the solar cell. Distance range PIR sensor itself can be regulated according to needs. The maximum distance is approximately ± 10 meters and a minimum of ± 30 cm [9].

C. Arduino Mega
Arduino is an electronic device or an electronic circuit board that has open-source key components such as a chip microcontroller with the type of AVR from Atmel firm. The microcontroller itself is a chip or IC (integrated circuit) that can be programmed using a computer. The purpose of embedding the program in the microcontroller is that electronic circuits can read input, process the input, and produce output as desired. So microcontroller serves as the brain that controls the input, process, and output of an electronic circuit [10]. One type of Arduino is the Arduino Mega 2560. Arduino Mega 2560 is a microcontroller-Atmega based 2560 with 16 MHz Clock Speed and flash Memory 256KB. Can run on power 7-12V. Have 54 pins digital input/output pin 22-53 and added to the PWM pin, 14 pins PWM on pins 0-13, 16 pin analog inputs on pins A0-A15, USB connection, an auxiliary power supply connection, and the reset button [11].

II. RESEARCH METHODOLOGY . A. Design And Implementation
Here is a drawing block diagram generally try to combine web-based applications, motion sensor and Arduino mega as well as the device to be in control.

30
The working principle of the image above as follows: the microcontroller will get input from a light scheduling application web-based and motion sensors. A light scheduling application web-based will contain a view which is used to turn on or turn off an electronic device with a predefined schedule. This application can be used to control remotely, as long as there is an internet connection The motion sensor or Passive Infra-Red (PIR) was placed in a room that will be created automatically. If anyone entered the room, the lights, air conditioning or fan will on. Meanwhile, if the person left the room, the lights, air conditioning, or fan would off. In brief, this sensor will be a trigger or being input to Arduino Mega.
Arduino Mega is needed because of the number of input and output, or I/O more. Another Arduino has fewer I/O. This microcontroller will act as the brains of the system. It will accept input from a web-based scheduling application and input from motion sensors or Passive Infra-Red (PIR).
The output of the Arduino Mega is an out signal that would drive the relay. This relay will drive the contactor for lights, air conditioning, or fan. Not only the lights, air conditioning, or fan but another electronic device can also be controlled. As motorcycle safety in machinery production, heater scheduling or heater, turn on the TV, radio, DVD player, or other electronic devices. Use case researchers use to communicate at a high level what the system needs to do, and each of the UML diagram techniques for building a program presents functions in different ways, each view has a different purpose. The following is the use case of the system that will be made in theory.

Figure 4. Use case Application web
ERD is useful for modeling systems that will later develop the database. This model also helps system researchers when conducting database analysis and design because this model can show the kinds of data needed and the correlation between the data therein.

Figure 5. ERD
This file design is used as a basis for creating a database. We use a mysql database called "iot". Here are the details of the file design that will be applied.  Time  3  Mati1  Time  4  Hidup2  Time  5  Mati2  Time  6 Ket Varchar 20

B. Microcontroller circuit to Electronic Devices
Here is an overview of its electronic devices. To make this circuit it requires some electronic components such as the Arduino Mega Shield Ethernet, 8-channel Relay Module, PIR Sensor, Adaptor 5-12Volt DC, jumper cables, and boxes and terminal.
Ethernet shield will be used by researchers to receive data from the hosting server that contains 0 (zero) and 1 (one) as the trigger input to the Arduino Mega. There is a LAN port that will get DHCP IP by way of the access point. The access point used by the researchers is TP-Link MR-3220. The access point is connected with an internet connection using a USB modem of 3/tree operator. The amount of data received zero or one based on MySQL database queries contained in server hosting. Where storage scheduling can be set according to the needs of the building owner. Arduino Mega receives digital signals coming from the Ethernet Shield. This signal is used as an input signal following space or electronic devices. There are fifty-three inputs and outputs on this mega Arduino. So that the amount can be maximized. While analog input with a capacity used only seven pieces. Due to the limitations of the material, the researchers only use output number 41 to number 48. This output Terminat will issue a voltage of about five volts if it gets command 1 (one). The digital voltage will be used to trigger a relay module with eight channels.
Arduino mega needs a power supply of only five to twelve volt DC (direct current). So researchers simply use the adapter from 220 VAC to 9 Volt DC. The relay module used by researchers is 8 units in each module. Relay obtains input from Arduino mega. The relay itself is used as a switch if it gets a signal.
The relay that researchers spend is Active Low, which means that when it gets a signal from Arduino mega relay will off. And conversely, if it does not get a signal from Arduino mega relay will active. Researchers have to change the coding program, reverse output results. Zero means on and one means off.

III. RESULTS AND DISCUSSION
D. Testing of Scheduling Application Web-Based Testing is done by way of running web applications and try with various scenarios of load control (lighting, air conditioning, etc.). The first scenario by connecting a local network with a hub device or Switch dengan perangkat Hub atau Swicth.  True  4  Handphone IOS  True  5 Tablet Samsung True Second, by using the Access Point. The next scenario uses the internet. Applications deployed in hosting that has been made by researchers at the domain http://gedung.pintar.id.This address can be accessed by any device as long as there is an internet connection. Researchers have applied it on PC, laptops, and mobile devices such as mobile phones and tablets. All run well.

E. Motion Sensor Testing
The sensor used by the researchers is a motion sensor or Passive Infrared (PIR). Testing was conducted to determine how sensitive sensors detect people coming into the room. To be set when the lights will be off or when the light will on. Researchers encountered some problems such as the sensitivity of the sensor and the duration of the sensor's signal to the microcontroller. The problem that appears when it is tested is about the distance between the PIR sensors with the arrival of the object in this case humans. After being tested by the researcher's farthest sensitivity within 6.5 meters to 7.5 meters. It is set on a variable resistor using a screwdriver. If space is greater, it can be used for more than two sensors. Researchers also should pay attention to the angle of its sensitivity. At the moment, the test sensitivity of angle reaches 105 degrees.
The second problem is about the length of time the sensor provides a signal to the Arduino mega. Having tested, there is a setting to adjust the delay time for the first time that needs the objects to move continuously. If it stops moving, the lights will die instantly. by setting the potential meter the delay time can be more than eight minutes. With this, an object or a human does not need to move continuously for powering electronic devices such as lights, tv, and others.

IV. CONCLUSION
The conclusion of this study is to know how to make a web application that can control electronic equipment in buildings, to find out how to make a motion sensor circuit with Arduino Mega so that electronic devices can be active or off, to find out which one is more efficient between the use of web applications and motion sensors in buildings. . The results of this research are that in making a web walker application that can control electronic equipment in buildings requires: web server (hosting), internet connection, ethernet shield, arduino mega, module relay and the use of motion sensors with Arduino Mega, the sensitivity level and time delay can be adjusted. Giving a signal when there is movement of a human object.