IoT-Based of Automatic Electrical Appliance for Smart Home

The remote-control system on electrical equipment in the room can be created by implementing the internet as an Internet of Things (IoT). All devices managed from one interface to deliver quick and convenient home appliances management. This research contributes to IoT Technology for controlling lights, vertical curtains, and the temperature of the air conditioner (AC) by implementing a private network to run a personal cloud service. The hardware utilized is Raspberry Pi 3 as a server, Relay, motor stepper, IR led Transmitter, and temperature sensor DS18B20. For implementation, an android application is developed by MIT App Inventor 2. The result shows that all features function correctly, but each device responds with a different delay value. Delay time response of a lamp, vertical blind, and AC is up to 1.5 sec, 2.1 sec, and 1.6 sec, respectively. Keywords—Electrical appliances, IoT, controlling system, smart room


Introduction
Technology becomes an essential part of human life. People need communication, and information is one aspect that influenced by current technology development, which allows us to make a device and system that can assist all activities and resolve problems by themselves. One of the systems created by man to facilitate the work of the system is the Smart Home. Smart Home is an automated system for a room or a building ease task management. This system provides comfort, convenience, and energy efficiency [1]. A smart home is equipped with a communication network, devices, and sensors that can be automatically controlled remotely from anywhere via a smartphone application, GSM network, or even voice [2][3] [4].
Internet of Things (IoT) leads to an electronic access control system that allows a person to perform many activities faster, more productive, and safe. IoT is a scientific development that is very promising to optimize life based on smart sensors and smart devices that cooperated through the internet. In 2018, Bo et al. compared the smart grid communication infrastructure's performance by utilizing IoT technology. This study was to observe the efficiency of power usage and stability [5]. Kim et al. purpose to describe and manage the aggregated home IoT data based on Smart home Web of Objects (SWO), and SWO analytics platform using real data from smart metering devices to analyze appliance usage patterns [6]. IoT technology for real-time smart home implementation was also developed on the Arduino microcontroller board and Lab-VIEW platform. The process of evaluating the system's design carried out trials on three household appliances, namely room temperature, light energy savings, and security cameras. The results obtained from the testing process prove the simplicity of the system design, cost-effective, and flexibility [7].
In addition to controlling household appliances, a slightly different study was also conducted by Pal. Smart home healthcare service developed for older adults. The survey process was carried out on 254 older adults aged over 55 years in four Asian countries. Modeling of structural equations of the smallest partial squares is applied in analyzing this problem. This research forms the basis for developing and exploring future IoT technology for elderly health care [8]. Yan et al. implement telemedicine using wearable sensors and intelligent medicine packages as IoT devices for service efficiency. The study concerned the variety of health IoT devices and their hardware architecture [9]. Ali et al. proposed a compatible smart home computing platform architecture to integrate with a smart grid. The proposed hardware and software algorithm empower utility companies and homeowners to communicate with home appliances through a public mobile network to monitor and manage power consumption of home appliances [10].
In 2015, monitoring electrical parameters of household devices such as voltage current and subsequently calculated the appliance's power consumed is performed by Suryadevara et al. The power management in a home can be improved by this technique, which makes proper utilization of electricity [11]. IoT devices also implemented in building security. For example, users can monitor and control the home appliances and door permission systems in building/home [12]. Related to data security on IoT technology, several studies have also been conducted, showing that security and privacy were the important factors that influenced people's intention to adopt the smart home [13] [14]. Issues of confidentiality and information integrity must guarantee a timely response. Research conducted by Mbarek et al. proposed a safe data aggregation scheme using compressed sensing (CS). The encryption process is then performed for each sensor node and the utilization of the hash algorithm to ensure data integrity in the smart home system [15].
This research aims to integrate lamp, curtain, and AC remote into a long-distance with IP-Based that implements the semi-automatic system for further smart building employment. This study used the "ngrok" private network to run a personal cloud service that functions to synchronize files and run webmail from hardware securely using end-to-end encryption.

Techniques and Materials
The system is designed to ease the control of light and room temperature and streamline the room's electrical energy consumption. This study uses a room that has six lights, one vertical blind curtain, and one AC. For temperature adjustment, a series of IR LED Transmitters controls the air conditioner's is temperature and additional sensors to monitor the temperature of the room. The system is controlled and monitored through the internet network using a Smartphone.
The proposed system architecture is shown in Figure 1 and explained as follows: 1. Raspberry Pi 3, as a central command and server 2. Smartphone with Android OS, as an access medium to Raspberry Pi 3 by the internet 3. Relay SPDT 12V DC, as an electronic switch to control TL lamp 4. Driver L298N is used to control the speed and the direction of Motor Stepper Nema 17 5. Motor Stepper Nema 17, as a vertical blind driver 6. IR LED Transmitter, as an infrared signal transmitter to control AC 7. DS18B20 Sensor, as a temperature sensor 8. Opto-sensor, as a vertical blind original condition sensor The schematic diagram of hardware is shown in Figure 2. There are six relays SPDT, six diodes IN5399 of 1.5A, eight resistors 100Ω of 0.25 watt, two resistors 4.7kΩ, one resistor 22kΩ, seven NPN transistors type 2N2222, one temperature sensor type DS18B20, one IR LED, one Opto-sensor, one motor stepper nema17, and one driver L298N.

Lamp controller circuit
The controlled circuit is Relay Module with six channels of 12V with NPN transistor type 2N2222. A Relay is connected to a transistor. If the input signal from Raspberry Pi 3 is going through a 100 Ω resistor to transistor basis, the transistor will be active, and the circuit works with pulls the Relay where there will be an initial displacement of the state from NC (Normally Close) to NO (Normally Open). The IN5399 diode function is to eliminate electromotive force (EMF) when the input signal stops and protects the transistor. Figure 1 shows that each NO on Relay is connected to each lamp, while the COM Relay is connected to the electricity source. The relay switch is regulated by each input signal on the GPIO (General Purpose Input / Output) pin of the Raspberry Pi 3, and pins 11, 5, 6, 13, 19, and 26 controls six lamps in this system.

AC controller circuit
In the AC controller, an NPN transistor is used as a switch that forms a square wave as a remote control. Data is sent via the Raspberry Pi. The LED anode is connected to the power supply of Raspberry Pi 3 while the LED cathode is connected to the transistor collector. There is a resistor of 100kΩ connected to the base and emitter of the transistor. The emitter transistor is directly connected to the ground and the base is connected to the GPIO of pin 14 as the Raspberry Pi output.

Vertical blind controller circuit
We use Motor Stepper Nema 17 to rotate the Vertical Blind shaft and to control this motor we use the L298N Motor Driver which functions to regulate the rotation direction and rotational speed of the motor. The four outputs on L298N is connected with Motor Stepper, GND (ground) is connected to a parallel power supply with Gnd on Raspberry Pi, and the power used is 12V DC and four inputs connected to Raspberry Pi 3 GPIO pins, which are pins 12, 16, 20, and 21.
Stepper Motor is used to rotate the Vertical Blind curtain shaft and to control this motor, the L298N Motor Driver is used to regulate the direction of rotation and motor speed. Four outputs on the L298N are connected to a Stepper Motor, ground (GND) connected to a power supply that is parallel to GND on the Raspberry Pi. The power used is 12V DC and four inputs are connected to the GPIO pin from Raspberry Pi 3, namely pins 12, 16, 20, and 21.

Temperature monitoring circuit
On the DS18B20 module sensor, VCC is connected to GPIO 3.3V DC Power pin on Raspberry Pi, GND is connected to the GND Raspberry Pi pin, and the data is connected to GPIO pin 4.

Temperature monitoring circuit
On the DS18B20 module sensor, VCC is connected to GPIO 3.3V DC Power pin on Raspberry Pi, GND is connected to the GND Raspberry Pi pin, and the data is connected to GPIO pin 4.
The Opto-sensor output will be connected to the pin GPIO17 of Raspberry Pi through a 22kΩ resistor. This circuit functions as a pull-up and pull-down to overcome floating conditions in the circuit so that the signal can be defined as high (True) or low (False). The Opto Sensor functions LEDs as senders of optical light signals (Transmitter), while Phototransistor functions as the receiver of the light (Receiver). The light emitted will be detected by Phototransistor and cause a connection or switch ON on the Phototransistor. The way the Phototransistor works is almost the same as Bipolar Transistor, the difference is that the Phototransistor base operates as a light-sensitive receiver.
After the hardware design process, software design is carried out on Raspberry Pi and Android-based smartphones. This research applies Raspbian Jessie as an operating system. Raspberry Pi functions as a server that receives commands from a smartphone and then executes data on the server with a python script to control the device. In order to make, the local host "NGROK" is used. The android application for this system developed using the official Android application site by Google.  Result and Discussion The proposed system performance is based on the delay time response parameter. Testing is performed by connecting the Raspberry Pi and Smartphone with the same Internet Service Provider. Data retrieval is carried out 10 times for testing each controlled device. Fig. 2 shows the main display of software design on the smartphone and Fig. 3 shows the average delay time response for each device.  on the temperature monitor is higher than other devices because the DS18B20 sensor has a delay in converting temperature data to the 12-bit digital world in a maximum of 750 milliseconds.

Conclusion
This research performs electronic devices control, such as a lamp, AC, and vertical blind in a room using a smartphone. The delay value reported by Ping becomes the indicator of how responsive the communication with the designated computer. This research shows that the average delay response of HTTP for lamp control is 1.5 sec, a vertical blind is 2.1 sec, and AC control is 1.6 sec. In future research, the development of the device condition monitoring system and room security systems such as adding a solenoid door lock for room access will be studied.