Artificial neural network-based home energy management system for smart homes

: Energy efficiency is widely recognized as one of the most significant and economical ways to lower greenhouse gas (GHG) emissions. The aims and goals are that smart meters can evaluate and communicate in-depth real-time electricity usage, enable remote real-time monitoring and management of power consumption, and provide consumers with real-time pricing and analyzed usage information. The house energy management controller decides which loads will be powered based on the real home energy demands and the predefined load priorities. Artificial intelligence (AI) is being used increasingly in control applications due to its great effectiveness and efficiency. As a result, in this work, the author designed, simulated, and optimized an artificial neural network-based model simulation framework that simulates a home with a variety of home appliances and optimizes the total energy consumption of the home realistically through intelligent control of home appliances. The MATLAB application was used to model and examine the performance of four common household appliances: the water heater (WH), washing machine (WM), air conditioner (AC), and refrigerator (RG). The result shows a considerable reduction and savings in energy consumption without a decrease in consumer comfort.


Introduction
Energy efficiency, which is defined as utilizing less energy for a given amount of output or even more, is widely recognized as one of the most significant and economical ways to lower greenhouse gas (GHG) emissions [1].Successful energy efficiency projects generally increase a company's total efficiency in addition to the environmental benefits, such as boosting productivity and competitiveness.The building sector is a key energy user worldwide, providing a large portion of overall energy production.As a result, energy efficiency must be managed with the goals of energy savings and reduced environmental impact [1,2].For managing the energyconsuming equipment in a facility, an energy management system (EMS) is a useful tool.A smart home energy management system (HEMS) has sensors that detect temperature, humidity, sunshine, energy, gas, and water.The smart HEMS center, equivalent to the brain, is the epicenter of the entire smart electricity home.It is the core of HEMS and implements smart energy management [3].The main functions of a smart HEMS center can therefore be defined as a home that guarantees energy management services for efficient monitoring and management of power generation, conservation, and storage designed within the smart home [4].HEMS can empower customers to improve energy usage and reduce electricity bills by switching OFF and ON power to devices to curtail their loads in response to electricity tariffs during peak periods without compromising customers' lifestyles and preferences [5].The tracking of electricity consumption at all points is automated with smart meter technology.They are more capable of collecting vast amounts of data than the manual energy meter reading system.Because many more variables are taken into consideration, this allows for the application of data analysis tools and the development of very credible consumption forecasts [6,7].It is also possible for various appliances in a home to run in the most efficient commercial way through different mathematical and heuristic optimization techniques within the HEMS center [8]. Figure 1 is the HEMS concept, showing the various inputs to the HEMS system to make a smart home.Specific structures of a smart HEMS center comprise five major functioning modules [4]: monitoring, which makes real-time information regarding energy usage patterns accessible.Logging collects, saves, and analyzes the demand response for real-time prices based on the data information about the unit of electricity consumed by each appliance.Control includes direct control by the HEMS or remote controls by the customers through various other systems and devices, e.g., personal computers (PCs) or smartphones.Management is one of the primary functions of HEMS, which improves both optimizations and efficiency in electrical power utilization within the smart home.Finally, alarms produced are passed on to the smart HEMS center, where information regarding fault locations, types, etc. is stored [3].The most dominant role considered for this research is the intelligent monitoring function, which is performed by the machine learning algorithm used in the monitoring module of the HEMS controller.The home energy management controller decides which loads will be powered based on the available photovoltaic (PV) generated, the real home energy demands, and the predefined load priorities [9].Artificial intelligence (AI) is being used increasingly in HEMS control applications due to its great effectiveness and efficiency in understanding the features and behavior of the loads and their preferences, which is crucial when designing a system for residential customers using a demand response (DR) approach.
Many authors have researched the HEMS, including authors [10][11][12][13][14].Only one of the solutions presented by Timilehin et al. [10] uses an artificial intelligence module in the HEMS, while others are deficient in this area.The authors conclude that a home energy management system should be combined with the home automation system that controls the rest of the house.The authors [11] further support the definition presented by Timilehin et al. [10], while Shahriar et al. [12] extend the definition by putting the research on HEMS into two categories, namely predictive energy management and real-time energy management.The authors also propose a system that utilizes machine learning to help limit energy waste and be eco-friendly.Molla et al. [8] present a complete study of various optimization techniques used in smart HEMS, such as ant colony, bee colony, binary linear programming scheme, particle swarm optimization, etc.Similar to the work of Molla et al. [8] is the work of Krishna et al. [15], where the energy management system is implemented using fuzzy logic.Kleiminger et al. [13] mentioned that motion sensors and cameras are used in households and buildings for monitoring occupancy, whereas motion sensors and smart meters are used for energy consumption metering.In the case of Koehler et al. [14], most users control their ambient temperature by manually controlling their thermostat; however, some households use programmable thermostats that follow a static schedule.Aliero et al. [16] present an analysis of a smart home energy management system with the strategies, techniques, and constraints used in current HEMS and various factors that affect its overall functionality and operation.According to Hou et al. [17], the smart HEM is an optimization problem with multidimensional variables and multiple constraints, where the variables include discrete and continuous ones.Generally, heuristic algorithms are often used to solve the above problem, as also enumerated by Molla et al. [8].Such heuristic algorithms include genetic algorithms [18], particle swarm optimization algorithms [19], the cuckoo search algorithm and strawberry algorithm [20], and the ant colony algorithm [21].When faced with multivariate problems, due to the poor efficiency, high complexity, and inaccuracy of heuristic algorithms, mixed integer linear programming (MILP) was used by Hou et al. [17] as an alternative method that can achieve the unique optimal solution rapidly and precisely.In the work of Akbarzadeh et al. [22], green computingenabled artificial intelligence (AI) algorithms were used to provide impactful solutions to the problem of environmental contamination in smart home energy management.The authors propose using one of the recurrent neural network (RNN) algorithms known as long short-term memory (LSTM) to comprehend how it is feasible to perform the cloud/fog/edge-enabled prediction of the building's energy.In the work of Gomes et al. [23], the paper presents a new HEMS with a mixed-integer linear programming (MILP)-based model predictive control (MPC) approach to home energy management systems.This approach allows the authors to obtain better results than an approach purely using MILP by having access to updated information at every moment.The results of a real-world case study show the superiority of MILP-based MPC over MILP and over experimental results.The authors of Nakıp et al. [24] propose an advanced ML algorithm called Recurrent Trend Predictive Neural Network-based Forecast Embedded Scheduling (rTPNN-FES) to provide efficient residential demand control.rTPNN-FES is a novel neural network architecture that simultaneously forecasts renewable energy generation and schedules household appliances.Through its embedded structure, rTPNN-FES eliminates the utilization of separate algorithms for forecasting and scheduling and generates a schedule that is robust against forecasting errors.
In this work, the author designed, simulated, and optimized an artificial neural network-based HEMS controller framework that can simulate a home with a variety of home appliances and optimize the total energy consumption of the home realistically through intelligent control of the home appliances.The primary contribution of this work is its attentiveness to the modeling of domestic appliances.This work proposes an artificial neural network-based HEMS controller to achieve power savings using DR events and scheduled operation of appliances at specific times following appliance priority and customer lifestyle.

Methodology
This work uses an artificial neural network (ANN) based on home energy control.The MATLAB application was used to model and examine the performance of four common household appliances: the water heater (WH), washing machine (WM), air conditioner (AC), and refrigerator (REF)  The four appliances are managed per client preferences and appliance priority.These household appliances were chosen for DR execution in residential buildings because they consumed more energy than other appliances and were used the most frequently.
HEMS architecture is shown in Figure 3, while Table 1 is the utility mapping to appliances.

Air condition
The mathematical expression of the AC load represented by  , which is used to find all AC operating parameters is formulated to determine the appropriate AC load model.The AC operating parameters are grouped into the temperature set points, the building structures, and the characteristics of the AC model.The input parameters for the ANN are the outside ambient temperature, the heat gain of the occupier, and the room temperature at time t.Table 2 shows the load characteristics for the air conditioner.

Water heater
Device characteristics and set point temperature are two categories and criteria of WH.The load features of the electric water heater at 4 kW of rated power and voltage of 220-230 Vac are shown in the table below.Table 3 shows the load characteristics for the water heater.

Washing machine and refrigerator
There are the vertical axis and horizontal axis types of the washing machine (WM), both of which work based on the induction motor principle.The refrigerator (REF) which uses the compressor is also based on the induction motor principle.The WM and REF are modeled using different approaches.In this work, a power quality analyzer was used to collect data which is used in the WM and REF models.The models were developed in a MATLAB environment using resistors and reactance.

Calculating power consumption by appliances
The formula for estimating energy consumption: Wattage × Hours used per day 1000 = Daily Kilowatt − hour (kWh) where 1 kilowatt (kW) = 1000 Watts.Daily Kilowatt-hour is multiplied by the number of days the appliance is used in a year to get the annual consumption in kWh per year.
Estimating annual cost to run an appliance: Multiply the annual consumption in kWh per year by the local utility's rate per kWh consumed to calculate the annual cost to run an appliance.To estimate the number of hours that a refrigerator operates at its maximum wattage, the total time the refrigerator is plugged "ON" is divided by three since it cycles on and off as needed to maintain interior temperatures and the compressor is "OFF" during the cycle off.

Wattage
The wattage of most appliances is stamped on the bottom or back of the appliance, or its nameplate.Alternatively, it can be estimated by finding the current drawn (in amperes) and multiplying that by the voltage used by the appliance.The power of various appliances in Watts is shown in Table 4.

Appliance priority and customer lifestyle
The proposed algorithm is designed to be able to swap customer load and control AC, WH, REF, and WM to reduce power consumption.The algorithm begins by examining all of the aforementioned appliances' data and information.As indicated in Table 3, each home appliance including the air conditioner, water heater, washing machine, and refrigerator is compared to several set points, including load priority, power consumption, and user preference for temperature settings as in Table 5.

Using ANN to design a demand response tool
The demand response technique of energy management creates optimal schedules for energy consumption by considering load profiles, cost of energy, level of comfort of the occupier, and environmental concerns.With the deployment of smart meters, it is possible to control the load by using a HEM system with demand response (DR) enabled appliances.In this research work, a neural network technique was developed to control the energy in the building with a DR strategy.It is used to reduce the peak demand load, reduce the electricity cost, and reduce the power consumption for the appliances while maintaining customer comfort.The electrical appliances such as air conditioning (AC), electric water heater (WH), washing machine (WM), and refrigerator (RF) were modeled using the MATLAB program.The ANN structure has six inputs, and four outputs as shown in Table 6, with the sigmoid activation function, and two hidden layers as well.70% of the data generated were allocated to training the model while 30% were allocated to testing the model.According to client preferences, comfort level, and appliance priority, the four household appliances are turned ON and OFF by the ANN controller's output of binary numbers.One neuron from the output layer represents the signal used to turn on or off each of the three groups of appliances following their predetermined order of importance [25].

Results and discussion
In other to use AI for HEMS, the customer has to define certain rules that control the energy management policy in the home.In this simulation, the two most energyconsuming appliances which are AC and Water heater are used to demonstrate how AI can be used for smart energy management.Table 7 below shows the customer's lifestyle preferences.The sample data used below was generated according to random data collected from IoT sensors and Binary sequence demoting when appliances are ON and OFF according to customer lifestyle.The model was trained with the Bayesian regularization algorithm.The need for extensive cross-validation can be decreased or eliminated with Bayesian regularized artificial neural networks (BRANNs), which are more resilient than traditional backpropagation nets.A mathematical technique known as Bayesian regularization turns a nonlinear regression into a "well-posed" statistical problem like a ridge regression.
The benefit of BRANNs is that the models are robust, eliminating the need for the validation step that scales as O(N2) in conventional regression techniques like backpropagation.Figure 4 shows the difference in training and testing mean squared error which decreases with each epoch as the network learns the data.

AC estimated energy consumption without and with ANN smart energy
Table 9 shows the AC consumption without ANN assuming the AC is always on and not controlled intelligently by the AI smart system.A total of 29 KWH was consumed by a 1.4 KW AC.Table 10 shows the AC consumption with ANN where the AC is ON/OFF controlled intelligently by the AI smart system.A total of 12.7 KWH was consumed by a 1.4 KW AC.This represents a 56.6% reduction in power consumption when compared to consumption without ANN.

WH estimated energy consumption without and with ANN smart energy
Table 11 shows the WH consumption without ANN and the AI smart system.A total of 93.33 KWH was consumed by a 4 KW WH.Table 12 shows the WH consumption with ANN with the WH controlled intelligently by the AI smart system.A total of 31.733KWH was consumed by a 4 KW WH.Compared to the no AI scenario, this is a 61% reduction in energy savings.

Summary of results
Table 13 shows the air conditioner and water heater energy consumption without ANN and with ANN, the cumulative energy consumption and the total energy with ANN are also shown to be more than 60% of total energy consumption thereby showing the efficiency of the ANN-based HEMS.The same analysis can be done for other appliances such as the washing machine, coffee machine, etc.The ANN model can be deployed in a scenario shown in Figure 6 where the smart controller can be used in a house thermal system.The continuous and uncontrolled usage of heating or cooling appliances will always increase energy consumption.The ANN model can control the switching of these appliances based on customer lifestyle as stated above.

Conclusion
The suggested model will automate the procedure for automatically switching between the most profitable energy source at a particular time and instance based on customer lifestyle.The results show that when the proposed framework is utilized, smart homes usual energy usage is reduced since they are OFF when not in use.The results show how much energy is used by household appliances in a single day.The system that was developed enables the use of smart intelligent ANN as a controller in a smart meter.Due to the not too clear ANN model's stability, we recommend extending the number of epochs used in the ANN to better evaluate the model's performance in a stable condition.
This study is expected to create new possibilities for IoT and big data platforms for smart energy management.The system architecture creates a smart EMS that can be used in the microprocessor of a smart meter.

Figure 2
shows the methodology block diagram.

Figure 2 .
Figure 2. The general methodology block diagram.

Figure 3 .
Figure 3.The utility connection with the intelligent house control.

Figure 5
Figure 5 shows a comprehensive representation and evidence obtained from training, validation, and testing phases where the calculated R values converge towards 1 meaning that the created network model almost exactly fits the problem.

3. 4 .
DeploymentThis model calculates heating costs for a generic house.Opening the model loads the information about the house from the sldemo_househeat_data.mfile.The file does the following:  Defines the house geometry (size, number of windows). Specifies the thermal properties of house materials. Calculates the thermal resistance of the house. Provides the heater characteristics (temperature of the hot air, flow rate). Defines the cost of electricity. Specifies the initial room temperature (20 ℃ = 68 ℉).

Figure 6 .
Figure 6.Practical deployment of ANN in a modelled home heating system.

Table 1 .
Utility mapping to appliances.

Table 2 .
The load characteristics of the air-conditioner.

Table 3 .
The load characteristics of the water heater.

Table 4 .
Typical wattage of various appliances.

Table 5 .
Appliances load and power rating characteristics.

Table 6 .
Description of the input layer and output layer.

Table 8
is a sample input training data set.

Table 8 .
Sample of input training dataset for water heater.

Table 9 .
AC consumption without ANN.

Table 10 .
AC Consumption with ANN.

Table 11 .
WH consumption without ANN.

Table 12 .
WH Consumption with ANN.

Table 13 .
Various appliances energy consumption and saving with ANN.