Raspberry-Based Control System for the Future House

: According to aired TV announcements, any accidents are caused by the improper installation of electrical and control devices. Therefore, a person highly skilled with a certificate of expertise specifically in installing electrical and control systems is needed to carry out the installation to avoid the danger of short circuits. Therefore, this research aims to develop software capable of controlling all electrical devices of a house based on a raspberry-based control system with the tools executed by a smartphone to ensure adequate securities. The results showed that the raspberry-based electrical control system functions properly, both on the security system (MCB) and various controlled loads. This was further determined by carrying out research trials using smartphones and a manual switch button on the boarding house, which also showed that the application and interface of the raspberry-based electrical control system function properly, as evidenced by the results of the full system trial, using local IP, internet networks, and smartphones.


INTRODUCTION
The inappropriate installation of electrical control devices causes a lot of harm to houses and their owners. This is in addition to the widespread assumption that electrical installations and control devices need to be checked, maintained, and repaired. However, the disruptions that frequently occur in electrical installations tend to shorten the device's lifespan, making it prone to malfunction and fire outbreaks. For example, a house/building that burned due to an electrical short circuit has the ability to potentially propagate the fire to the surrounding buildings, which would certainly harm many people. Therefore, to overcome these problems, an electrical system capable of controlling the safety and electronic devices need to be installed in a house/building by a certified expert approved by the government.

LITERATURE REVIEW
Several studies have been conducted on the use of Web-based Android software to ON and OFF electrical devices at home. For instance, Hodge et al. [1] studied android based home automation system, using raspberry pi to control electronic devices at low cost easily. The use of a smartphone-based android system to make home automation control was also examined by Gunge et al. [2] and Setiawan et al. [3]. They also used a raspberry pi as the control design to significantly reduce electricity consumption. The research carried out by Shireesha et al. [4] used a raspberry pi to enable the disabled to carry out their various electrical activities on a webpage. Meanwhile, the use of raspberry pi was also applied by Maslekar et al. [5] to control lights at home. Chen et al. [6] researched the application of raspberry pi to lock telephones automatically. The research combined Rpi3 and hardware sensors and was connected to the MQTT as a data producer.
Furthermore, numerous researches have been carried out on the use of raspberry pi to control household appliances from a smartphone-based android system. For instance, Arifianto et al. [7] successfully applied raspberry pi as a control system center for filling bottles of drinking water in the home. A similar method was used by Akbar et al. [8] by integrating raspberry pi, UPnP protocols, and Xbee to control home appliances smartly. This is in addition to the research carried out by Lochan Basyal [9] to develop smart home applications.
Meanwhile, Birajdar [10] used raspberry pi to implement an embedded web-server based on ARM11 and Linux. The result showed that any client could access the system over the internet. Ali et al. [11] developed a wheelchair controllable with the eyes based on an autonomous camera using raspberry pi. However, there are still some inconsistencies associated with this device, thereby making it difficult to function in dark places. Vignesh Kumar et al. [12] applied the raspberry system to control the power factor automatically. The research shows that the tool is applicable to industry or households to make the power factor more stable.
All the electronic devices previously mentioned will be controlled in this research by integrating the devices, which are manipulated manually by using a local network or through an internet network.

EXPERIMENTAL EQUIPMENT, MATERIAL, AND METHOD 3.1 Materials and Tools Research
Several tools and materials were used to carry out this research as follows:

Data Collection
Data used to carry out this research were collected as follows: 1. Direct interview with several experts in the field of electrical installation and control systems. 2. Literature review by comparing conceptual theory and its application to support the experiment. 3. Direct measurement to control the equipment used and obtain obvious results and factual. 4. Documentation by making raspberry-based electrical equipment control and monitoring applications using smartphones.

Data Analysis Method
This research used the analytical method to model and formulates a system, which is further solved using the appropriate technique. The choice of analytical method used in this research has a direct effect on the level of accuracy. The analysis results are the success rate of the electrical device control system in a house that is controlled and monitored automatically through a Smartphone or manually via switches.

RESULTS AND DISCUSSION 4.1 Application Design
The system to be built is a tool that controls and monitors electrical devices, such as MCB, lights, TV, heaters, refrigerators, AC, box of auxiliary contacts (BAC), water pump, reservoir control device with a sonic sensor, control tools for electric energy savings with pears sensors, smoke/gas detector with an MQ2 (gas sensors), and environmental monitoring tools using an environmentally friendly webcam and a smartphone. This control and monitoring system consists of 3 main elements, namely input, process, and output. The output is produced from the control system design, while the inputs are those parameters used to regulate the output. In this case, the controlled device is electrical equipment. The minimum control requirements for electrical devices are commonly used to turn on and off electrical equipment. Therefore, a simulated electrical equipment control system was built in this research, as shown in Fig. 1.

Electrical Installation Design
The design of the Electrical Installation is based on the Regulations of PUIL 2011, SPLN, and LMK. This type of electrical installation utilizes a 4B MCB safety device to secure all electronic devices in the house/building, which are automatically controlled through the smartphone and manually via the switch button installed inside the house. The switch used to activate (ON) and extinguish (OFF) the lamp manually is connected to the relay device located on the control panel. Every lamp and KKB used in a house/building is controlled by a relay contained in the control panel. Fig. 2 shows a sequential step on how to connect electrical safety devices with electrical equipment, such as electricity/MCB, lights, TV, heaters, refrigerators, AC, KKB, water pump machines, reservoir control devices with sonic sensors, electric energy saver control with PIR sensors, smoke/gas detector with MQ2 gas sensors, and environmental monitoring using a control equipment, such as relay, raspberry, access points and smartphone.  Fig. 2 clearly shows an access point as a server connecting smartphones and raspberry. It is also used as a control for electricity/MCB security devices, lights, TV, heater, refrigerator, AC, KKB, water pump machine, reservoir control, electric energy saver, smoke/gas detector, and environmental monitoring. The smartphone is used as a controller to send instructions to raspberry via a website-based application, with an IP Address/local 192.168.100.102 that function to control/turn on all electrical devices described above. These devices worked through the instructions of the raspberry device and relayed to the board, which then controls all electrical devices, according to the consumer's desire. Fig. 2 shows the development of a local connection capable of controlling electrical equipment using an internet connection. A modem/router is also used as a link to connect local and internet networks. Users must login to the internet and access the link: http://www.penelitikendaligedung.ngrok.com_using their phone. The user's smartphone is used as a remote to send instructions to the raspberry in order to control and secure electrical devices in the house or building.

Discussion of Design and Testing Results
First, the research team made the application design and installed the electrical devices, as shown in Fig. 1, Fig.  2, and Fig. 3. Second, the validation team refined the developed software and downloaded it into the raspberry connected to the devices, such as sonic sensor, PIR sensor, Q-2 sensor, relay board, and microcontroller (raspberry set), smartphone, and other small devices. After connecting the devices perfectly, the raspberry is download and tested for all electrical devices, as shown in Tab. 1 to Tab. 4.     The control devices on raspberry-based home electrical systems are tested on the boarding house that had been designed as a real home replacement. The results showed that security plays a very vital role in the electrical system of a house/building. Furthermore, without a good safety system, the house is prone to fire hazards. From the test results towards the security system installed, the authors carried out various activation and placed a short circuit between the phase and neutral cables. The result shows that the safety device installed in the house acts as a short circuit inside and secures the house from fire hazards.
After ensuring the proper functioning of the security system, the next test is connecting the safety device with the control, as previously stated. When the safety device is turned ON (activated), it is indicated on the smartphone's screen. This means that all electrical devices installed in the boarding house are ready to be operated at 220-volt. The equipment included in the electrical equipment controlled is electricity/MCB, lights, TV, heater, refrigerator, AC, KKB, water pump machine, reservoir control with the sonic sensor, electric energy saver control with PIR sensor, and tool smoke/gas detector with an MQ2 gas sensor.
The next test is to turn OFF (deactivate) the electric safety device installed on the boarding house. The results obtained in KKB using a digital multimeter are zero volts (V = 0 volts). This result illustrates that all the control systems are inoperable because there is no electricity supply from SEE (state electricity enterprise). Therefore, the electrical system of a raspberry-based future home cannot be used. The OFF position needs to be turned ON to activate the control system, as shown in Tab. 1 to Tab. 6. Furthermore, all-electric lights installed in the house are tested. Therefore, switch number 1 need to be in the ON position either manually or using a smartphone to turn light no. 1 that was previously connected to the specified local IP. It can also be turned OFF and ON at a distance by using the local IP address specified on the control device. Similar methods were also used to turn on all the lights installed on the boarding house.   Tab. 5 shows the result of testing gas/smoke detectors found in rooms/offices using a smartphone, both at close range using local IP and remotely through the internet network. The result indicates that when there is a considerable amount of gas/smoke over the threshold, the sensor works automatically by providing a signal to the smartphone. The code appears "ON" on the screen and the indicator lights are installed in the room. In addition, the horn also rings and only stops when the OFF button on the smartphone or switch is pressed. Moreover, assuming there is still a lot of smoke in the room/office, the horn and the indicator light will not turn off /stop even when pressed. This indicates that the gas/smoke sensor is more sensitive, and the manual buttons only work when the smoke in the room has completely left.
The next stage is testing the electricity usage saver using the motion sensor/PIR, as shown in Tab. 6. It also the light functions with motion sensor functions, therefore when people are in the room, the lights turn ON with the switch position at 1 and vice versa.
The next activity is testing reservoir control devices with sonic sensors by electricity source from KKK, which denotes the special contact box for the reservoir. The testing for the water pump machine by a voltage source from KKB3 is used by the tower water system in which the water bath cap is fitted with a sonic sensor to control the level contained in a water bath. The sonic sensor installed is controlled by the raspberry and relay contained in the panel board. Furthermore, the control system automatically assumes the ON button on the smartphone is activated or manually switched on the boarding house. Conversely, when the button is turned OFF, no power supply source goes into the KKK, therefore, the water pump engine does not function (V = 0 volts). The water tower is equipped with a sonic sensor capable of monitoring the water level in a bath. The control device has the ability to stop the water pump engine at various levels of water contained in the tub through the smartphone or manual button.
The last test is a home/building environment monitoring trial. The webcam 1 is able to function and capture images through local or internet networks, assuming the smartphone status is ON. Conversely, when the buttons on the smartphone are pressed to dim webcam 1 (OFF position), the camera automatically stops capturing images. It also appears in the same path with webcams 2 and 3.

CONCLUSION
In conclusion, the raspberry-based future house electricity system functions appropriately as follows: 1. All safety control systems (MCB) have various loads. 2. The hardware has the ability to control electrical devices, such as electric safety/MCB, electric lights, TV, heaters, refrigerators, air conditioners, KKB, and water pump machines properly using a smartphone. 3. The application and interface of the Arduino megabased control system function properly with the ability to control the electrical equipment through a smartphone.