• International Journal of Technology (IJTech)
  • Vol 13, No 6 (2022)

Home Automation to Reduce Energy Consumption

Home Automation to Reduce Energy Consumption

Title: Home Automation to Reduce Energy Consumption
Nahin Ar Rabbani, Yee-Loo Foo

Corresponding email:


Cite this article as:
Rabbani, N.A., Foo, Y.-L, 2022. Home Automation to Reduce Energy Consumption. International Journal of Technology. Volume 13(6), pp. 1251-1260

530
Downloads
Nahin Ar Rabbani Faculty of Engineering, Multimedia University, Persiaran Multimedia, 63100 Cyberjaya, Selangor, Malaysia
Yee-Loo Foo Faculty of Engineering, Multimedia University, Persiaran Multimedia, 63100 Cyberjaya, Selangor, Malaysia
Email to Corresponding Author

Abstract
Home Automation to Reduce Energy Consumption

This paper aims to provide a solution where home automation systems can reduce electricity consumption by using Internet of Things technology based on HC-SR501 PIR motion sensor, DS18B20 temperature sensor, and LDR analog sensor in conjunction with NodeMCU ESP8266 microcontroller and relays so that the home appliances can be automatically controlled based on human presence, temperature, and ambient light. The proposed solution includes a web application for users to give an idea of the amount of electricity consumed with daily and monthly unit cost, as well as to provide automatic and manual control functions of the appliances. PZEM-004T electrical energy sensor used with the NodeMCU ESP8266 to determine energy consumption. The hardware prototype was tested rigorously for an ample amount of time. The test results confirmed that the prototype functioned well and could control electrical appliances automatically and manually via the web app. Firebase is used as the cloud-hosted database to provide cloud infrastructure through which the web app and ESP8266 communicate with each other. The web app successfully collected electrical energy data and displayed the daily and monthly costs on the app's dashboard, as well as real-time motion, temperature, and light intensity.

Energy savings; Home automation; NodeMCU ESP8266; Smartphone; Web application

Introduction

    Home automation systems are becoming increasingly popular as a result of their numerous advantages. This project proposes a design of low-cost home automation system to reduce energy consumption by using the Internet of Things (IoT) technology (Vasicek et al., 2018).
IoT or the internet of things, commonly known as IoT, is a new technology that allows us to control electrical devices over the internet. The system's purpose is to leverage IoT to control household appliances, allowing modern homes to be automated over the internet. This system employs two loads to demonstrate how to control household appliances. A user-friendly mobile app enables users to control these household appliances remotely via the internet. The controller for this system will be a NodeMCU (Node Microcontroller Unit) (Raju et al., 2019; Wasoontarajaroen et al., 2017). The microcontroller will be interfaced with relay modules which will deploy switching commands to the appliances over the internet. This system also proposes an energy consumption detection system shown on the mobile app. NodeMCU processes the entire set of instructions to operate these loads properly and displays the sensors’ statuses on the mobile app dashboard. Thus, this system enables efficient home automation over the internet.

Related Work

      After doing several researches on existing home automation systems and various designs that have been implemented in the past, it was discovered that most home automation systems lack an energy consumption detection module (Raju et al., 2019; Vishwakarma et al., 2019; Rajarajeswari et al., 2021; Chandramoha et al., 2017; Kodali & Yerroju, 2018; Sindhanaiselvi et al., 2018; Priya & Kannammal, 2021; Simeon et al., 2018; Twumasi et al., 2017; Alimi & Ouahada, 2018; Umair & Shah, 2020). Most systems are made of expensive Arduino and Raspberry pi modules (Rajarajeswari et al., 2021; Chandramoha et al., 2017; Sindhanaiselvi et al., 2018; Priya & Kannammal, 2021). Very few of them used inexpensive NodeMCU ESP8266 (Raju et al., 2019; Wasoontarajaroen et al., 2017; Vishwakarma et al., 2019; Kodali & Yerroju, 2018).
    PZEM-004T electrical energy sensors were used in some experiments because they were considered the most feasible sensor for detecting energy consumption. (Wasoontarajaroen et al., 2017). It has also been found that the smartphone app only works on Android devices (Raju et al., 2019; Wasoontarajaroen et al., 2017; Vishwakarma et al., 2019; Rajarajeswari et al., 2021; Chandramoha et al., 2017; Kodali & Yerroju, 2018). Some work was also done for research purposes without a functional prototype.

This paper's proposed home automation system is designed with a PZEM-004T energy consumption detection module integrating with inexpensive NodeMCU ESP8266. A user-friendly web app that is accessible from both IOS and Android devices. Furthermore, these features are lacking in previous research.

Experimental Methods

    Sensor-based home automation is a cutting-edge technology that allows you to control appliances systematically. Wireless technology allows the devices to be controlled from other locations. Basically, the project is a concept for reducing energy consumption in the home by integrating automation. By using a web app, the user will be able to control all of their household appliances either automatically or manually.

     For systematic operation, the AC appliances in the home will be interfaced with NodeMCU. The built-in Wi-Fi of the microcontroller allows it to communicate with the server. The microprocessor is connected to motion, temperature, and light sensors, which will automatically control the appliances. Users will be provided with a web app that can be operated from a smartphone for auto or manual control. If the user wants to turn on or off the light or fan manually, he needs to use the app's switch control button as well as automatic control. Figure 1 depicts the overall block diagram of the proposed system. 

Figure 1 Block diagram of the proposed system

       When the user presses the button, Wi-Fi sends data to the server, which then sends a signal to the microcontroller. The appliances will then be turned on or off using the relays linked to the microcontroller.

Hardware Design

        The following is a list of the components used to build the hardware for the proposed system:

    NodeMCU ESP8266 V3 CH340G (Espressif, n.d.).

    DS18B20 – Waterproof Temperature Sensor (Arshad, 2020).

    PIR Sensor Module (HC-SR501) (Components101, 2021).

    Analog LDR (Storr, 2018).

    PZEM-004T V3.0 100A AC Electrical Energy sensor (Manuals+, 2021).

    5V DC Single Channel Relay Module x 2 (Components101, 2020).

       The NoeMCU ESP8266 was chosen as the microcontroller for this system because of its compact size, compatibility, and ease of interfacing compared to other microcontrollers. The ESP8266 firmware is open source and is based on the chip manufacturer's proprietary SDK. The firmware has a simple programming environment that includes a simple and fast scripting language.

      The board has a USB port already wired to the chip, a hardware reset button, a built-in IEEE 802.11 b/g/n Wi-Fi module, LED lights, GPIO, UART, SPI, and ADC pins. Figure 2 depicts a diagram of the NodeMCU ESP8266. It has an 80 MHz clock speed, 4 MB flash memory, and 64 KB SRAM.


Figure 2 Diagram of NodeMCU ESP8266

The sensors chosen for this project are: Passive Infrared (PIR) sensor, Light Dependent Resistor (LDR), DS18B20 waterproof temperature sensor, and PZEM-004T electrical energy sensor. A PIR sensor is an electronic sensor that detects infrared (IR) light radiating by objects in its field of view. A LDR is also called a photo-resistor or a cadmium sulphide (CdS) that measures the light intensity of the surroundings. The DS18B20 is one type of temperature sensor that provides 9-bit to 12-bit temperature measurements through a 1-Wire interface, requiring only one wire (and ground) to be connected with a microcontroller. The PZEM-004T is an electronic module that measures Voltage, Current, Power, Frequency, Energy, and Power Factors. The PZEM-0004T module is bundled with 100A current transformer coil. This module was found to be the most suitable for the scope of this proposed system. The sensors used in this project are shown in Figure 3.
       Since this project aims to automatically control AC appliances in a house, then using relays is the only way to control them automatically through a microcontroller. Two 5V single-channel relay modules were used for this project. A 5V relay is an automated switch used in an automatic control circuit to control a high-current signal with a low-current signal. The relay signal's input voltage varies from 0 to 5V. Figure 4 illustrates the pin layout of a 5V DC relay module.

Figure 3 Sensors used in the proposed system

Figure 4 5V DC single channel relay module

 

5.    Circuit Connection

       NodeMCU ESP8266 board is powered with USB 5V/1A. Meanwhile, the two relay modules, the PIR sensor, temperature sensor, LDR, and PZEM-004T, are interfaced with the ESP8266 board. The GND and VCC of the components are connected to the GND and 3.3V pins of the ESP8266 board. The two relay modules, PIR sensor, and temperature sensor inputs are given to general-purpose I/O interface pins GPIO14(D5), GPIO16(D0), GPIO12(D6), and GPIO13(D7), respectively. The energy sensor PZEM-004T inputs are interfaced with two general-purpose I/O pins, which are GPIO5(D1) and GPIO2(D4). The LDR is an analog sensor, so the input is given to the ADC A0 pin of the microcontroller. The complete circuit diagram is shown in Figure 5.
 

Figure 5 Circuit Diagram of the proposed system

5.1.  Hardware prototype

    Figure 6 shows the final system design and IoT implementation. All the previously mentioned components are connected to the circuit via a breadboard and male-to-female wires.

Figure 6 Hardware prototype of the proposed system

5.2.  System workflow

         The overall workflow of the home automation system is shown in Figure 7 below.

Figure 7 Overall system flowchart

Results and Discussion

This section discusses the progress made into three main results and findings: firstly, hardware results and findings; secondly, server results and findings; and lastly, web application results and findings.

6.1.  Hardware results and findings

    Figure 8 shows hardware results from the Arduino IDE serial monitor for debugging purposes. The result of this study represents the sensors’ real-time value extracted by the NodeMCU ESP8266. The previous study also carried out this controlling process using Arduino and Raspberry Pi microcontrollers (Rajarajeswari et al., 2021; Chandramoha et al., 2017; Sindhanaiselvi et al., 2018; Priya & Kannammal, 2021). However, since these microcontrollers are expensive, the inexpensive NodeMCU ESP8266 is used instead in this paper. Furthermore, it can be seen that the low-cost NodeMCU ESP8266 is capable of doing the same tasks as other more expensive microcontrollers, which is practically a cost-efficient solution.

Figure 8 Hardware activity from the serial monitor

6.2.  Server results and findings

    Firebase real-time database is used as the server, allowing communication with ESP8266. The sensor data from ESP8266 will be converted to a JSON object and then pushed to Firebase real-time database which is shown in Figure 9 below. Firebase will update the data and send data changed status to the web app. Thus the dashboard will refresh the data and show it to the user. This whole process is automated.

Figure 9 Firebase server real-time database results

6.3.  Web Application results and findings

    The web application is hosted on 'netlify,' a cloud provider that supports auto-build. The data is obtained from Firebase and displayed to the user by the web app. To get the data, a GET request will request the API endpoint to check if the user can get the data or not. Upon entering the correct username and password, the app dashboard will open. However, this authentication feature has not been seen in the existing works (Raju et al., 2019; Wasoontarajaroen et al., 2017; Vishwakarma et al., 2019; Rajarajeswari et al., 2021; Chandramoha et al., 2017; Kodali & Yerroju, 2018). The authentication page in both IOS and Android smartphones is displayed in Figure 10.

Figure 10 Web app authentication page in IOS and Android

        Figure 11 depicts the app's user interface (UI) dashboard, which runs on iOS and Android devices. In the previous works, the app was only usable on Android devices (Raju et al., 2019; Wasoontarajaroen et al., 2017; Vishwakarma et al., 2019; Rajarajeswari et al., 2021; Chandramoha et al., 2017; Kodali & Yerroju, 2018). However, our web app is cross-platform and can be accessed from any device that supports web browsing, which is advantageous for users. This app includes a toggle switch for auto/manual switching and a real-time motion, temperature, and light intensity display function. The device was tested rigorously for an ample amount of time. The test results confirmed that the device functioned well and could control electrical appliances automatically or manually via the web app.

Figure 11 Web app UI on IOS and Android device

        As shown in Figure 12, the web app successfully collected electrical energy data and displayed daily and monthly costs, including cost savings, on the app's dashboard. This is the most significant feature that most current research lacks (Raju et al., 2019; Vishwakarma et al., 2019; Rajarajeswari et al., 2021; Chandramoha et al., 2017; Kodali & Yerroju, 2018; Sindhanaiselvi et al., 2018; Priya & Kannammal, 2021; Simeon et al., 2018; Twumasi et al., 2017; Alimi & Ouahada, 2018; Umair & Shah, 2020). Because of this functionality, this hardware prototype becomes a complete package for consumers, allowing them to control their household appliances and monitor their energy consumption via this web app. Thus, it can be a huge benefit to them.

Figure 12 Daily and monthly costs displayed on the app

This application dashboard mainly displays sensor data retrieved from the NodeMCU ESP8266. The dashboard displays the real-time motion, temperature, and light intensity. The appliance's real-time voltage, current, power, and frequency data are also presented here. The energy data is cumulative and is displayed on a daily basis, with a daily cost representation. For cost computation, the per unit rate is assumed to be RM 0.22. The total monthly power use cost is presented on the dashboard towards the end of the month. The cost saving is calculated by subtracting the current monthly cost from the previous. This app only keeps track of the last and current months. When the current month’s days increase, so does the current monthly cost. Hence, the cost savings vary depending on the variable cost of the current month. Therefore, the final cost saving can be seen at the end of the current month.

Conclusion

In summary, this project aims to design and build an energy-saving home automation system. The study began with an accurate literature review and an initial investigation into the energy-efficient home automation system. In the second phase, a fully functional home automation system was built to reduce energy consumption with the assistance of IoT technology and intelligent sensors such as a PIR motion sensor, LDR sensor, temperature sensor, and energy sensor. Based on the readings of the sensors, the relays take action for switching on or off the appliances. For instance, if the motion value is high and the LDR value is low, then the room light will switch on automatically. In the third phase, All the captured data has been stored in the Firebase real-time database and Firestore. Using the ‘netlify’ cloud provider, a web application was developed which fetches the data from Firebase and shows it to the user via the app dashboard. Finally, the system was integrated with a web application that allows users to monitor their home appliances' daily and monthly energy consumption, human presence, room temperature, ambient light as well as control them manually or automatically as shown in the results.

Acknowledgement

    The authors would like to acknowledge the support of the Multimedia University IR Fund 2020/16310, Project "Reliable and Resilient Internet-of-Things (IoT) Networks.”

Supplementary Material
FilenameDescription
EECE-5930-20220826133616.pdf My review response. Kindly review my comments and let me know what is needful.
References

Components101, 2020. 5V Single-Channel Relay Module. Components101. Available online at https://components101.com/switches/5v-single-channel-relay-module-pinout-features-applications-working-datasheet, Accessed on July 30, 2022

Alimi, O.A., Ouahada, K., 2018. Smart Home Appliances Scheduling to Manage Energy Usage. In: 2018 IEEE 7th International Conference on Adaptive Science & Technology (ICAST)

Arshad, A., 2020. DS18B20 Temperature Sensor. Circuits DIY. Available online at https://www.circuits-diy.com/ds18b20-temperature-sensor-2/, Accessed on July 30, 2022

Chandramoha, J., Nagarajan, R., Satheeshkumar, K., Ajithkumar, N., Gopinath, P.A., Ranjithkumar, S., 2017. Intelligent Smart Home Automation and Security System Using Arduino and Wi-fi. International Journal of Engineering and Computer Science, Volume 6 Issue 3, pp. 20694-20698

Manuals+, 2021. AC Communication Module PZEM-004T V3.0 User Manual. Available online at https://manuals.plus/innovatorsguru/ac-communication-module-pzem-004t-v3-0-manual, Accessed on July 30, 2022

Espressif, n.d. ESP8266 Wi-Fi Modules I Espressif. Espressif. Available online at https://www.espressif.com/en/products/modules/esp8266, Accessed on July 30, 2022

Components101, 2021. HC-SR501 PIR Sensor. Components101. Available online at https://components101.com/sensors/hc-sr501-pir-sensor, Accessed on July 30, 2022

Kodali, R.K., Yerroju, S., 2018. Energy Efficient Home Automation Using IoT. In: International Conference on Communication, Computing, and Internet of Things

Pieters, S., n.d. ESP8266 – NodeMCU PinOut. Available online at https://www.studiopieters.nl/esp8266-nodemcu-pinout/, Accessed on July 30, 2022

Priya, M.B., Kannammal, K., 2021. Intelligent Home Energy Management System with Load Scheduling and Remote Monitoring Using IoT. In: International Conference on Computer Communication and Informatics

Rajarajeswari, S., Rani, S.U., Kataria, A., Dutta, S., 2021. Home Automation through Smart Lighting, Smart Security, and other Appliances. In:  International Conference on Innovative Technology for Sustainable Development

Raju, K.L., Chandrani, V., Begum, S.S., Devi, M.P., 2019. Home Automation and Security System with Node MCU using Internet of Things. In: International Conference on Vision Towards Emerging Trends in Communication and Networking

Simeon, M., Elizabeth, A., Wara, S.T., Adoghe, A., Hope, O., 2018. Efficient Energy Management System Using Pir Sensor. In: IEEE PES/IAS PowerAfrica

Sindhanaiselvi, D., Keerthikaa, S., Shanmuganantham, T., 2018. Energy Efficient Modern Home Using Smart Boards for IoT Energy Automation. In:  International Conference on Circuits and Systems in Digital Enterprise Technology

Storr, W., 2018. Light Sensor including Photocell and LDR Sensor. Basic Electronics Tutorials. Available online at https://www.electronics-tutorials.ws/io/io_4.html, Accessed on July 30, 2022

Twumasi, C., Dotche, K.A., Banuenumah, W., Sekyere, F., 2017. Energy saving system using a PIR sensor for classroom monitoring. In: IEEE PES PowerAfrica

Umair, M., Shah, G.A., 2020. Energy Management of Smart Homes. In: IEEE International Conference on Smart Computing (SMARTCOMP)

Vasicek, D., Jalowiczor, J., Sevcik, L., Voznak, M., 2018. IoT Smart Home Concept. In: 26th Telecommunications Forum (TELFOR)

Vishwakarma, S.K., Upadhyaya, P., Kumari, B., Mishra, A.K.,2019). Smart Energy Efficient Home Automation System Using IoT. In: 4th International Conference on Internet of Things: Smart Innovation and Usages (IoT-SIU)

Wasoontarajaroen, S., Pawasan, K., Chamnanphrai, V., 2017. Development of an IoT device for monitoring electrical energy consumption. In: 9th International Conference on Information Technology and Electrical Engineering