Development of Home Energy Management Scheme for a Smart Grid Community

The steady increase in energy demand for residential consumers requires an efficient energy management scheme. Utility organizations encourage household applicants to engage in residential energy management (REM) system. The utility’s primary goal is to reduce system peak load demand while consumer intends to reduce electricity bills. The benefits of REM can be enhanced with renewable energy sources (RESs), backup battery storage system (BBSS), and optimal power-sharing strategies. This paper aims to reduce energy usages and monetary cost for smart grid communities with an efficient home energy management scheme (HEMS). Normally, the residential consumer deals with numerous smart home appliances that have various operating time priorities depending on consumer preferences. In this paper, a cost-efficient power-sharing technique is developed which works based on priorities of appliances’ operating time. The home appliances are sorted on priority basis and the BBSS are charged and discharged based on the energy availability within the smart grid communities and real time energy pricing. The benefits of optimal power-sharing techniques with the RESs and BBSS are analyzed by taking three different scenarios which are simulated by C++ software package. Extensive case studies are carried out to validate the effectiveness of the proposed energy management scheme. It is demonstrated that the proposed method can save energy and reduce electricity cost up to 35% and 45% compared to the existing methods.


Introduction
Energy, a scare resource that needs to be efficiently utilized, is considered the most indispensable component in modern society. For a typical home, energy losses are generally higher due to line losses increased by a factor of double [1]. These energy losses can be minimized by developing an efficient home energy management scheme (HEMS) that plays a crucial role in our daily life due to increasing energy demand [2]. The minimization of energy cost and the maximization of user comfort are the typical optimization problems in recent smart homes [3,4]. The authors in research [5] illustrate an aggregator based household energy scheduling plan in the smart grid framework where all home appliances are managed by different power scheduling schemes. However, the backup battery storage system (BBSS) is not considered in that research. Electricity consumers are not permitted to access the grid side mechanisms due to the high voltage grid and sophisticated device operation. They can manipulate on energy consumption to minimize the peak demand while reducing electricity bills [6,7]. To decrease electricity costs of residential users (RUs), it is important to maintain an energy scheduling plan for electrical appliances concerning the price of the respective time slot. The energy management of home appliances deals with utility tariffs and usages patterns [8]. Conversely, the smart home energy management scheme within the smart grid environment can integrate the alternative sources of energy and optimize the monetary cost [9]. Authors in research [10] illustrate the impact of the change in users' behavior in the smart grids framework. The smart consumption and production behaviors are analyzed in this study to assist smart grid diffusion. The energy management is highly dependent on demand response in a smart grid framework which is illustrated by evolutionary analysis in [11].
Residential utility management systems have been developed and validated through simulations and several case studies [12,13]. However, they did not consider the satisfied power demand and power-sharing algorithm to effectively handle the residential consumer's power demand. Researchers have taken some initiatives to manage a range of household appliances based on energy demand pattern. Most of the literature is related to minimizing the energy cost with carbon emissions and the impact of renewable energy integration in the smart grid [14]. A real-time energy management problem was solved using a modified particle swarm optimization to investigate the nominal battery state of a microgrid environment while minimizing operating charge. This work was extended to consider the degradation cost of the battery for a two-step ahead energy management scheme [4]. In [4], the authors demonstrated battery degradation costs which solely depends on a day-ahead energy scheduling and on a charging-discharging patterns. The optimization problem is solved using a framework consisting of Rainflow algorithm, particle swarm optimization (PSO), and scenario techniques. However, in these papers, the power-sharing algorithm and backup battery storage system are not taken into account. The authors of [15,16] provided a compact assessment of home energy management systems (HEMS). They explained the initial challenges of HEMS and then outlined some insights on the existing literature regarding the modeling of demand-side management (DSM) followed by wireless communication infrastructure. An optimization technique is developed through several programming strategies to handle home appliances with a solar system installed at the premises [17]. However, the impacts of different load patterns such as peak, off-peak and, mid-peak loads on renewable energy and BBSS are not considered. A fuzzy logic-based home energy management system (HEMS) is developed by the authors in [18] which is more effective compared to [19,20] but the lowering of energy cost by applying power-sharing algorithm is not taken into account. The home batteries, monitoring technologies, and smart heat pumps are analyzed in a smart grid architecture to show how the householders participate in HEM [21].
While several works deal with the advanced methods, these methods are not typically adopted by industry due to the reliability and security issues of a power system. Therefore, in order to minimize energy consumption and cost for residential consumers, this research develops an efficient energy management scheme using commercial software, C++, considering RESs and a BBSS integrated for smart grid model. The proposed HEMS offers higher customer satisfaction with low energy costs compared to the existing method.
The contributions of this paper can be listed as follows: • A computationally efficient simulation model for HEM is developed using the C++ software package. • The proposed model enables a power-sharing strategy in a community being assessed sequentially.

•
The power-sharing technique with the proposed model saves energy cost up to 35% and 45% compared to conventional techniques.

•
Mathematical modelling is developed to facilitate extensive analysis. The rest of the paper is organized as follows: Section 2 discusses the problem description, existing power management system, and smart grid architecture including advanced smart metering infrastructure. Section 3 explains the system model, including a solar generator, wind generator, energy storage systems, loads and utility grid. Mathematical modeling of a smart home and the proposed algorithms are also presented in the section. Analysis of the results and graphical representation of simulation results are elaborated in Section 4. Finally, the conclusion this research is depicted in Section 5.

Problem Description
In this section, the proposed smart grid architecture and its advanced features with the application of intelligent smart metering infrastructure in the smart grid framework are presented in this section.

Smart Grid Architecture
The rapid growth in household appliances has significantly increased the power demand of residential consumers. Nowadays, most electricity demand is met by fossil fuel-based generation system which heavily pollutes the environment by emitting greenhouse gas [22,23]. According to the international standards, each country must put a cap on the carbon emission to save the environment. Thus, researchers are working hard to figure out the new means of electricity generation. In this research, the renewable energy sources (RESs) integration is found to be one of the most costs effective and environment-friendly solutions [22,24]. Normally, residential loads consist of washing machine, freezer, fans, lights, laptops, television, heater, dishwasher, microwave woven, and so on. Most of the residential consumers suffer from load shading, unstable voltage levels, service line loss, higher utility tariff, unscheduled system maintenance, and so on. To overcome these limitations, it is important to build an effective energy optimization method. To address these issues, a smart grid architecture is proposed with an efficient home energy management scheme (HEMS) to provide a profitable and sustainable solution.
The proposed community-based smart grid architecture illustrated in Figure 1, consists of three different scenarios considering local utility supply, renewable energy sources (RESs) such as solar cell and windmill and backup battery storage system (BBSS). It has three different energy communities such as community A, B, and C. To identify residential consumer effectively these communities are considered. Moreover, we have considered three scenarios where scenario 1 considers a residence with local utility supply as the primary source of energy whereas scenario 2 considers renewable energy as the primary source of energy and local utility supply as the secondary source. Besides, scenario 3 uses renewable energy and backup battery storage system (BBSS) as a primary source and local utility as secondary source in case of scarcity. When any particular consumer request power and met by the energy community is called satisfied power demand. In a day, during any particular period if any user requests power to the community and receives sufficient power called satisfied power demand. An efficient power-sharing algorithm is developed to meet user power demand using battery power sharing among the community. The novelty of this research is power-sharing technique for the residential consumers within the community [25].
A backup battery storage system (BBSS) bank is used to tackle emergency cases while all other power supplies are off. The BBSS charging and discharing are performed based on real-time pricing in order to reduce daily operation cost. Each residence has local utility supply, solar and wind power generation, smart battery, and smart meter. The smart meters are connected with all smart home appliances via a wireless connection. The use of smart meters (SM) in smart grid facilitates to record the exchange of information between utility companies, and electricity consumption. Home appliance usages are managed by scheduling and switching on/off some of them and track consumption over a period [26]. A smart home provides an excellent interface between household applicants and home appliances to keep energy use record and take essential and effective decisions [27]. All home appliances are connected via smart meters and permit a consumer to move energy use from peakhours to mid-peak or off-peak hours [28]. It is capable of detecting the energy use charges in realtime by taking some electrical parameters.
The advanced smart metering architecture in the smart grid framework outlined in Figure 2 consists of metering and communication infrastructures. The SM unit includes time-of-use price monitoring, demand-side management, and automatic meter reading. A smart home provides an excellent interface between household applicants and home appliances to keep energy use record and take essential and effective decisions [27]. All home appliances are connected via smart meters and permit a consumer to move energy use from peak-hours to mid-peak or off-peak hours [28]. It is capable of detecting the energy use charges in real-time by taking some electrical parameters.
The advanced smart metering architecture in the smart grid framework outlined in Figure 2 consists of metering and communication infrastructures. The SM unit includes time-of-use price monitoring, demand-side management, and automatic meter reading.  The wireless communication technologies permit dual flow to enable the smart meter. Thus, smart meter permits exchange information with distant centers and to execute the control instructions. Multiple home appliances are connection with the smart meter in the residential premises by the aid of home area network (HAN). Wireless technologies such as ZigBee, Wi-Fi, and WiMAX [29,30] are effectively used in the smart grid environment. The benefits of advanced smart metering infrastructure are outlined below: • Time-of-use pricing information can acquire from the distant consumer price indications.

•
Customer's energy use information can accumulate, store and notify any particular time intervals or real-time.

•
A detailed load patterns can develop the energy management process effectively. • Smart meter can locate and identify the outages of any particular consumer by sharing a control message throughout the entire energy community.

•
Power circuit can open or close over a long distance.

•
Feasible to identify line losses and stealing exposure.
These meters send and receive information from the power data aggregator unit (PDAU) and permit residential consumers to handle their household appliances distantly. SMs of those communities are designed in such a way that allows them to be monitored by PDAU. If any users have extra demand, the smart meter sends a demand message to PDAU. After receiving the message, PDAU executes a power-sharing algorithm (PSA) to sequentially fulfill the user demand. Frist, PDAU forwards a demand message in the whole community. If the neighbor user can meet the extra demand, PDAU channels the excess stored energy of neighbors to the desired user. If demand cannot be fulfilled by neighbor users within the community, power will be acquired from the local utility companies. Moreover, if all power suppliers are unable to provide power then if any other user who wishes to receive power can take from BBSS by the permission of PDAU. PDAU is the main controller of this infrastructure. The BBSS keeps charging through the charge controller via a local utility supply while energy charges at low price intervals. Besides, BBSS can discharge when the community consumer energy demand is increased or all other supplies are off. To implement this framework, a simulator is designed and developed to evaluate the home user power consumption and cost considering satisfied power demand (hourly & daily basis) for one week. This method can save a significant amount of energy and cost compared to the existing systems.

System Modeling
This section deals with system components such as solar and wind generator, energy storage system, loads and utility grid, and a typical energy consumption profile for residential consumer's and home appliances considering peak-load, mid-peak, and off-peak loads and real-time electricity prices. The wireless communication technologies permit dual flow to enable the smart meter. Thus, smart meter permits exchange information with distant centers and to execute the control instructions. Multiple home appliances are connection with the smart meter in the residential premises by the aid of home area network (HAN). Wireless technologies such as ZigBee, Wi-Fi, and WiMAX [29,30] are effectively used in the smart grid environment. The benefits of advanced smart metering infrastructure are outlined below: • Time-of-use pricing information can acquire from the distant consumer price indications.

•
Customer's energy use information can accumulate, store and notify any particular time intervals or real-time.

•
A detailed load patterns can develop the energy management process effectively. • Smart meter can locate and identify the outages of any particular consumer by sharing a control message throughout the entire energy community.

•
Power circuit can open or close over a long distance.

•
Feasible to identify line losses and stealing exposure.
These meters send and receive information from the power data aggregator unit (PDAU) and permit residential consumers to handle their household appliances distantly. SMs of those communities are designed in such a way that allows them to be monitored by PDAU. If any users have extra demand, the smart meter sends a demand message to PDAU. After receiving the message, PDAU executes a power-sharing algorithm (PSA) to sequentially fulfill the user demand. Frist, PDAU forwards a demand message in the whole community. If the neighbor user can meet the extra demand, PDAU channels the excess stored energy of neighbors to the desired user. If demand cannot be fulfilled by neighbor users within the community, power will be acquired from the local utility companies. Moreover, if all power suppliers are unable to provide power then if any other user who wishes to receive power can take from BBSS by the permission of PDAU. PDAU is the main controller of this infrastructure. The BBSS keeps charging through the charge controller via a local utility supply while energy charges at low price intervals. Besides, BBSS can discharge when the community consumer energy demand is increased or all other supplies are off. To implement this framework, a simulator is designed and developed to evaluate the home user power consumption and cost considering satisfied power demand (hourly & daily basis) for one week. This method can save a significant amount of energy and cost compared to the existing systems.

System Modeling
This section deals with system components such as solar and wind generator, energy storage system, loads and utility grid, and a typical energy consumption profile for residential consumer's and home appliances considering peak-load, mid-peak, and off-peak loads and real-time electricity prices.

Solar Generator
Photovoltaic (PV) panels use sunlight to convert solar energy into usable DC electricity. The amount of PV power generated depends on the array size, solar radiance and solar insolation. Solar radiance is emphatically relying on surrounding climate and varies significantly as depicted in Figure 3. In order to gain maximum yield, PV panels are equipped with maximum power point tracking (MPPT) technology [31]. The performance of a PV system is assessed based on its output power. Output power depends on the size of the array and the overall efficiency of the installed PV system. PV power output as a function of solar irradiance and being operated at MPPT mode is defined using the following equation: Photovoltaic (PV) panels use sunlight to convert solar energy into usable DC electricity. The amount of PV power generated depends on the array size, solar radiance and solar insolation. Solar radiance is emphatically relying on surrounding climate and varies significantly as depicted in Figure  3. In order to gain maximum yield, PV panels are equipped with maximum power point tracking (MPPT) technology [31]. The performance of a PV system is assessed based on its output power. Output power depends on the size of the array and the overall efficiency of the installed PV system. PV power output as a function of solar irradiance and being operated at MPPT mode is defined using the following equation: In Equation (1) above, ղ represents efficiency, and A is the PV panel area. SI is the solar irradiation, t0 is the air temperature, is the temperature coefficient of the maximum output power and is usually denoted as a negative percentage per °C or K. The PV technology and manufacturing parameters have great impact on , this study considers as −0.005/°C. The range of for silicon cells is between 0.004-0.006 per °C [32]. The expression of power for several solar PV panels is given below: where Ns is the number of solar generators.

Wind Generator
Wind power is a vital renewable energy resource that continues to thrive around the world due to features such as abundance, clean nature and being readily available. It is the method of power generation by rotating turbine blades installed at an elevated height. However, power generated from wind turbines is highly intermittent and stochastic in nature. It is highly dependent on the available wind speed and significantly varies based on the installation height. Figure 4 below illustrates wind speed over a range of time. The following power-law equation is used to convert wind speed recorded by anemometer (installed at tower heights) and transfer them based on hub heights [33]:  In Equation (1) above, ï s represents efficiency, and A is the PV panel area. SI is the solar irradiation, t 0 is the air temperature, γ is the temperature coefficient of the maximum output power and is usually denoted as a negative percentage per • C or K. The PV technology and manufacturing parameters have great impact on γ, this study considers γ as −0.005/ • C. The range of γ for silicon cells is between 0.004-0.006 per • C [32]. The expression of power for several solar PV panels is given below: where N s is the number of solar generators.

Wind Generator
Wind power is a vital renewable energy resource that continues to thrive around the world due to features such as abundance, clean nature and being readily available. It is the method of power generation by rotating turbine blades installed at an elevated height. However, power generated from wind turbines is highly intermittent and stochastic in nature. It is highly dependent on the available wind speed and significantly varies based on the installation height. Figure 4 below illustrates wind speed over a range of time. The following power-law equation is used to convert wind speed recorded by anemometer (installed at tower heights) and transfer them based on hub heights [33]: Energies 2020, 13, 4288 where velocity at hub height h 0 is v 0 , velocity at hub height h is v, and the power-law exponent, α, depends on several parameters as presented in [34] which takes a value of 1/7 for open space. The wind turbine power as a function wind velocity can be represented as a piece-wise function below [35]: where the rated power is P r , the wind rated speed is v r , the cut-in wind speed is v c , and the cut-off wind speed is v f . Turbine manufacturers define a cut-in and cut-off speed for safety issues. The wind generator does not produce any power beyond the cut-off wind speed. The expression of total power for a number of wind turbines is given below [36]: where N w is the number of wind generators.
Energies 2020, 13, x FOR PEER REVIEW 7 of 24 where velocity at hub height h0 is v0, velocity at hub height h is v, and the power-law exponent, α, depends on several parameters as presented in [34] which takes a value of 1/7 for open space. The wind turbine power as a function wind velocity can be represented as a piece-wise function below [35]: where the rated power is Pr, the wind rated speed is vr, the cut-in wind speed is vc, and the cut-off wind speed is vf. Turbine manufacturers define a cut-in and cut-off speed for safety issues. The wind generator does not produce any power beyond the cut-off wind speed. The expression of total power for a number of wind turbines is given below [36]: where Nw is the number of wind generators.

Backup Battery Storage Systems (BBSS)
The different types of energy storages, such as superconducting magnetic energy storage, batteries, flywheel energy storage, and compressed air energy storage, are studied in power system. Each of the energy storage devices has different features such as high-power density, high-energy density, high response time and so on. In this study, electrochemical batteries are used due to its high energy density. The charging and discharging of ESS can reduce the effect of the unpredictable nature of renewable energy sources (RESs) on the smart grid to balance power generation and demand. The expression for charging and discharging of battery is given as below" Subject to the following constraints:

Backup Battery Storage Systems (BBSS)
The different types of energy storages, such as superconducting magnetic energy storage, batteries, flywheel energy storage, and compressed air energy storage, are studied in power system. Each of the energy storage devices has different features such as high-power density, high-energy density, high response time and so on. In this study, electrochemical batteries are used due to its high energy density. The charging and discharging of ESS can reduce the effect of the unpredictable nature of renewable energy sources (RESs) on the smart grid to balance power generation and demand. The expression for charging and discharging of battery is given as below" Subject to the following constraints: where the battery charging power at time t is P c (t), the battery discharging power at time t and P d (t), the energy storage at time t is BL(t), the time interval is ∆t, the charging efficiency is ï c , and the discharging efficiency is ï d . This study considers ï c and ï d as unity for simplicity.

Loads and Utility Grid
The load profiles of residential users are illustrated in Figures 5-7. There are three different load patterns shown in separate figures. The maximum load is approximately 0.43 kW during peak-hours, the mid-peak hour is 0.42 kW during intermediate-hours and the minimum load is 0.32 kW during off-peak hours.

BLmax > BL(t) > BLmin
where the battery charging power at time t is Pc(t), the battery discharging power at time t and Pd(t), the energy storage at time t is BL(t), the time interval is Δt, the charging efficiency is ղc, and the discharging efficiency is ղd. This study considers ղc and ղd as unity for simplicity.

Loads and Utility Grid
The load profiles of residential users are illustrated in Figures 5-7. There are three different load patterns shown in separate figures. The maximum load is approximately 0.43 kW during peak-hours, the mid-peak hour is 0.42 kW during intermediate-hours and the minimum load is 0.32 kW during off-peak hours. The estimated loads can meet the primary home appliances such as washing machine, freezer, fans, lights, laptops, television, heater, dishwasher, microwave woven etc. Home user energy demand patterns are fluctuating with time. It is assumed that the energy demand profiles are same for all residential consumers. Several measurements output values can shape the diverse energy demands for individual consumer.    The estimated loads can meet the primary home appliances such as washing machine, freezer, fans, lights, laptops, television, heater, dishwasher, microwave woven etc. Home user energy demand patterns are fluctuating with time. It is assumed that the energy demand profiles are same for all residential consumers. Several measurements output values can shape the diverse energy demands for individual consumer. Figure 8 indicates the real-time electricity prices for energy purchase per unit that is taken as a grid model in this study. These dynamic prices help electricity customers to schedule flexible loads, such as water heaters and washing machines. Electricity prices are generally announced an hour ahead from a distribution management company. We have considered a community smart grid that is connected to the grid.
Energies 2020, 13, x FOR PEER REVIEW 10 of 24 ahead from a distribution management company. We have considered a community smart grid that is connected to the grid. We have considered that the project is executed in an environment where building renewable energy plant is encouraged by the local government and the generated power can exchange to the utility grid without any transfer threshold. This process is due to insufficient power production, leading to low voltage outlines in the smart grid energy community. As a result, renewable energy owner can add more money on their utility business to help community inhabitants as well as to get profits. We have considered that the project is executed in an environment where building renewable energy plant is encouraged by the local government and the generated power can exchange to the utility grid without any transfer threshold. This process is due to insufficient power production, leading to low voltage outlines in the smart grid energy community. As a result, renewable energy owner can add more money on their utility business to help community inhabitants as well as to get profits.

Mathematical Modeling of a Smart Home for the Proposed Power-Sharing Algorithm
In this section, we analyze and model the electrical smart home appliances with renewable energy sources (RESs), backup battery storage system (BBSS), and related mathematical parameters in detail. The mathematical model contains different parts such as photo-voltaic system, small scale windmill, smart battery, backup battery storage system, utility tariffs, home appliances and their expenditure, etc. Renewable energy is generated by the solar cells and windmill that store in a smart battery. Total local renewable energy generation is formulated by the given equation: where P B is the battery power storage, P PV and P W denote the solar photovoltaic and wind power, respectively. The power generation by photovoltaic solar cell, P PV , and wind mill, P W , are directly stored in a smart battery which is outlined by P B . The total capacity of the battery is greater than sum of solar and wind power in order to save the battery from overcharge. A single residential consumer all smart home appliances energy consumption is defined by the given equation: where E THA denotes the total energy of home appliances, E L indicates lighting load, E WM illustrates washing machine, E R presents refrigerator load, E C denotes computer load, and E DW is the energy taken by dishwasher and E H is the heating load. All home users considered renewable energy as a primary source and utility as a secondary source.
where E U represents the user energy consumption, E B is the battery energy and E BB is the backup battery energy. Similarly, E THA indicates the total home appliance's energy of residential consumers. The user energy consumption is equal to the sum of battery and backup battery storage minus the total home appliances energy. Home users extra power demand is meet by the utility system and it is defined by the given Equation (11) and extra energy is formulated by the Equation (12).
E EE represents the extra energy, E UO is the energy of utility operator and E U is the user power. Similarly, E EEC defines the extra energy cost and E UC illustrates the utility cost. We have considered four user energy communities and the total energy consumption are calculated by the given equation: where n equals to 4 (the total number of user energy communities) and E TU represents the total user energy. We have considered a group of twenty home users in our proposed community smart grid and the total energy consumption in a community is given by the following equation: Energies 2020, 13, 4288 11 of 24 where E TUE represents the total user energy and E U denote the individual user energy. Total users energy cost in a community is carried out by the given equation: where E TUEC represents the total user energy cost and E U denote the individual user energy and E UC illustrates the individual user energy cost. The total number of hours in a day is given by the given equation which is 24 h.
where T equals to 24 due to 24 h in a day and H TNH represents the total number of hours and E H denote the hourly user energy consumption. Total energy consumption and cost for a week is shown in the given equation: where W equals to 7 and D TND represents the total number of day and E D denotes the daily user energy consumption. Total satisfied power demands are carried out by the given Equation (18) p TSPD = p SPD (18) where P TSPD denotes the total satisfied power demand and P SPD represents the satisfied power demand. However, the sum of individual satisfied power demand is equal to the total satisfied power demand.

The Proposed Algorithm and Simulations
In this section, we introduce the simulation framework and proposed a power-sharing algorithm. An advanced and efficient power-sharing algorithm is proposed which defines the step by step simulation execution process and priority basis energy management for residential consumers is placed in the Appendix A.
The Proposed Power-Sharing Algorithm (PSA) The real-time electricity prices are considered in the simulation process, allowing us to overcome the conventional optimization problems. To resolve these issues an efficient algorithm is designed called power-sharing algorithm (PSA). The PSA is used to optimize the new proposed communitybased smart grid model considering a backup battery storage system (BBSS) [37]. In this study PSA is also discussed to effectively share user battery power and backup energy storage within the community smart grid. The prime objective of the proposed algorithm is to minimize the energy cost with a high level of customer satisfaction. Residential consumers consume most of the energy to meet their smart home appliances. When smart battery and local utility are unable to support, a BBSS is connected with the power data aggregator unit (PDAU) to support the electricity supply. BBSS channels the energy to the respective user by the coordination of PDAU. All decisions including emergency case are made by PDAU. If the residential user (RU) energy consumption is greater than the battery capacity then battery needs to charge. At that time the user sends a demand message to the PDAU. Taking approval of PDAU, the user can receive shared energy from other user battery. Moreover, when all supplies are off, the requested user receives power from the BBSS service.

Simulation Results
The proposed energy management procedure and simulation results are outlined in this section to analyze and compare the effectiveness of the proposed HEM scheme. An on-grid tied smart grid framework is taken into account in this research. Sufficient PV solar and wind power generation reduce the utility tariffs. An efficient power-sharing algorithm (PSA) is developed to effectively manage residential consumer's smart battery power-sharing. We have also considered a backup battery storage system (BBSS) having a group of a battery bank to support residential consumers while all supply is off. The capacity of BBSS is selected as 30 kWh, and the minimum and maximum energy storage margins are taken as 5 kWh and 30 kWh, respectively.
The primary energy level of the BBSS is considered as 10 kWh. The smart grid constraints and the other input values are presented in Table 1. The input data are picked from real-time investigations. However, those are a bit scaled up or down due to precise application of this research. We have considered three smart grid scenarios, one existing and two proposed to compare the percentage of energy and cost savings. The simulation results are used to compare with the existing scenarios to show how the proposed scheme is better for reducing energy demand and cost significantly. It also evaluates the hourly and daily energy consumption and prices considering satisfied power demand to make the comparison effectively to propose an economic solution for residential consumers.

Case Study
Several case studies are carried out to presents the residential consumer's energy consumption patterns and compare due to get economic solutions. A group of 20 residential consumers is considered to have several smart grid communities to evaluate energy and cost through some case studies. Besides, we have considered three scenarios one existing and two proposed. In scenario-1, all residential consumers have power supply from local utility only whereas in scenario-2, all residential consumers have a power supply both from the local utility and RESs. Moreover, in scenario-3, all residential consumers have power supply from local utility, renewable energy and, backup battery storage system (BBSS). In this case, residential consumers considered a local utility as their primary source of energy. There is no renewable energy generator and energy storage system to support while power shortage. This approach is completely unable to manage economic issues and energy minimization due to the absence of RESs and backup battery storage systems (BBSS). All residence appliances receive energy from local utility and use as much as they require and after a certain time pay for the utility bills. Energy consumption and electricity cost management for three scenarios over 24-h time horizon is illustrated in Figure 9. In this research, we have considered scenario 1 as existing whereas scenario 2 is the proposed energy management scheme. Residential consumers have different load patterns such as peak-load, off-peak and mid-peak loads. The load profiles are presented in Figures 5-7. To optimize residential consumer's energy consumption and cost it is necessary to take some efficient initiatives and techniques.

•
Scenario 3: Residences with local utility support, RESs and BBSS.

Case I
In this case, residential consumers considered a local utility as their primary source of energy. There is no renewable energy generator and energy storage system to support while power shortage. This approach is completely unable to manage economic issues and energy minimization due to the absence of RESs and backup battery storage systems (BBSS). All residence appliances receive energy from local utility and use as much as they require and after a certain time pay for the utility bills. Energy consumption and electricity cost management for three scenarios over 24-h time horizon is illustrated in Figure 9. In this research, we have considered scenario 1 as existing whereas scenario 2 is the proposed energy management scheme. Residential consumers have different load patterns such as peak-load, off-peak and mid-peak loads. The load profiles are presented in Figures 5-7. To optimize residential consumer's energy consumption and cost it is necessary to take some efficient initiatives and techniques. Some effective strategies and RESs integration are taken in to account in the proposed scheme. From Figure 9 it is clear that the highest energy consumption is attained by scenario 1 and the lowest energy consumption is cut by scenario 3.

Case II
A typical power production using solar panel and wind turbine is considered that are figured in Figure 3 and Figure 4, respectively. The spasmodic power production from wind and solar generators is completely stochastic. Sometimes it is tough to meet residential consumer power demand due to unpredictable power generation. To overcome these issues a backup battery storage system (BBSS) is introduced in the smart grid environment. The comparison of proposed and existing energy and cost management over 24 h time horizon is presented in Figure 10 and the relationship of proposed and existing energy, and cost management for case II is tabulated in Table 2.  5 7 9 11 13 15 17 19 21 23 Electricity price (cents/kWh) Energy (kWh)

Scenario-2
Scenario-3 Scenario-1 Figure 9. Energy consumption and electricity cost management for three scenarios over 24 h time horizon.
Some effective strategies and RESs integration are taken in to account in the proposed scheme. From Figure 9 it is clear that the highest energy consumption is attained by scenario 1 and the lowest energy consumption is cut by scenario 3.

Case II
A typical power production using solar panel and wind turbine is considered that are figured in Figures 3 and 4, respectively. The spasmodic power production from wind and solar generators is completely stochastic. Sometimes it is tough to meet residential consumer power demand due to unpredictable power generation. To overcome these issues a backup battery storage system (BBSS) is introduced in the smart grid environment. The comparison of proposed and existing energy and cost management over 24 h time horizon is presented in Figure 10 and the relationship of proposed and existing energy, and cost management for case II is tabulated in Table 2.   The comparison between proposed 1 and existing energy and cost management scheme over 24-h time horizon is presented in Figure 10 and solar and wind power generation is presented in Figure 3 and Figure 4, respectively. Renewable energy generation is stored in a smart battery thus residence consumers can use and share battery power when they require. The electricity cost for this case study is 3.60 EUR, which is 35% less than the existing approach. It should be mention that the cost-saving is high due to the power purchasing from grid and RESs power generator. Moreover, during the peak hours, RESs generates the extra power than the exact demand and it is an extra reason behind the dramatic increase in profits.
Satisfied power demand: When residential consumers can not satisfy power demand by local utility supply then RESs can support power demand using an efficient power-sharing algorithm (PSA). Renewable energy generation is stored in a smart battery and residential consumers can use and share their battery power each other when they require. Figure 11 presents the satisfied power demand management between existing and proposed scenarios over 24 h time horizon. The comparison between proposed 1 and existing energy and cost management scheme over 24-h time horizon is presented in Figure 10 and solar and wind power generation is presented in Figures 3  and 4, respectively. Renewable energy generation is stored in a smart battery thus residence consumers can use and share battery power when they require. The electricity cost for this case study is 3.60 EUR, which is 35% less than the existing approach. It should be mention that the cost-saving is high due to the power purchasing from grid and RESs power generator. Moreover, during the peak hours, RESs generates the extra power than the exact demand and it is an extra reason behind the dramatic increase in profits.
Satisfied power demand: When residential consumers can not satisfy power demand by local utility supply then RESs can support power demand using an efficient power-sharing algorithm (PSA). Renewable energy generation is stored in a smart battery and residential consumers can use and share their battery power each other when they require. Figure 11 presents the satisfied power demand management between existing and proposed scenarios over 24 h time horizon. The comparison between proposed 1 and existing energy and cost management scheme over 24-h time horizon is presented in Figure 10 and solar and wind power generation is presented in Figure 3 and Figure 4, respectively. Renewable energy generation is stored in a smart battery thus residence consumers can use and share battery power when they require. The electricity cost for this case study is 3.60 EUR, which is 35% less than the existing approach. It should be mention that the cost-saving is high due to the power purchasing from grid and RESs power generator. Moreover, during the peak hours, RESs generates the extra power than the exact demand and it is an extra reason behind the dramatic increase in profits.

Scenarios Energy (kWh) Cost (EUR) % Saving
Satisfied power demand: When residential consumers can not satisfy power demand by local utility supply then RESs can support power demand using an efficient power-sharing algorithm (PSA). Renewable energy generation is stored in a smart battery and residential consumers can use and share their battery power each other when they require. Figure 11 presents the satisfied power demand management between existing and proposed scenarios over 24 h time horizon.  Figure 12 presents the satisfied power demand management between existing and proposed 1 scenario over 24 h time horizon. In the case of scenario 1, the total number of satisfied power demand is empty due to local utility supply only. However, scenario 2 has both local utility and renewable energy generation support, for this reason, it can satisfy 18% power demands and tabulated in Table 3. Figure 12 presents the satisfied power demand management between existing and proposed 1 scenario over 24 h time horizon. In the case of scenario 1, the total number of satisfied power demand is empty due to local utility supply only. However, scenario 2 has both local utility and renewable energy generation support, for this reason, it can satisfy 18% power demands and tabulated in Table 3.

Case III
To validating the efficiency of the offered method, the simulation procedure is executed to evaluate the daily energy and cost considering a backup battery storage system (BBSS) and power generation from RESs. The day with RESs power generation and BBSS is added to the simulation to notice the retort of the energy and cost minimization. Figure 13 presents the energy consumption and electricity cost management for three scenarios over 24 h time horizon. The electricity charge of the surviving method is 3.60 EUR with a day simulation period. 24-h simulation is observed in the proposed energy management approach where the BBSS is charged from the utility grid up to 30 kWh. Besides, during the high price hours of the electricity, BBSS fully discharged to fulfill the power demand. Again the BBSS consumed electricity for charging itself from the grid during the low price hours and touches the highest level of energy. A comparison between the offered approach and the existing ones is revealed in Table 4. The BBSS takes charge from the RESs and reaches the highest levels of energy in the subsequent time slots. The proposed 2 scenario can save energy and cost up to 45% compared to the existing method.  Table 3. Comparison of the proposed and existing satisfied power demand management for case-II.

Case III
To validating the efficiency of the offered method, the simulation procedure is executed to evaluate the daily energy and cost considering a backup battery storage system (BBSS) and power generation from RESs. The day with RESs power generation and BBSS is added to the simulation to notice the retort of the energy and cost minimization. Figure 13 presents the energy consumption and electricity cost management for three scenarios over 24 h time horizon. The electricity charge of the surviving method is 3.60 EUR with a day simulation period. 24-h simulation is observed in the proposed energy management approach where the BBSS is charged from the utility grid up to 30 kWh. Besides, during the high price hours of the electricity, BBSS fully discharged to fulfill the power demand. Again the BBSS consumed electricity for charging itself from the grid during the low price hours and touches the highest level of energy. A comparison between the offered approach and the existing ones is revealed in Table 4. The BBSS takes charge from the RESs and reaches the highest levels of energy in the subsequent time slots. The proposed 2 scenario can save energy and cost up to 45% compared to the existing method.
Satisfied power demand: When residential consumers can not satisfy power demand by local utility supply then an efficient power-sharing algorithm starts to satisfy user power demand using renewable energy sources and BBSS. Figure 14 presents the comparison of the satisfied power demand management between existing and proposed 2 scenarios over 24 h time horizon. In the case of the existing scenario, the total number of satisfied power demand is empty due to local utility supply only. However, the proposed 2 scenario has local utility, renewable energy generation, and BBSS support, for this reason, it can satisfy the highest numbers of power demands which are 22.5% and demonstrated in Table 5.  Satisfied power demand: When residential consumers can not satisfy power demand by local utility supply then an efficient power-sharing algorithm starts to satisfy user power demand using renewable energy sources and BBSS. Figure 14 presents the comparison of the satisfied power demand management between existing and proposed 2 scenarios over 24 h time horizon. In the case of the existing scenario, the total number of satisfied power demand is empty due to local utility supply only. However, the proposed 2 scenario has local utility, renewable energy generation, and BBSS support, for this reason, it can satisfy the highest numbers of power demands which are 22.5% and demonstrated in Table 5.   Table 4. Comparison of the proposed and existing energy, and cost management for case-III.

Scenarios Energy (kWh) Cost (EUR) % Saving
Existing 50 3.60 0 Proposed 2 42 3.00 45 Figure 13. Comparison between proposed-2 and existing scenario of energy and electricity cost management over 24 h time horizon. Table 4. Comparison of the proposed and existing energy, and cost management for case-III.

Scenarios Energy (kWh) Cost (EUR) % Saving
Existing 50 3.60 0 Proposed 2 42 3.00 45 Satisfied power demand: When residential consumers can not satisfy power demand by local utility supply then an efficient power-sharing algorithm starts to satisfy user power demand using renewable energy sources and BBSS. Figure 14 presents the comparison of the satisfied power demand management between existing and proposed 2 scenarios over 24 h time horizon. In the case of the existing scenario, the total number of satisfied power demand is empty due to local utility supply only. However, the proposed 2 scenario has local utility, renewable energy generation, and BBSS support, for this reason, it can satisfy the highest numbers of power demands which are 22.5% and demonstrated in Table 5.

Discussion
In this section, the overall energy and cost minimization for the residential consumers is outlined based on several case studies. Case I is completely unable to minimize energy and monetary cost due to the absence of an alternative sources of energy and BBSS. However, case II and case III can save a significant amount of energy and cost considering renewable energy, BBSS and satisfied power demand. Percentage of savings is tabulated in Table 6 to identify the most profitable case.

Discussion
In this section, the overall energy and cost minimization for the residential consumers is outlined based on several case studies. Case I is completely unable to minimize energy and monetary cost due to the absence of an alternative sources of energy and BBSS. However, case II and case III can save a significant amount of energy and cost considering renewable energy, BBSS and satisfied power demand. Percentage of savings is tabulated in Table 6 to identify the most profitable case.  Figure 15 presents the percentage of energy savings management within different case studies over 24 h time horizon. Case II can save 35% energy consumption whereas case III can save 45%. The pink line indicates the percentage of energy savings which is sharply increasing due to cost-effective energy management. On the other hand, Figure 16 illustrates the percentage of monetary cost savings management within different case studies over 24 h time horizon. Case II can save 35% energy cost whereas case III can save 45%. The pink line indicates the percentage of energy cost savings which is linearly increasing due to economic energy optimization. On the other hand, Figure 16 illustrates the percentage of monetary cost savings management within different case studies over 24 h time horizon. Case II can save 35% energy cost whereas case III can save 45%. The pink line indicates the percentage of energy cost savings which is linearly increasing due to economic energy optimization.
The comparison of average daily energy consumption and cost management within three different cases are tabulated in Table 7. From Figure 17 the daily energy consumption is the greatest in case I whereas in case II and case III is declining. Evaluating several case studies the overall energy and cost reduction is profitably accelerated in case II and case III due to considering RESs, BBSS, and PSA in the smart grid environment. To get dual supply opportunity we have considered an on-grid tied smart grid system. The comparison of average daily energy consumption and cost management within three different cases are tabulated in Table 7. From Figure 17 the daily energy consumption is the greatest in case I whereas in case II and case III is declining. Evaluating several case studies the overall energy and cost reduction is profitably accelerated in case II and case III due to considering RESs, BBSS, and PSA in the smart grid environment. To get dual supply opportunity we have considered an on-grid tied smart grid system.  In case any load shading due to system maintenance then RESs and BBSS can support a part of the energy community. Sometimes residential consumers cannot estimate load management properly due to unpredictable RESs generation. However, the outlined efficiency is not much due to   The comparison of average daily energy consumption and cost management within three different cases are tabulated in Table 7. From Figure 17 the daily energy consumption is the greatest in case I whereas in case II and case III is declining. Evaluating several case studies the overall energy and cost reduction is profitably accelerated in case II and case III due to considering RESs, BBSS, and PSA in the smart grid environment. To get dual supply opportunity we have considered an on-grid tied smart grid system.  In case any load shading due to system maintenance then RESs and BBSS can support a part of the energy community. Sometimes residential consumers cannot estimate load management properly due to unpredictable RESs generation. However, the outlined efficiency is not much due to In case any load shading due to system maintenance then RESs and BBSS can support a part of the energy community. Sometimes residential consumers cannot estimate load management properly due to unpredictable RESs generation. However, the outlined efficiency is not much due to RESs and BBSS limitations. A large BBSS and the best quality of RESs can significantly increase the percentage of energy and cost savings. However, the residential consumers may not be interested or effort the cost due to huge primary investment.
A comparison of energy consumption and cost for a single residential consumer in a day is illustrates in Figure 18 and Table 8 to get a basic idea regarding energy and respective cost within different scenarios. The highest energy consumption shows in scenario-1 whereas the lowest energy consumption is done by the scenario 3.
RESs and BBSS limitations. A large BBSS and the best quality of RESs can significantly increase the percentage of energy and cost savings. However, the residential consumers may not be interested or effort the cost due to huge primary investment.
A comparison of energy consumption and cost for a single residential consumer in a day is illustrates in Figure 18 and Table 8 to get a basic idea regarding energy and respective cost within different scenarios. The highest energy consumption shows in scenario-1 whereas the lowest energy consumption is done by the scenario 3. Figure 18. Comparison of the average daily energy consumption and cost management for a single user within three scenarios. A comparison of the proposed and existing satisfied power demands within different case studies are illustrated in Figure 19 and tabulated in Table 9. In Figure 19 the pink line indicates the percentages of satisfied power demand savings which are 18% and 22.5%, respectively. Case III has 4.5% more satisfied power demand savings than case II and 22.5% more savings than case I. The prescribed percentage of savings is not much and the amount can be accelerated with the aid of a large backup battery bank and RESs system. However, it requires large space and huge primary investment. For this reason, the residential consumers may not effort or interested to invest a large amount of economy. Moreover, the proposed model can be implemented effectively on a small scale micro-grid environment.  A comparison of the proposed and existing satisfied power demands within different case studies are illustrated in Figure 19 and tabulated in Table 9. In Figure 19 the pink line indicates the percentages of satisfied power demand savings which are 18% and 22.5%, respectively. Case III has 4.5% more satisfied power demand savings than case II and 22.5% more savings than case I. The prescribed percentage of savings is not much and the amount can be accelerated with the aid of a large backup battery bank and RESs system. However, it requires large space and huge primary investment. For this reason, the residential consumers may not effort or interested to invest a large amount of economy. Moreover, the proposed model can be implemented effectively on a small scale micro-grid environment.
Energies 2020, 13, x FOR PEER REVIEW 20 of 24 Figure 19. Percentage of satisfied power demand savings within cases I, II, and III over 24 h time horizon. Table 9. Comparison of the proposed and existing satisfied power demands within case-I, II and III.

Case Comparison
The vital concern of this research is the case comparison to understand and outline the most cost-effective solution to minimize energy and cost for the residential consumers. Case I consider fixed utility tariffs and a nominated kW demand thus the consumer cannot exceed the allocated energy demand which is set by the utility companies. For this reason, the consumer cannot avoid the peak load and higher utility tariffs. Case II demonstrated an idea to overcome these difficulties by installing RESs with a utility grid to compensate the peak load and higher utility costs. However, it is not always possible due to dependency on solar irradiation and wind velocity during cloudy weather and winter season. The compared amount is not much higher due to the moderate size of ESS. However, installing a large BBSS requires a big battery bank, leading greater energy costs which consumers may not effort.
Finally, case III has additional backup battery storage systems (BBSS) compared to case II to eliminate the mentioned difficulties which is presented in Figure 20. The BBSS is charged during low energy cost periods and discharges when peak loads and extra demand arise. We have taken into account the point of view that the initial investment for RESs and BBSS is cost-effective and sustainable. A depreciation cost is considered with RESs and BBSS to make the proposed model more realistic. Government and many energy providers encourage residential consumers by providing home loans for installing small scale renewable energy generators. This may be a flexible opportunity for low-income bracket individuals and mid-category consumers. The proposed model can be implemented effectively on a small scale micro-grid environment.

Conclusions
A home energy management scheme for smart grid community with renewable energy sources and backup battery storage system is developed in this paper for a group of residential consumers. The residential energy management (REM) problem with consumer's energy consumption, cost minimization, and satisfied power demand is modeled. The home appliances' priorities, energy availability and real-time energy pricing are considered in the proposed power-sharing technique. The offered model with the power-sharing technique is implemented in a practical system considering twenty residential consumers. The economic benefits of the proposed REM scheme with BESS are investigated with three different scenarios. The financial analysis of the proposed technique is conducted to show the monetary savings which is guaranteed in our proposed scheme. It is clear from the simulation results that the recommended scheme can save energy and costs by up to 35% and 45% compared to existing methods. Also, the results outline that the proposed method can save

Conclusions
A home energy management scheme for smart grid community with renewable energy sources and backup battery storage system is developed in this paper for a group of residential consumers. The residential energy management (REM) problem with consumer's energy consumption, cost minimization, and satisfied power demand is modeled. The home appliances' priorities, energy availability and real-time energy pricing are considered in the proposed power-sharing technique. The offered model with the power-sharing technique is implemented in a practical system considering twenty residential consumers. The economic benefits of the proposed REM scheme with BESS are investigated with three different scenarios. The financial analysis of the proposed technique is conducted to show the monetary savings which is guaranteed in our proposed scheme. It is clear from the simulation results that the recommended scheme can save energy and costs by up to 35% and 45% compared to existing methods. Also, the results outline that the proposed method can save satisfied power demands by up to 16% and 22.5% compared to the existing method. From overall analysis, the proposed REM model can enhance the benefits of the RESs and BBSS integration. Moreover, the simulation outcomes prove the potential benefits of the residential consumers and endorse the green effort to improve the sustainability and effectiveness of the power management infrastructure.