2022 2nd International Conference on Electronic and Electrical Engineering and Intelligent System (ICE3IS), 4-5 November 2022 2022 2nd International Conference on Electronic and Electrical Engineering and Intelligent System (ICE3IS) | 978-1-6654-6541-0/22/$31.00 ©2022 IEEE | DOI: 10.1109/ICE3IS56585.2022.10010040 Relay Module IoT Devices for Remote Controlling of Home Automation System Riky Tri Yunardi Department of Engineering Faculty of Vocational Universitas Airlangga Surabaya, Indonesia rikytriyunardi@vokasi.unair.ac.id Aji Akbar Firdaus Department of Engineering Faculty of Vocational Universitas Airlangga Surabaya, Indonesia aa.firdaus@vokasi.unair.ac.id Muhammad Najib ‘Abdulloh Department of Engineering Faculty of Vocational Universitas Airlangga Surabaya, Indonesia m-najib-abdulloh-2018@vokasi.unair.ac.id Sisca Dina Nur Nahdliyah Department of Engineering Faculty of Vocational Universitas Airlangga Surabaya, Indonesia sisca-dina-nur-n@vokasi.unair.ac.id Karisma Trinanda Putra Department of Electrical Engineering Faculty of Engineering Universitas Muhammadiyah Yogyakarta Yogyakarta, Indonesia karisma@ft.umy.ac.id Abstract— Remote controlling of home automation system has the potential to help people to control the electronic and home appliance from anywhere. Internet of things (IoT) is proposed to provide the connect and control devices by using the internet network. IoT based switching relays can be used to easily disconnect and connect 220V AC voltage in the home. In this work, ESP8266 microcontroller with relays module to switch and control the home appliances. The internet signal from Wi-Fi is captured by the ESP8266, the microcontroller will send commands according to the instructions from the smartphone remotely. System testing is carried out to determine the performance of the system can work according to design. The three parameters in the system test are the response of the microcontroller to the smartphone application, the response of the relay to the microcontroller, and the response of the electrical device to the relay. onboard Wi-Fi which can be controlled and managed on all electrical appliances in the house. The passive infrared sensor (PIR) motion sensor is installed at the entrance of the building to detect human movement which triggers input for the microcontroller. Keywords— Relay module, internet of things devices, remote controlling, home automation system I. INTRODUCTION Home automation or smart home can be described as a technology that is used in the home environment to provide comfort, security, and energy efficiency for its occupants [1]. To improve home automation, connecting a control system to electronic equipment that can be remotely controlled can be a good solution. Using servers and networks, residents can use a Bluetooth or Wi-Fi connection to control their home appliances. The system using IoT, can control electrical equipment through an easy-to-use web interface and can connect to the network, Da Xu, et.al and Ahmad, et.al can identify many opportunities to build computing applications and systems using communication networks [2][3]. In addition, this system can relate to various types of devices such as smartphones and personal computers. The Internet of things (IoT) creates technological innovations with computing that help enhance the capabilities of electronic devices by supporting safety and cost efficiency [4]. Kodali et al. [5] proposed the construction of a wireless home security system using the Internet and announced an alert on their IoT project. The proposed system supports two command operations, alerts and statuses which are sent by the system managed by the microcontroller which is connected to Wi-Fi and is received by the user through the mobile phone. The controller used is based on the TICC3200 Launchpad board with a microcontroller and In recent studies, the concept of a home automation system involving IoT has been increasingly developed and implemented [6-8]. Different equipment will require different services, the function commands are adjusted to the needs of the device used. Relays function as switches that turn on and turn off electrical devices. Taştan et al. IoTbased home automation using a mobile phone developed from the Blynk iOS/Android interface for the application of air conditioning and lighting device control in a room [9]. In this way, devices at home can be monitored and controlled via mobile devices such as smartphones easily. In addition to convenience, the internet of things technology allows users to remotely destroy this current from the electrical load. Yunardi et.al use a series of residual current devices (RCD) in electrical installations [10], so that the user can monitor this leakage current remotely on the electrical load in real time. The development of real-time monitoring using the ESP8266 Wi-Fi module has also been implemented by Putra on a power point tracking device for solar cells [11], a system designed to transmit data to a smartphone connected to photovoltaics, voltage sensor and current sensor. The proposed IoT based device is reliable and works in real time that makes an important contribution for remotely controlling electrical devices to achieve the goal of smart home. Compared with other studies, the novelty of a proposed system is reflected by using relay module IoT devices, that easy to be replaced and operated to various electrical devices. In this study, a relay module system for IoT devices has been designed for remote control as a switch that turns on and off internet-based electrical devices. Remote controlling using a microcontroller via the internet network is received by the microcontroller via the ESP8266. The internet network connects the Blynk app with a smartphone. These instructions are received by the microcontroller through the ESP8266 and then control the relay module. The relay module functions as a switch that turns on and turns off electrical devices through the internet network. 978-1-6654-6541-0/22/$31.00 ©2022 IEEEOF TECHNOLOGY HAMIRPUR. 350Downloaded on January 20,2023 at 11:37:17 UTC from IEEE Xplore. Restrictions apply. Authorized licensed use limited to: NATIONAL INSTITUTE 2022 2nd International Conference on Electronic and Electrical Engineering and Intelligent System (ICE3IS), 4-5 November 2022 II. SYSTEM ARCHITECTURE AND SETUP In our proposed design, the IoT devices relay module consists of an 8-channel relay module using the ESP8266 Wi-Fi chipset which is integrated with a microcontroller. The communication used is Wi-Fi which is connected to the TCP/IP protocol, so the relay module can be controlled via a smartphone with an internet network. Figure 1 shows a block diagram of the proposed design on the system. Fig. 1. Block Diagram of Proposed Method microcontroller based on the instructions from the web. The switch on the relay works according to the instructions from the microcontroller. The microcontroller will see the state of the switch status, and the status can also be monitored. The microcontroller sends data in the form of logic high or low to the relay module. The relay module which is used as the prototype for the control device must be electrified, so the contacts will be connected or disconnected so that the electrical device will turn on or off. On the website, there are several channel options to control the devices used in electrical equipment by pressing the button on the smartphone screen. The proposed system works a flow chart that is compiled based on Figure 2. When the system is turned on, the microcontroller initializes the peripherals to be used to control and manage device communications. The software used as the remote control is Blynk. The first step is to include the Blynk library and ESP8266. In the library display, there will be a variable filled with the Auth Token obtained from the Blynk application, the SSID and the Wi-Fi password to be connected. This is done so that the WeMos microcontroller can be connected to the Blynk Application via the internet network. After the program is entered into the microcontroller, the next step is to prepare the Blynk application by entering the widget that will be used as a remote control. Then testing is done whether Blynk is already connected to the microcontroller. Internet signals emitted from Wi-Fi are captured by the ESP8266 chipset embedded in WeMos. This internet signal is in the form of instructions that the user sends through the Blynk application. The signal will then be processed into parsing data by the microcontroller. After that, the microcontroller will send a command to the relay. The relay will act on instructions from the microcontroller in the form of high or low. The high signal is a command to electrical devices to turn on and a low signal is a command to electrical devices to turn off. The electrical devices used are two lights and a fan. A. WeMos Microcontroller The WeMos microcontroller is a development microcontroller based on the ESP 8266 microcontroller module. By using the Wemos, a microcontroller-based Wi-Fi system in one of the boards that can work with Arduino, especially for projects that carry the IOT concept. ESP8266 is a chipset that supports the Transmission Control Protocol/ Internet Protocol (TCP/IP) stack so that the microcontroller can connect to a Wi-Fi network using simple commands. It has a clock of 80 MHz with 4MB of external Random Access Memory (RAM) and supports the IEEE 802.11 b/g/n format so it doesn't cause any disturbance to others. WeMos microcontroller shown in Figure 3. Fig. 2. The Workings of The System In the proposed relay system functions as an equipment controller. Equipment control is carried out using two methods, namely manually and using the web via a smartphone. The command received will be processed by the Fig. 3. WeMos Microcontroller 351Downloaded on January 20,2023 at 11:37:17 UTC from IEEE Xplore. Restrictions apply. Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY HAMIRPUR. 2022 2nd International Conference on Electronic and Electrical Engineering and Intelligent System (ICE3IS), 4-5 November 2022 B. 8 Channel Relay 8 Channel Relay is a module which consists of 8 relays in 1 board. The relay on the module is a Single Pole Double Throw (SPDT) relay consisting of a common, normally open and normally closed contact respectively. This type of relay is capable of up to 10A and 250VAC suitable for home appliances. The output of the relay is applied as an electronic switch which consists of 8 HKE HRS4H-S-DC5V relays that use 5V so that it can be connected to a microcontroller. The relay module is equipped with a voltage level drive with an opto-isolated digital input with an induction damping circuit Each channel has a status indicator indicated by an LED indicator. 8-Channel Relay Board Module shown in Figure 4. The pin used on this microcontroller is a digital pin. The ground pin on the microcontroller is connected to ground on the relay, pin 5V is connected to pin Vin on the relay, pin D1 is connected to pin IN1 on the relay, pin D2 is pinned to pin IN2 on the relay. The contacts on the relay used are normally open, that is, if the contacts are not connected or open, then electric current will not flow into the electrical circuit. The signal sent by the smartphone through the Blynk application will be received by the WeMos microcontroller and send a command to the relay, so that the relay will act. Relays function as switches to turn on or turn off electrical devices. D. Hardware Design The hardware design stage includes the layout of components, installation of electrical devices, installation of relay module and microcontroller. The electrical devices used are two lamps and one fan. The wiring stage aims to regulate the voltage to be used, in this prototype, AC and DC voltages will be used. AC voltage are used for the lamps, and DC voltage for the fan. Hardware designs are shown in Figure 6. Fig. 4. 8-Channel Relay Board Module C. Electrical Configuration As a controller of the prototype, the WeMos board component is powered by DC electricity with a 3.3 V input voltage. Power from WeMos comes from a power supply with 5V and current up to 1000 mA. Then the relay module that acts as a switch, which is controlled by WeMos. The relay is powered by DC power with a 5V input voltage, and the Ground pin of the relay is connected to the Ground pin of WeMos. The AC power source for home appliances is plugged into the common pin on the relay. The output of this relay is a normally open (NO) pin, so that when the contacts are in the open position, no electric current flows. The prototype electrical configuration shown in Figure 5. Fig. 5. Prototype Electrical Configuration Fig. 6. Hardware Design E. Visualization of Blynk Application To build a prototype of controlling electronic devices with an IoT system remotely online, an Android platformbased application was developed via a smartphone. This application creates project interfaces with various input and output components that support sending and receiving data and represent data according to the selected components. In Blynk application the three most important things are Application, Server, and Library [12]. The server supports all communication between applications and hardware. And Libraries support communication for hardware with server using commands. Blynk can build a graphical interface with a widget that is useful for controlling the microcontroller module over the Internet. From the application can display a layout visualization and specially designed buttons are used to facilitate the monitoring and control of the relay module. Visualization of the Blynk application relay module control developed is shown in Figure 7. 352Downloaded on January 20,2023 at 11:37:17 UTC from IEEE Xplore. Restrictions apply. Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY HAMIRPUR. 2022 2nd International Conference on Electronic and Electrical Engineering and Intelligent System (ICE3IS), 4-5 November 2022 TABLE II. No 1 2 3 4 5 6 7 8 9 Fig7. Blynk application relay module control III. RESULTS The proposed system testing aims to find out the work response of the system developed on the relay module of IoT devices. Three parameters in system testing to be analyzed. First, the microcontroller response to the Blynk application. Second, the response of the relay to the microcontroller. Third, the response of electrical equipment to relays. The response of the Blynk application to the microcontroller can be interpreted as the ratio of time to distance. In this case, the distance indicates the range between the microcontroller and the smartphone. Meanwhile, the response time itself is the time needed to control electronic equipment with the action of a smartphone on what is generated. The first test carried out was testing the response of the prototype to the distance. Distances used are 1 meter, 5 meters, and 10 meters. Every electric device will be tested 5 times. The results of testing the response of the microcontroller to the distance can be seen in Table I. TABLE I. No 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 TESTING THE MICROCONTROLLER RESPONSE TO THE BLYNK AT 1, 5 AND 10 METERS Electrical Status Equipment Lamp 1 Turn On Lamp 1 Turn On Lamp 1 Turn On Lamp 1 Turn On Lamp 1 Turn On Lamp 2 Turn On Lamp 2 Turn On Lamp 2 Turn On Lamp 2 Turn On Lamp 2 Turn On Electric Fan Turn On Electric Fan Turn On Electric Fan Turn On Electric Fan Turn On Electric Fan Turn On Average Value 1 Meter 0.15 0.31 0.13 0.13 0.14 0.13 0.30 0.11 0.11 0.10 0.22 0.14 0.15 0.14 0.13 0.159 Time Response (s) 5 Meters 10 Meters 0.09 0.15 0.14 0.21 0.09 0.14 0.11 0.13 0.12 0.18 0.13 0.11 0.15 0.13 0.14 0.12 0.13 0.17 0.21 0.12 0.17 0.11 0.16 0.13 0.12 0.12 0.31 0.15 0.26 0.14 0.155 0.141 The results of the three tests indicate that the response of the microcontroller to the Blynk button command is not affected by distance. The three relays used have a good response, so the response time between devices has the same results. Response times resulting from experiments with each other show a fast response time. Testing the response of the relay to the microcontroller aims to determine the condition of the relay that will be used. Relays that are in good condition, when activated, the LED indicator will light up and the switch on the relay will be active. The relay response test was performed 3 times for each relay pin used. The table II shows the test results. Pin on WeMos Pin 1 Pin 1 Pin 1 Pin 2 Pin 2 Pin 2 Pin 3 Pin 3 Pin 3 TESTING THE RELAYS RESPONSE TO THE MICROCONTROLLER Pin Status Active Active Active Active Active Active Active Active Active Relay Channel Number Relay 1 Relay 1 Relay 1 Relay 2 Relay 2 Relay 2 Relay 3 Relay 3 Relay 3 Relay Status Turn On Turn On Turn On Turn On Turn On Turn On Turn On Turn On Turn On The results of this test show that the relay used can function. The 3 pins relay used can respond to the microcontroller properly. The switch on the relay can be activated when receiving a high signal instruction from the microcontroller. And the LED indicator can be lit when the relay is active. Test the response of electrical devices to the relay. This test aims to determine the condition of the electrical equipment used. If the device is good, the device will quickly respond to instructions from the relay. On the other hand, if the device is damaged, the electrical device will not turn on if the relay is active. This test was conducted 3 times for each device. Table III is the result of testing the response of electrical equipment to relays. TABLE III. No 1 2 3 4 5 6 7 8 9 TESTING THE RESPONSE OF ELECTRICAL EQUIPMENT TO RELAYS Relay Channel Number Relay 1 Relay 1 Relay 1 Relay 2 Relay 2 Relay 2 Relay 3 Relay 3 Relay 3 Pin Status Relay Channel Number Relay Status Active Active Active Active Active Active Active Active Active Lamp 1 Lamp 1 Lamp 1 Lamp 2 Lamp 2 Lamp 2 Electric Fan Electric Fan Electric Fan Turn On Turn On Turn On Turn On Turn On Turn On Turn On Turn On Turn On The results of testing the response of electrical equipment to relays are electrical devices that have normal conditions. So that electrical equipment function according to the instructions from the relay. In addition to experiments in the laboratory room, experiments with long range distances were also carried out. The first experiment was carried out by sending a command from Banyuwangi to Tulungagung as a place for installing the relay module for IoT devices which has a distance between cities of 350 km. For the second experiment, it was carried out by sending orders from Tangerang to Tulungagung which has 752 km. Experiments that have been conducted to determine the response of the system to the distance required to activate electrical equipment are no different from the data in the laboratory. IV. CONCLUSION In this study, an IoT system was implemented capable of controlling relay module system that can be remotely controlled. This system is designed with Wemos microcontroller and relay module as a switch that suggests and turns off electrical devices. Controlled by a smartphone with the Blynk application, it sends instructions to the microcontroller via the internet network. 353Downloaded on January 20,2023 at 11:37:17 UTC from IEEE Xplore. Restrictions apply. Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY HAMIRPUR. 2022 2nd International Conference on Electronic and Electrical Engineering and Intelligent System (ICE3IS), 4-5 November 2022 The system that has been designed has a fairly good performance and the system has been proven to be efficient and reliable. Each part of the system previously tested has a good response in receiving instructions. This can be seen from the test results, the response of the microcontroller to the Blynk application and the relay response to the microcontroller can work properly. The success of establishing a connection between the IoT board and Blynk App, depends on the availability and speed of the internet network. This is proven by the test results from previous research which were only in the laboratory room. Longdistance experiments were also carried out by sending orders from Banyuwangi to Tulungagung which has a distance between cities of 350 km and from Tangerang to Tulungagung which has 752 km. Thus, instructions to electrical equipment can be done easily and quickly from very far locations (between cities). [11] Putra, D.F.U., Firdaus, A.A., Yunardi, R.T., Ali, M., Rosalino, A.P. and Putra, N.P.U., 2021, July. Real-Time Monitoring of Dual-Axis PV System Based on Internet of Things. In 2021 International Seminar on Intelligent Technology and Its Applications (ISITIA) (pp. 349-353). IEEE. [12] Durani, H., Sheth, M., Vaghasia, M. and Kotech, S., 2018, April. Smart automated home application using IoT with Blynk app. In 2018 Second international conference on inventive communication and computational technologies (ICICCT) (pp. 393-397). IEEE. For future work, the system needs some improvements, especially to increase the features on the relay module IoT devices needed in the home automation system. Also, the proposed smartphone implementation can be more interactive on the system for decision-making purposes that support security and cost efficiency. REFERENCES [1] Singh, H.K., Verma, S., Pal, S. and Pandey, K., 2019, August. A step towards Home Automation using IOT. In 2019 Twelfth International Conference on Contemporary Computing (IC3) (pp. 1-5). IEEE. [2] Da Xu, L., He, W. and Li, S., 2014. Internet of things in industries: A survey. IEEE Transactions on industrial informatics, 10(4), pp.22332243. [3] Ahmad, U., Chaudhary, J., Ahmad, M. and Naz, A.A., 2019. Survey on internet of things (iot) for different industry environments. Annals of Emerging Technologies in Computing (AETiC), Print ISSN, pp.2516-0281. [4] Mandula, K., Parupalli, R., Murty, C.A., Magesh, E. and Lunagariya, R., 2015, December. Mobile based home automation using Internet of Things (IoT). In 2015 International Conference on Control, Instrumentation, Communication and Computational Technologies (ICCICCT) (pp. 340-343). IEEE. [5] Kodali, R.K., Jain, V., Bose, S. and Boppana, L., 2016, April. IoT based smart security and home automation system. In 2016 international conference on computing, communication and automation (ICCCA) (pp. 1286-1289). IEEE. [6] Singh, A.P., Biswas, A. and Singh, B., 2019, September. IoT Based Smart Home Automation Enabled with Manual Mode Switch Control. In 2019 2nd International Conference on Intelligent Communication and Computational Techniques (ICCT) (pp. 60-63). IEEE. [7] Mahmud, S., Ahmed, S. and Shikder, K., 2019, January. A smart home automation and metering system using internet of things (IoT). In 2019 International Conference on Robotics, Electrical and Signal Processing Techniques (ICREST) (pp. 451-454). IEEE. [8] Na, A., Isaac, W., Varshney, S. and Khan, E., 2016, October. An IoT based system for remote monitoring of soil characteristics. In 2016 International conference on information technology (InCITe)-the next generation IT summit on the theme-internet of things: Connect your Worlds (pp. 316-320). IEEE. [9] Taştan, M. and Gökozan, H., 2018. An Internet of Things based air conditioning and lighting control system for smart home. American Academic Scientific Research Journal for Engineering, Technology, and Sciences, 50(1), pp.181-189. [10] Yunardi, R.T., Sutanto, E., Firdaus, A.A., Tunggadewi, E.A., Ali, H.A. and Nurwahyuni, S., 2021, October. Leakage Current Monitoring for Electrical Loads Based on Internet of Things. In 2021 8th International Conference on Electrical Engineering, Computer Science and Informatics (EECSI) (pp. 79-84). IEEE. 354Downloaded on January 20,2023 at 11:37:17 UTC from IEEE Xplore. Restrictions apply. Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY HAMIRPUR.