Next Article in Journal
Factors Affecting Perceived Effectiveness of Multigenerational Management Leadership and Metacognition among Service Industry Companies
Next Article in Special Issue
Power System Stability Improvement of FACTS Controller and PSS Design: A Time-Delay Approach
Previous Article in Journal
Research on the Evaluation of Coordinated Development of Tourism–Economy–Ecological Environment along the Silk Road Economic Belt
Previous Article in Special Issue
Converting Offshore Oil and Gas Infrastructures into Renewable Energy Generation Plants: An Economic and Technical Analysis of the Decommissioning Delay in the Brazilian Case
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Design and Implementation of a Real-Time Smart Home Management System Considering Energy Saving

by
Mahmoud H. Elkholy
1,2,*,
Tomonobu Senjyu
1,
Mohammed Elsayed Lotfy
1,2,
Abdelrahman Elgarhy
2,
Nehad S. Ali
2 and
Tamer S. Gaafar
3
1
Department of Electrical and Electronics Engineering, University of the Ryukyus, Okinawa 903-0213, Japan
2
Electrical Power and Machines, Faculty of Engineering, Zagazig University, Zagazig 44519, Egypt
3
Computer and Systems Department, Faculty of Engineering, Zagazig University, Zagazig 44519, Egypt
*
Author to whom correspondence should be addressed.
Sustainability 2022, 14(21), 13840; https://doi.org/10.3390/su142113840
Submission received: 6 September 2022 / Revised: 16 October 2022 / Accepted: 20 October 2022 / Published: 25 October 2022
(This article belongs to the Special Issue Advanced Renewable Energy for Sustainability)

Abstract

:
One of the most challenging problems related to the operation of smart microgrids is the optimal home energy management scheme with multiple and conflicting objectives. Moreover, there is a noticeable increase in homes equipped with renewable energy sources (RESs), where the coordination of loads and generation can achieve extra savings and minimize peak loads. In this paper, a solar-powered smart home with optimal energy management is designed in an affordable and secure manner, allowing the owner to control the home from remote and local sites using their smartphones and PCs. The Raspberry Pi 4 B is used as the brain of the proposed smart home automation management system (HAMS). It is used to collect the data from the existing sensors and store them, and then take the decision. The home is monitored using a graphical interface that monitors room temperature, humidity, smoke, and lighting through a set of sensors, as well as PIR sensors to monitor the people movement. This action enables remote control of all home appliances in a safe and emission-free manner. This target is reached using Cayenne, which is an IoT platform, in addition to building some codes related to some appliances and sensors not supported in Cayenne from scratch. Convenience for people with disabilities is considered by using the Amazon Echo Dot (Alexa) to control home appliances and the charging point by voice, implementing the associated code for connecting the Raspberry pi with Alexa from scratch, and simulating the system on LabVIEW. To reach the optimal operation and reduce the operating costs, an optimization framework for the home energy management system (HEMS) is proposed. The operating costs for the day amounted to approximately 16.039 €. There is a decrease in the operating costs by about 23.13%. The consumption decreased after using the smart HAMS by 18.161 kWh. The results of the optimization also show that the least area that can be used to install solar panels to produce the desired energy with the lowest cost is about 118.1039 m2, which is about 23.62% of the total surface area of the home in which the study was conducted. The obtained results prove the effectiveness of the proposed system in terms of automation, security, safety, and low operating costs.

1. Introduction

The great technological advances and revolutions in human activities and lifestyles will lead to the conversion of traditional residential buildings into smart buildings. The popularization of smart home technologies will help to bring more convenience and stability for consumers in the future. The amount of energy consumed in homes represents a large part of energy consumption in the world, since people spend most of their time at home [1]. Currently, automation systems greatly impact daily life and the global economy. The home automation system controls the entire home, as it can control the lighting, the atmosphere, and home appliances. These systems help in reducing the electricity bill by controlling the operating time of the devices, as most of the time consumers forget to turn off the devices and the devices stay working for long periods. Home Automation is becoming more popular due to the latest developments in hardware, which have significantly reduced the cost and improved the capabilities. It is because of the fact that the technology around us evolves and access to needed information is easier than ever [2].
A “Smart Home” is a part of the Internet of Things (IoT) paradigm. It allows objects and devices in a home to be connected to the internet, enabling users to remotely monitor and control them. It is currently used in various domains, such as smart homes and industrial environments, etc. Wireless sensor network technologies integrated into the IoT enable a global interconnection of smart devices with advanced functionalities [3]. Home Automation Protocols are the language that smart home devices use to communicate with each other. These protocols are classified into wired and wireless. Choosing a home automation protocol should have compatibilities such as Wi-Fi, Zigbee, x10, UPB, Z-Wave, KNX, and Loxone [4,5]. Smart home technology nowadays is found in a wide range of household devices, including lighting that can be dimmed to save energy, shutters, and blinds to protect homeowners from the sun and noise. These smart appliances are controlled via applications and voice assistance, such as Alexa, Siri, and Google assistance, that depend on artificial intelligence [6].
A HEMS is defined as a system that includes sensors within home devices, via home networks. The HEMS was developed with the purpose of controlling power utilization, improving the performance level of a smart grid, optimizing demands, and enabling devices for residential users, etc. Here, HEMSs play a vital role in modern energy meters, bringing an evolution in the form of low-consumption appliances [1,7,8]. Cayenne [9] is an IoT platform for developers, engineers, and students that can be used in different IoT applications. It makes the IoT development process easier and faster. It has cloud-based web applications, as well as mobile apps. It works on Raspberry Pi, Arduino, and a Lora device connected to the internet. The Cayenne platform has features such as a customized dashboard with drag and drop widgets, viewing data stored on devices, and remote control of IoT projects [10,11]. There are more home automation platforms to control IoT devices such as Home Assistant, OpenHab, and Domoticz [12,13]. RESs, such as solar power, wind power, and fuel cells, etc., should be used to meet the increasing energy demand. PV-based power sources are considered a cleaner form of energy generation; photovoltaic solar energy comes from the conversion of sunlight into electricity. PV system components consist of solar panels, batteries, inverters, charge controllers, and blocking diodes. PV systems are generally classified according to their functional and operational requirements. The two principal classifications are grid-connected systems and stand-alone systems [14,15,16]. PV systems can be designed to provide DC and/or AC power service. Electric vehicles have an electric motor and do not have a diesel engine. There are three main types of electric vehicles: Hybrid Electric Vehicles (HEVs), Plug-In Hybrid Electric Vehicles (PHEVs), and Battery Electric Vehicles (BEVs) [17,18,19].
Moreover, the use of various optimization techniques is very necessary to achieve optimal energy management in the home. There are many studies that have been conducted that discuss the use of optimization techniques to schedule loads and reduce operating costs, whether in microgrids or homes [20,21,22,23,24]. In [25], a mixed-integer quadratic programming energy scheduling algorithm was formulated. This algorithm can control home appliances, energy generation, and energy storage systems (ESSs). This algorithm was based on cost minimization under non-linear pricing. The results show that the proposed algorithm helps to make full use of the generated energy. In [26], a survey was conducted discussing the concept of the smart home and the techniques used in smart homes. The advantages and disadvantages of each technique used in smart homes and products available on the market are discussed. Moreover, it discusses the obstacles, challenges, and future directions related to smart homes. In [27], the process of controlling the multi-carrier microgrid is discussed. Both gas and electricity are supplied to the end customer in this microgrid. They include thermal and electrical loads, RESs, ESSs, and heat pumps. A typical predictive control approach was used to calculate the uncertainties in order to reduce the total cost, while providing convenience to the user. In [28], a multi-objective collaborative optimization of energy management in microgrids was conducted. It aimed to reduce the daily cost of the microgrid. In [29], a study was conducted to develop a strategy to coordinate the charging of autonomous plug-in electric vehicles. The results of this study prove that this strategy is useful in applications in which central control cannot be implemented. In [30], a new distributed algorithm was used that combines consensus, proximity, and fixed-point mapping theory and shows their convergence. The algorithm was applied to grid-connected control systems where clients can only communicate with neighbors. This algorithm was applied to a case study on charging a fleet of electric vehicles.

Motivations and Problem Statement

The smart home is a comfortable residence where the consumer can control home appliances remotely from anywhere using internet-connected devices. The consumer can monitor, control, and manage the appliances inside the home. In addition, the devices are interconnected through the internet, which gives the owner the ability to control functions such as home security systems access, temperature, and home lighting remotely. In this paper, a case study is conducted on a smart home in a remote area isolated from the grid. A modern remote HAMS is built using a Raspberry pi 4B as the main controller. Vital parameters inside the home are sensed and controlled depending on their values. The smart homeowner can check the home status all the time via live stream using a Raspberry Pi camera. Moreover, a charge point for electric vehicles is implemented and controlled through the main controller. Furthermore, a body temperature sensor is used to check the visitor temperature before entering the home. Convenience for people with disabilities is also taken into account when using the Amazon Echo Dot (Alexa) by writing the necessary code to connect Alexa with the main controller from scratch. The whole smart home system is fed by a complete off-grid solar system to ensure a sustainable and green electricity source throughout the day.
The main objective of this paper is to help consumers to fully control their home appliances in order to help the elderly and people with disabilities. In addition, an attempt is made to protect the residents of the house from people infected with COVID-19 by using a body temperature sensor in front of the home door. The concept of smart homes has been implemented in many developed countries of the world. Several technologies have been used such as ZigBeeTM, BluetoothTM, and X10TM. Smart home automation systems are characterized by their energy savings, optimal operation of loads, ease of use, high efficiency, and the security they provide to the user. Bluetooth is used in many smart home energy systems, as it has many advantages, such as its use of low energy as a communication protocol. ZigBee may be considered a better solution than Bluetooth because it is more targeted toward home automation applications. ZigBee is not widely used at the moment, but over time, it can be used in ordinary homes where it will make life much easier for users. The use of the appropriate technology depends on the purpose for which it is used. The transfer speed of ZigBee is lower than Bluetooth. However, ZigBee can be used instead of Bluetooth because it consumes less energy. The currently used wireless communication technologies have some limitations, as Bluetooth covers only 10 m. If the distance exceeds 10 m, the connection is interrupted, and the user cannot control the system. Therefore, there is ZigBee technology [31], which is suitable for wireless networks where the data transfer rate is 250 kb/s, as well as the use of the Global System for Mobile (GSM) communication. It is considered the best in control, but its price is very high, and the data transfer rate is low [32]. X10 is used for communication between electronic appliances, but it is very slow [33]. This paper presents the HAMS, where Z-Wave technology was used for wireless control of the automation system by integrating Raspberry pi with LabVIEW technology and a graphical user interface (GUI) design to control the entire system and to monitor and control home appliances efficiently.
The paper also proposes an efficient way to manage energy within an isolated home to achieve the optimal operation using optimization. The main objective is to enhance the overall system efficiency and protect the battery from deep discharge and overcharging, while achieving the lowest operating cost. The contributions of this research can be summarized in the following points:
  • Design and implementation of a real prototype of a clean energy-powered smart home with a home automation system using the IoT platform, which facilitates the monitoring and control of home appliances, as well as home safety support.
  • The voice-controlled home automation system is made to help people with disabilities and the elderly to fully control their home appliances.
  • Protection of the residents of the house from those infected with the COVID-19 virus by measuring the temperature of people coming to the home through a body temperature sensor in front of the home door.
  • Improvement of the system’s overall efficiency by using optimization techniques to achieve optimal operation and protect the ESS from deep discharge and overcharging.
  • Validation of the functionality of the proposed system regarding automation, security, and safety and evaluate the performance of the developed system. The effectiveness of the designed system is validated by using simulation in LabVIEW software.
  • A simulation is done on a large-scale model to ensure that it can actually be applied to an existing real home. Moreover, the proposed system is implemented on a large-scale in a real home to validate the effectiveness of the proposed model, and real-time results for the system are taken.

2. Methodology

This section explains the methodology used in this paper, which entails a methodical plan of the various research steps, as well as the detailed implementation and design of the system that is proposed and prototyped for the smart home. Additionally, the selection of all components and integrations are discussed in detail. The architecture of the HAMS is shown in Figure 1. A real three-room and reception prototype for a smart home is implemented. First of all, the system needs to collect accurate data about the home temperature, the lighting, the status of the home windows, and the appliances that are working in real time so that it can make the appropriate decision at every moment. This information is obtained through a set of sensors. The HEMS adjusts the temperatures in each room separately. The vehicle-to-home approach is applied to increase the system’s reliability. The operation of the HAMS is represented in the flow chart shown in Figure 2. It shows all the steps that are carried out to obtain the best performance. The HAMS is designed in a LabView environment. The first prototype is implemented using the Raspberry Pi board. The wires, various components, and all the sensors that the first model works on are connected. The test is conducted to ensure that the required tasks are accomplished, and then the design is checked again to ensure that there are no problems in the system. If a system problem is detected, the system automatically returns to the previous stage, and when it works without problems, the system is completed. The proposed smart HAMS is used to achieve maximum energy savings, manage the energy system, save time and effort, and improve the control system. The description of the HAMS components is shown in the Appendix A.
The system is monitored through a graphical interface which monitors room temperature, humidity, smoke, and lighting. The temperature is set at a certain value according to the customer. The temperature read from the temperature sensors is stored and compared with the desired temperature and, accordingly, the HAMS makes the appropriate decision. The lighting and smoke in the room are also displayed. When the amount of smoke exceeds a certain value, the alarm is triggered. Due to COVID-19, a body temperature sensor is used to check the visitor temperature in front of the home door. In addition, the smart home management system controls a charging point for electric vehicles via Raspberry Pi. The proposed smart home automation system architecture is shown in Figure 3.

3. Home Automation System Implementation

The prototype consists of three rooms and a reception, as shown in Figure 4a. The dimensions of the prototype are 1 m (length) × 1.5 m (width) × 0.5 m (height). An apex roof is designed above the prototype to fix the solar off-grid system, as shown in Figure 4b. A real two-layer wooden prototype is implemented, as shown in Figure 4c. The two-layer system is used to make the wiring system more convenient. Moreover, every room is equipped with some appliances such as lamps and fans.
Every room is equipped with some sensors such as smoke, flame, temperature, and air pressure sensors. Furthermore, a PIR sensor is attached near the door of every room to detect motion. A solenoid door lock is used for the main door of the prototype.
The Raspberry Pi is one of the most important components of the home automation system, as it acts as the brain of the system. The Raspberry Pi 4 B with 4 G RAM and a quad-core processor is used as the central controller for the energy management system. The Raspberry Pi board used in the proposed system is shown in Figure 5a. A Raspberry Pi camera is implemented to allow the homeowner to observe the interior of the home remotely throughout the day, as shown in Figure 5b.
Cayenne is used as an IoT platform to obtain all the sensors’ data remotely via connecting the associated sensors with the Raspberry Pi’s general-purpose input/output (GPIO). Furthermore, all the home appliances can be controlled via Cayenne. Controlling the home appliances is done by using two eight-channel relays, as shown in Figure 6. Every relay channel receives a control signal from the Raspberry Pi. This control signal is remotely sent from Cayenne to the Raspberry Pi, depending on the owner’s desire, sensor values, or pre-designed scenarios in Cayenne, as is discussed in the next section.
There are some sensors and appliances that are not compatible with Cayenne. Building the associated code is done s from scratch, as for the DHT11 temperature sensor, smoke, and flame sensors. Moreover, the code of the Raspberry Pi Cam is implemented to allow the homeowner to check the home status throughout the day. To improve convenience for people with disabilities, the Amazon Echo Dot (Alexa) is used. Alexa is programmed from scratch to control the electric vehicle charging point and one lamp as an example, by voice, via the Raspberry Pi.

4. Experiment Setup and Data Collection

A complete off-grid solar system is designed and implemented to feed the smart home with sustainable, green, and emission-free electricity throughout the day. The off-grid solar system consists of a 100 W solar panel, shown in Appendix B.1, in addition to a 12 V, 7 AH lead-acid battery with a 10 A solar controller to ensure a 12 V power supply, shown in Appendix B.2. Moreover, a toy electric vehicle is used, as shown in Appendix B.3, and the associated 5 V charging point is implemented.

Solar Battery Backup Time

PV panels, inverters, and batteries are the three main components of solar PV systems. The battery is the main component of any off-grid PV solar system. The battery only depends on how much backup it requires. Battery capacity is calculated in the form of AH In general, people use 12-volt batteries, which provide 80% efficiency.
The battery backup time is:
Backup   time = Battery   AH   × 12   V   ×   efficiency   of   battery Power   Consumption   in   watts
All the home appliances (lamps, fans, and door locks) are chosen to work on 12 V. That is why all these appliances are directly fed from the solar controller. A DC–DC converter is used to step down the voltage from 12 V to 5 V, which is required for the Raspberry Pi 4, electric vehicle charging point, and some sensors. Other sensors that need 3.3 V are fed directly from the Raspberry Pi.

5. LabVIEW Program

LabVIEW is a virtual instrumentation (VI) tool that enables graphical programming for research and development process labs, as well as in industries for controlling processes and simulation. LabVIEW is the most powerful tool for multipurpose analysis and instrumentation software for measurement and automation. The GUI programming of LabVIEW makes it very easy to build a block diagram of the operation. The programmer simulates the device instrument requirements for the special applications and can change any update easily with the support of the GUI tool. LabVIEW is a software for applications that require testing, measurement, and control with rapid access to hardware and data insights. The great advantage of using the LabVIEW programming technique is the fact that it covers all areas needed to fully control any system, such as acquiring data and analyzing these data to take needed actions. The coding syntax for LabVIEW is called G-language, which uses graphical blocks called block diagrams to represent every process. A general analog data module is designed to be used with the sensors. The sensors used in this system are controlled using the Raspberry Pi unit. Analog read N channel allows the analog reference voltage used to convert ADC ticks to volts to be overridden, as shown in Figure 7. A general digital data module is designed to interface with the digital I/O channels of the Raspberry Pi, design virtual instruments to control LEDs, and read on/off switch states, shown in Figure 8. Lighting color is controlled using a pulse width modulation (PWM) channel, as there is a blue PWM, Green PWM, and red PWM channel, as shown in Figure 9.
An integrated system is designed that connects LabVIEW, Raspberry Pi, and Z-Wave. All devices and sensors are connected to the entire system. The security system, light control, gas fire, and water protection are activated, as shown in Figure 10. The system is designed in a new way to save time, effort, and energy, in addition to managing energy.
A GUI was designed, through which hardware configuration devices are made, where the minimum and maximum temperatures are determined, lighting intensity is adjusted, and the appropriate time for opening and closing blinds and windows is determined. A new system was developed that works through image processing to read the car number of the place owner, as the garage opens automatically as soon as the car number is detected. Through the GUI, we can store more than one operating scenario for the system, and any scenario that the client needs to activate is called through the saved file and opened file, shown in Appendix C.1 and Appendix C.2.
From the tests that were carried out on the proposed system, it is clear that the proposed HAMS is easy to use, highly reliable, and has a low cost compared to other systems. The control methodology consists of sensing temperature, air pressure, and humidity inside the home and controlling all the home appliances. Humidity and temperature in graphical output are shown in Figure 11 and Figure 12, respectively. Moreover, PIR sensors are implemented and connected to the Raspberry Pi Cam, which allows the owner to check the status of the home in a live stream in case of any motion detected. The door lock is also controlled remotely.

6. Case Study

6.1. Problem Statement

This paper deals with two critical issues. One is the design of a smart home with safe energy management that allows the consumer to control the whole home from remote locations through a smartphone and monitor everything that happens in the home. This issue is discussed in the previous sections. In this part, the second issue, which involves minimizing the cost of electricity through the use of optimization techniques, is discussed. A more detailed study of a home that is fed by a PV system supported by an ESS is performed, explaining the assumptions used for modelling the problem. The total area of the home is about 500 m2. It is located in the Sharkia Governorate in Egypt. The results were taken during July for a whole month, as in this month, the irradiation reaches its highest levels in this region, and the average was taken for a whole day. The purpose of the study is to find the optimal operating cost through the use of an optimal energy management system within the home.

6.2. Proposed System

The aim of the system used is to preserve the electricity budget, while maintaining an acceptable level of comfort, so the main objective in the design of HAMS is to reduce electricity costs. Household appliances are generally categorized according to their characteristics and priorities. Devices used in the smart home are divided into three main categories. The proposed smart home consists of three types of loads: crucial, deferable, and controllable loads.
The home is fed through a PV system. In addition, an ESS is used in the home. It has two functions. The first one is to supply the home with electricity as a backup source. The second function is to reduce the operating cost through charging and discharging operations, as it is charged when there is an excess of solar energy production and discharged when there is a deficit at night or at times when solar irradiation is reduced due to clouds or other factors. This leads to no need for the grid or the use of diesel generators, thus reducing the operating cost. The main purpose of the proposed system is to reduce the operating costs of the home electricity, which also means the optimal and efficient operation of the power generation system in the home to ensure the continuity of the supply. Several optimization methods were used, and linear programming (LP) was found to be the best in terms of obtaining the lowest cost. By knowing the solar irradiation I Watt / m 2 , solar panel surface A P V m 2   and the global efficiency of the PV panel installation K T , the amount of energy generated by the panels P Watt   can be known, using the following equation [34]:
P Watt = I Watt / m 2 × A P V m 2 × K T

6.3. Objective Function

A set of considerations is taken to solve the optimization problem in this paper: (1) Power loss in cables is neglected; (2) Voltage level in all of the points is the same; and (3) Reactive power flow is neglected. The main objective of the optimization model used is to reduce operating costs:
m i n i = 1 N ( C s o u r c e i × P s o u r c e i ) × t i   s o u r c e   E E   =   { PV   Array ,   Battery   bank } C s o u r c e i   [ EUR / kWh ] :   cos t   of   the   operation   of   each   source   of   the   interval   i C P V   = 100   EUR / MWh C B a t t   = 300 EUR / MW P s o u r c e i   [ kW ] :   power   of   each   source   of   the   interval   i t i :   time   of   the   interval

6.4. Constraint

There is a set of constraints that are taken into account, the most important of which is the power balance according to the following equation:
P D = P P V + b   P B a t t .
where
P D = Load Demand [Watt]
P P V = PV power [Watt]
P B a t t . = Battery power [Watt]
When
b = b = 1           B a t t e r y   d i s c h a r g e                                       b = 0           B a t t e r y   c h a r g e   s t a y s   c o n s t a n t b = 1           B a t t e r y   c h a r g e                                            
the constraints of the solar system are as follows:
0     P P V   P m a x
a s   P m a x = A P V t o t a l × I × K T
Since solar irradiation depends on external inputs and K T   is constant, the variable that is taken into account in a PV system is the surface of the solar panels. After reaching the optimum surface area, the number of panels is installed throughout the improvement process.
The ESS is indispensable in the off-grid system, despite the high operating costs of the battery, in order to store solar energy when there is a surplus. The full battery capacity is used, as the depth of discharge is about 100%. Therefore, the constraints of the solar system are as follows:
0     P B a t t .   C m a x C m a x :   maximum   capacity   [ Wh ]

6.5. Home Appliances

In this study, the consumer is the main responsible party for controlling the loads, as he is the person responsible for programming the HAMS to be compatible with him and with his personal comfort. The controller is programmed to turn the devices on or off when the temperature, humidity, or other factors reach a specific value that he himself determines. Household loads are classified into three categories: fixed appliances, shiftable appliances, and elastic appliances [35,36,37]. This classification is based on the priority of each device and the convenience of the user. Appliances used in the home in which the case is being studied and their classifications are shown in Table 1. The appliances can be categorized in another way, as follows, where there are devices that work continuously in the event that the resident is inside or away, and there are other appliances that work when the person is inside the home only, and the third type is the appliances that work on request only, as shown in Table 1. In addition, when people are inside the home, the HAMS operates the appliances and lighting according to the readings of the sensors.

7. Results and Discussion

This study proposes a HAMS to optimize the operation of a home. The HAMS helps to produce convenient set points for sources in such a way that economically optimized power dispatch is kept to meet a certain load demand. An IoT-based HAMS was developed that allows devices to connect wirelessly. The proposed system helps to conserve energy by monitoring environmental conditions and thus controlling the use of the equipment accordingly. It allows the appliances such as fans, heaters, air conditioners, and bulbs to be controlled wirelessly based on humidity, room temperature, and light intensity information. According to the reading of each sensor, the Raspberry Pi is programmed to control the use of the device accordingly. These data help to control the devices intelligently, instead of just turning them on and off, which helps to reduce consumption, as it reduces the operation time of the appliances. Moreover, the proposed HAMS stores the daily consumption of the devices, which helps the homeowner to know the daily consumption of the devices. These data are updated automatically, and this helps to achieve a low operating cost. Using the HAMS helps in reducing the operating costs, as it reduces the amount of energy consumed. The consumption decreased after using the proposed system by 18.161 kWh. Figure 13 shows the loads during the whole day before and after using the proposed system. The operating costs for the day amounted to approximately EUR 20.866 before using the HAMS, while its value was about EUR 16.039 after using the HAMS. There was a decrease in operating costs by about 23.13%. Figure 14 shows the load that needs to be covered, as well as the power produced from each source. During the peak period, the home is fed through the PV system. The PV system starts producing energy during the period from 6 am to 6 pm. During this period, the home is fed, and the excess is directed to charge the batteries. Before this period and after it, the batteries are responsible for the feeding process. The surface area required to generate sufficient energy to feed the loads from solar cells at the lowest cost is 118.1039 m2, which represents about 23.62% of the total surface area of the home. The amount of energy generated depends on solar irradiation and the surface area, and since the surface area is constant during the day, the main dependence is on irradiation.

8. Conclusions

This paper presents an effective method for an optimal energy management system in a smart home using the IoT and optimization techniques. The main purpose of this study is to manage energy in an optimal way with the lowest possible operating cost, while covering the household load demand. In this paper, the design, implementation, and fabrication of a portable, low-cost, and user-friendly automation system for smart homes based on the IoT are presented. This design allows real-time monitoring of home status and control of home devices. Several sensors were connected to the main controller, which updated all data to the IoT server. All sensors can be monitored via the Cayenne mobile application. For safety purposes and security, the user receives a notification on their phone about any abnormal status at home via the server. Control of smart home appliances can be easily conducted by using the LabVIEW GUI or through voice command using Alexa. The system is cost-effective, which improves energy efficiency. Solar energy was used to operate the full system and a battery bank was used to obtain the best system reliability. The Raspberry Pi is very suitable for all applications in the IoT concept. The features of the Raspberry Pi lie in the flexibility and endless scope of its usage and authorization, as well as its end users. Finally, the following points can be summarized:
  • An IoT system for the HEMS was implemented and developed inside a smart home that takes into account humidity, temperature, and light intensity and is accordingly interfaced with Raspberry Pi to control the use of devices inside the home, not only turning them on and off, but also controlling the way they operate, such as controlling the fan speed and temperature degree of the air conditioner and intensity of illumination, as well as home safety support.
  • A voice-controlled home automation system was implemented to assist the disabled and elderly within the home. Furthermore, a body temperature sensor at the front of the home door was used to protect residents inside the home from those infected with COVID-19.
  • The overall system efficiency was improved by using optimization techniques to achieve optimal operation and protect the ESSs from deep discharge and overcharging.
  • The proposed system was simulated using the LabVIEW program to verify the effectiveness of the proposed system. Moreover, it was implemented on a large scale in a real home to validate the effectiveness of the proposed model.
  • The results highlight the optimum energy management performance to obtain a daily operating cost reduction and cover the required load. In addition, it achieved a balance between daily energy cost and user comfort.
  • There was a decrease in operating costs by about 23.13%. The daily operating costs were around EUR 16,039. The consumption value during the day before using the proposed system was about 78.5 kWh, while the consumption decreased after using the improvement and reached about 60.34 kWh.
  • The simulation results also show that the daily load demand can be covered at the lowest possible operating cost by using only 118.1039 m2 of the total surface area to install the solar panels.
In future work, new technologies for energy management inside the home will be used and compared with the current results. Among these technologies is the field programmable gate array (FPGA) technology. In addition, the results of the current research using the Raspberry Pi will be compared with future studies in which the FPGA will be used. The limitations associated with each technique and the reasons for preferring one over the other will be discussed. In addition, other RESs will be used to feed the home. A hybrid system will be implemented to meet the load inside the home. The results of the hybrid system will be compared with the existing system in this paper regarding the reliability of each system and the cost of operation.

Author Contributions

Conceptualization, M.H.E. and M.E.L.; methodology, M.H.E.; software, A.E. and T.S.G.; validation, M.E.L.; formal analysis, A.E.; investigation, T.S.; resources, M.H.E.; data curation, N.S.A.; writing—original draft preparation, N.S.A.; writing—review and editing, M.H.E.; supervision, T S.; project administration, T.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A. Description of the HAMS’s Components

The proposed smart HAMS is used to achieve maximum energy savings, manage the energy system, save time and effort, and improve the control system. The proposed HAMS is designed using NI LabVIEW software. The prototype is implemented using a Raspberry Pi board as the controller, Z-Wave technology and a Mobile App, in addition to a set of sensors.

Appendix A.1. Raspberry PI 4

Raspberry pi plays a vital role in home automation systems. Raspberry Pi 4 Model B is used in this study, as it is the latest product, which is shown in Figure A1. It has many advantages over other models, as shown in Table A1 [38]. Raspberry Pi 4 offers ground-breaking increases in CPU speed, memory, multimedia performance, and connectivity. The features of the Raspberry pi 4 include a high-performance quad-core processor 64-bit, dual-display at resolutions up to 4 K via HDMI ports, up to 4 GB of RAM, dual-band 2.4/5.0 GHz, Bluetooth 5.0, wireless LAN, USB 3.0, Gigabit Ethernet, and PoE capability.
Figure A1. Raspberry Pi 4 Model B.
Figure A1. Raspberry Pi 4 Model B.
Sustainability 14 13840 g0a1
Table A1. Comparison between Raspberry Pi 4 and previous models.
Table A1. Comparison between Raspberry Pi 4 and previous models.
Raspberry Pi ClassificationsRAMProcessor Rate
Raspberry Pi 4 B4 GBAMD ARM v8, 1.5 GHz
Raspberry Pi 2 B1 GBQuad-Core ARM Cortex-A7, 900 MHz
Raspberry Pi 3 B1 GBQuad-Core 64-bit ARM Cortex A53, 1.2 GHz
Raspberry Pi 3 B +1 GB64-bit ARM Cortex A53, 1.4 GHz
Raspberry Pi Zero512 MBsingle-core ARM11, 1 GHz

Appendix A.2. Motion Sensor

PIR sensors are used to monitor the movement of people within the range of the sensor. These sensors are characterized by their small power, low cost, low power consumption, and robustness. When the sensor senses the entry or exit of a person, it sends a signal to the controller to turn off the lights or the fan. Interfacing the PIR sensor with Raspberry Pi is shown in Figure A2.

Appendix A.3. Temperature and Humidity Sensor

The DHT11 sensor is used in this study. It is a digital sensor responsible for measuring the temperature and humidity in rooms. This sensor is characterized by its high reliability, as the humidity measurement range is from 20% to 95%, and the error is about 5%, while the temperature measurement range is from 0 to 50 degrees Celsius and the measurement error is about 2 degrees. Interfacing the DHT11 sensor with Raspberry Pi is shown in Figure A3.
Figure A2. Interfacing PIR sensor with Raspberry Pi.
Figure A2. Interfacing PIR sensor with Raspberry Pi.
Sustainability 14 13840 g0a2
Figure A3. Interfacing DHT11 sensor with Raspberry Pi.
Figure A3. Interfacing DHT11 sensor with Raspberry Pi.
Sustainability 14 13840 g0a3

Appendix A.4. Body Temperature Sensor

Due to COVID-19, a touchable body temperature sensor is equipped near the home’s main door, as shown in Figure A4, to check visitor temperature. The home visitor is allowed to enter the home or not depending on the value of his body temperature.
Figure A4. Body temperature sensor.
Figure A4. Body temperature sensor.
Sustainability 14 13840 g0a4

Appendix A.5. Relay Module

A group of relays is used to control the appliances. The relays turn the appliances on and off through the Raspberry Pi. The relay needs 5 V to operate. The contact capacity of the relay used in this study is 10 A 250 V AC/10 A 30 V DC. Interfacing eight-channel relay with Raspberry Pi is shown in Figure A5.
Figure A5. Connection of eight-channel relay.
Figure A5. Connection of eight-channel relay.
Sustainability 14 13840 g0a5

Appendix A.6. Z-Wave Protocol

Z-Wave technology is a wireless protocol developed by Zensys and by the Alliance for automation systems for houses and different commercial environments. Z-Wave can run all electrical devices in the home, such as controlling on/off lights, light brightness, HVAC, televisions, cooking, and home security. The software for the gateway consists of layers, as shown in Figure A6. It differentiates to activate trustworthy transmission of short messages from the main control unit to more devices in the network with less noise. Each device indicates a node and the network that uses a Z-Wave protocol; each device must include a Network ID (Home center ID). The RF technology activates these devices to communication with each other; the radio frequency allows nodes to be inserted into the home network.
Figure A6. Z-Wave gateway module for Raspberry Pi.
Figure A6. Z-Wave gateway module for Raspberry Pi.
Sustainability 14 13840 g0a6

Appendix B

Appendix B.1. The Off-Grid Solar System Consists of a 100 W Solar Panel

Figure A7. 100-watt solar panel.
Figure A7. 100-watt solar panel.
Sustainability 14 13840 g0a7

Appendix B.2. A 12 V, 7 Ah Lead-Acid Battery with 10 A Solar Controller

Figure A8. Lead-acid battery with solar controller.
Figure A8. Lead-acid battery with solar controller.
Sustainability 14 13840 g0a8

Appendix B.3. A Toy Electric Vehicle and the Associated 5 V Charging Point

Figure A9. 5 V Electric vehicle.
Figure A9. 5 V Electric vehicle.
Sustainability 14 13840 g0a9

Appendix C

Appendix C.1. LabVIEW GUI Configuration

Figure A10. LabVIEW GUI configuration.
Figure A10. LabVIEW GUI configuration.
Sustainability 14 13840 g0a10

Appendix C.2. Sensors’ Data Monitoring Using LabVIEW GUI Configuration

Figure A11. Sensors’ data monitoring.
Figure A11. Sensors’ data monitoring.
Sustainability 14 13840 g0a11

References

  1. Elkholy, M.H.; Metwally, H.; Farahat, M.A.; Nasser, M.; Senjyu, T.; Lotfy, M.E. Dynamic centralized control and intelligent load management system of a remote residential building with V2H technology. J. Energy Storage 2022, 52, 104839. [Google Scholar] [CrossRef]
  2. Jabbar, W.A.; Kian, T.K.; Ramli, R.M.; Zubir, S.N.; Zamrizaman, N.S.; Balfaqih, M.; Shepelev, V.; Alharbi, S. Design and fabrication of smart home with internet of things enabled automation system. IEEE Access 2019, 7, 144059–144074. [Google Scholar] [CrossRef]
  3. Li, W.; Logenthiran, T.; Phan, V.-T.; Woo, W.L. A novel smart energy theft system (SETS) for IoT-based smart home. IEEE Internet Things J. 2019, 6, 5531–5539. [Google Scholar] [CrossRef]
  4. Kim, T. A study of the Z-Wave protocol: Implementing your own smart home gateway. In Proceedings of the 2018 3rd International Conference on Computer and Communication Systems (ICCCS), Nagoya, Japan, 27–30 April 2018; IEEE: New York, NY, USA, 2018; pp. 411–415. [Google Scholar]
  5. Yassein, M.B.; Mardini, W.; Khalil, A. Smart homes automation using Z-Wave protocol. In Proceedings of the 2016 International Conference on Engineering & MIS (ICEMIS), Agadir, Morocco, 22–24 September 2016; IEEE: New York, NY, USA, 2016; pp. 1–6. [Google Scholar]
  6. Jimenez, C.; Saavedra, E.; del Campo, G.; Santamaria, A. Alexa-based voice assistant for smart home applications. IEEE Potentials 2021, 40, 31–38. [Google Scholar] [CrossRef]
  7. Aliero, M.S.; Qureshi, K.N.; Pasha, M.F.; Jeon, G. Innovation. Smart home energy management systems in internet of things networks for green cities demands and services. Environ. Technol. Innov. 2021, 22, 101443. [Google Scholar] [CrossRef]
  8. Talaat, M.; Elkholy, M.H.; Farahat, M.A. Operating reserve investigation for the integration of wave, solar and wind energies. Energy 2020, 197, 117207. [Google Scholar] [CrossRef]
  9. Afzal, M.; Gondal, H.A.H.; Arshad, M.B.; Shahid, M. IoT based real time warehouse monitoring using Sparkfun ESP8266 Thing Dev and Cayenne MyDevices. Univ. Swabi J. 2018, 2, 12–18. [Google Scholar]
  10. Arora, J.; Kumar, R. IoT-based smart home systems. In Innovations in Computer Science and Engineering; Springer: Singapore, 2019; pp. 531–538. [Google Scholar]
  11. Šarga, P.; Cocul’a, J. Design and implementation of smart home model. Texнiчнi Hayкu ma Texнoлoгiї 2018, 3, 161–166. [Google Scholar]
  12. Somefun, T.E.; Abdulkareem, A.; Awosope, C.O.; Akanji, O. Smart home comfort and energy conservation using internet of things. Telecommun. Comput. Electron. Control 2022, 20, 357–365. [Google Scholar] [CrossRef]
  13. Garvanov, I. Identification of the important parameters for ranking of open-source home automation platforms for IoT management. In Advances in Systems Engineering: Proceedings of the 28th International Conference on Systems Engineering, ICSEng, Wrocław, Poland, 14–16 December 2021; Springer Nature: Cham, Switzerland, 2022; Volume 364, p. 310. [Google Scholar]
  14. Zhou, L.; Zhang, Y.; Lin, X.; Li, C.; Cai, Z.; Yang, P. Optimal sizing of PV and BESS for a smart household considering different price mechanisms. IEEE Access 2018, 6, 41050–41059. [Google Scholar] [CrossRef]
  15. Zebra, E.I.C.; van der Windt, H.J.; Nhumaio, G.; Faaij, A.P.C.; Reviews, S.E. A review of hybrid renewable energy systems in mini-grids for off-grid electrification in developing countries. Renew. Sustain. Energy Rev. 2021, 144, 111036. [Google Scholar] [CrossRef]
  16. Odou, O.D.T.; Bhandari, R.; Adamou, R. Hybrid off-grid renewable power system for sustainable rural electrification in Benin. Renew. Energy 2020, 145, 1266–1279. [Google Scholar] [CrossRef]
  17. Abdalla, M.A.A.; Min, W.; Mohammed, O.A.A. Two-stage energy management strategy of EV and PV integrated smart home to minimize electricity cost and flatten power load profile. Energies 2020, 13, 6387. [Google Scholar] [CrossRef]
  18. Hou, X.; Wang, J.; Huang, T.; Wang, T.; Wang, P. Smart home energy management optimization method considering energy storage and electric vehicle. IEEE Access 2019, 7, 144010–144020. [Google Scholar] [CrossRef]
  19. Khemakhem, S.; Rekik, M.; Krichen, L. A collaborative energy management among plug-in electric vehicle, smart homes and neighbors’ interaction for residential power load profile smoothing. J. Build. Eng. 2020, 27, 100976. [Google Scholar] [CrossRef]
  20. Luo, F.; Kong, W.; Ranzi, G.; Dong, Z.Y. Optimal home energy management system with demand charge tariff and appliance operational dependencies. IEEE Trans. Smart Grid 2020, 11, 4–14. [Google Scholar] [CrossRef]
  21. Zhou, B.; Li, W.; Chan, K.W.; Cao, Y.; Kuang, Y.; Liu, X.; Wang, X. Smart home energy management systems: Concept, configurations, and scheduling strategies. Renew. Sustain. Energy Rev. 2016, 61, 30–40. [Google Scholar] [CrossRef]
  22. Mansouri, S.A.; Ahmarinejad, A.; Nematbakhsh, E.; Javadi, M.S.; Jordehi, A.R.; Catalão, J.P.S. Energy management in microgrids including smart homes: A multi-objective approach. Sustain. Cities Soc. 2021, 69, 102852. [Google Scholar] [CrossRef]
  23. Yahaya, A.S.; Javaid, N.; Alzahrani, F.A.; Rehman, A.; Ullah, I.; Shahid, A.; Shafiq, M. Blockchain based sustainable local energy trading considering home energy management and demurrage mechanism. Sustainability 2020, 12, 3385. [Google Scholar] [CrossRef] [Green Version]
  24. Zahraoui, Y.; Alhamrouni, I.; Mekhilef, S.; Basir Khan, M.R.; Seyedmahmoudian, M.; Stojcevski, A.; Horan, B. Energy management system in microgrids: A comprehensive review. Sustainability 2021, 13, 10492. [Google Scholar] [CrossRef]
  25. Carli, R.; Dotoli, M. Energy scheduling of a smart home under nonlinear pricing. In Proceedings of the 53rd IEEE Conference on Decision and Control, Angeles, CA, USA, 15–17 December 2014; pp. 5648–5653. [Google Scholar]
  26. Lobaccaro, G.; Carlucci, S.; Löfström, E. A Review of systems and technologies for smart homes and smart grids. Energies 2016, 9, 348. [Google Scholar] [CrossRef] [Green Version]
  27. Carli, R.; Cavone, G.; Pippia, T.; Schutter, B.D.; Dotoli, M. Robust optimal control for demand side management of multi-carrier microgrids. IEEE Trans. Autom. Sci. Eng. 2022, 19, 1338–1351. [Google Scholar] [CrossRef]
  28. Karimi, H.; Jadid, S. Optimal energy management for multi-microgrid considering demand response programs: A stochastic multi-objective framework. Energy 2020, 195, 116992. [Google Scholar] [CrossRef]
  29. Ma, Z.; Callaway, D.S.; Hiskens, I.A. Decentralized charging control of large populations of plug-in electric vehicles. IEEE Trans. Control Syst. Technol. 2013, 21, 67–78. [Google Scholar] [CrossRef]
  30. Carli, R.; Dotoli, M. A distributed control algorithm for waterfilling of networked control systems via consensus. IEEE Control Syst. Lett. 2017, 1, 334–339. [Google Scholar] [CrossRef]
  31. Zhihua, S. Design of smart home system based on ZigBee. In Proceedings of the 2016 International Conference on Robots & Intelligent System (ICRIS), Zhangjiajie, China, 27–28 August 2016; IEEE: New York, NY, USA, 2016; pp. 167–170. [Google Scholar]
  32. Pramanik, A.; Nagar, V.; Dwivedi, S.; Choudhury, B. GSM based Smart home and digital notice board. In Proceedings of the 2016 International Conference on Computational Techniques in Information and Communication Technologies (ICCTICT), New Delhi, India, 11–13 March 2016; IEEE: New York, NY, USA, 2016; pp. 41–46. [Google Scholar]
  33. Bordencea, D.; Valean, H.; Folea, S.; Dobircau, A. Agent based system for home automation, monitoring and security. In Proceedings of the 2011 34th International Conference on Telecommunications and Signal Processing (TSP), Budapest, Hungary, 18–20 August 2011; pp. 165–169. [Google Scholar]
  34. Tubella, C.B. Optimization of the Operation of a Microgrid with Renewable Energy Resources. Bachelor’s Thesis, Universitat Politècnica de Catalunya, Barcelona, Spain, April 2018. [Google Scholar]
  35. Alblawi, A.; Elkholy, M.H.; Talaat, M. ANN for assessment of energy consumption of 4 kW PV modules over a year considering the impacts of temperature and irradiance. Sustainability 2019, 11, 6802. [Google Scholar] [CrossRef] [Green Version]
  36. Rahim, S.; Javaid, N.; Ahmad, A.; Khan, S.A.; Khan, Z.A.; Alrajeh, N.; Qasim, U. Exploiting heuristic algorithms to efficiently utilize energy management controllers with renewable energy sources. Energy Build. 2016, 129, 452–470. [Google Scholar] [CrossRef]
  37. Jamil, A.; Alghamdi, T.A.; Khan, Z.A.; Javaid, S.; Haseeb, A.; Wadud, Z.; Javaid, N. An innovative home energy management model with coordination among appliances using game theory. Sustainability 2019, 11, 6287. [Google Scholar] [CrossRef]
  38. Maksimović, M.; Vujović, V.; Davidović, N.; Milošević, V.; Perišić, B. Raspberry Pi as Internet of things hardware: Performances and constraints. Des. Issues 2014, 3, 1–6. [Google Scholar]
Figure 1. Architecture of the HAMS.
Figure 1. Architecture of the HAMS.
Sustainability 14 13840 g001
Figure 2. Flow chart of the research task structure.
Figure 2. Flow chart of the research task structure.
Sustainability 14 13840 g002
Figure 3. Proposed smart HAMS architecture.
Figure 3. Proposed smart HAMS architecture.
Sustainability 14 13840 g003
Figure 4. (a) Smart home room prototype; (b). A triangle roof above the prototype to fix the solar off-grid system; (c) two-layer wooden prototype.
Figure 4. (a) Smart home room prototype; (b). A triangle roof above the prototype to fix the solar off-grid system; (c) two-layer wooden prototype.
Sustainability 14 13840 g004
Figure 5. (a) The main control unit Raspberry Pi 4 B board; (b) the Raspberry Pi camera.
Figure 5. (a) The main control unit Raspberry Pi 4 B board; (b) the Raspberry Pi camera.
Sustainability 14 13840 g005
Figure 6. Two eight-channel relays.
Figure 6. Two eight-channel relays.
Sustainability 14 13840 g006
Figure 7. Analog read N channel for all analog sensors.
Figure 7. Analog read N channel for all analog sensors.
Sustainability 14 13840 g007
Figure 8. Digital read N channel for all digital sensors.
Figure 8. Digital read N channel for all digital sensors.
Sustainability 14 13840 g008
Figure 9. RGB LED lighting control module.
Figure 9. RGB LED lighting control module.
Sustainability 14 13840 g009
Figure 10. LabVIEW data acquisition virtual instrumentation block diagram.
Figure 10. LabVIEW data acquisition virtual instrumentation block diagram.
Sustainability 14 13840 g010
Figure 11. Temperature in graphical output.
Figure 11. Temperature in graphical output.
Sustainability 14 13840 g011
Figure 12. Humidity in graphical output.
Figure 12. Humidity in graphical output.
Sustainability 14 13840 g012
Figure 13. The real-time load during the whole day with and without using the HAMS.
Figure 13. The real-time load during the whole day with and without using the HAMS.
Sustainability 14 13840 g013
Figure 14. Optimal operation and management of hybrid PV and ESS.
Figure 14. Optimal operation and management of hybrid PV and ESS.
Sustainability 14 13840 g014
Table 1. Appliances used in the home of the case study.
Table 1. Appliances used in the home of the case study.
ApplianceType of ApplianceNumbersPower Consumption (W)Operational Time per Day (H)Energy Consumption per Day (Wh)Pre-Defined Schedule of Operation
Inside AwaySleep
Water pumpElastic
appliance
1200 3 600 On requestOffOff
Refrigerator110024 1800 OnOnOn
Air conditioner21500 7 On requestOffOn request
Vacuum cleaner1700 2 1400 On requestOffOff
Water heater11200 3 3600 On requestOffOff
Space heater11500 6 9000 On requestOffOff
Washing machineShiftable appliance1700 3 2100 On requestOn requestOff
Cloth dryer12000 1 2000 On requestOn requestOff
Dish washer11800 2 3600 On requestOffOff
FanFixed
Appliance
480 21 6720 On requestOffOn request
TV210010 2000 On requestOffOff
Light2011 16 3520 On requestOffOff
Microwave1800 3 2400 On requestOffOff
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Elkholy, M.H.; Senjyu, T.; Lotfy, M.E.; Elgarhy, A.; Ali, N.S.; Gaafar, T.S. Design and Implementation of a Real-Time Smart Home Management System Considering Energy Saving. Sustainability 2022, 14, 13840. https://doi.org/10.3390/su142113840

AMA Style

Elkholy MH, Senjyu T, Lotfy ME, Elgarhy A, Ali NS, Gaafar TS. Design and Implementation of a Real-Time Smart Home Management System Considering Energy Saving. Sustainability. 2022; 14(21):13840. https://doi.org/10.3390/su142113840

Chicago/Turabian Style

Elkholy, Mahmoud H., Tomonobu Senjyu, Mohammed Elsayed Lotfy, Abdelrahman Elgarhy, Nehad S. Ali, and Tamer S. Gaafar. 2022. "Design and Implementation of a Real-Time Smart Home Management System Considering Energy Saving" Sustainability 14, no. 21: 13840. https://doi.org/10.3390/su142113840

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop