• 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

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

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


    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.