Internet of Things-based home automation, energy management and smart security system

Department of Computer and Communications Engineering, Abubakar Tafawa Balewa University Bauchi, Nigeria. Department of Mechatronics and System Engineering Abubakar Tafawa Balewa University Bauchi, Nigeria Department of Electrical and Electronic Engineering, Nigerian Army University Biu (NAUB) P.M.B 1500 Biu, Nigeria Department of Electrical Engineering, Bayero University, Kano (BUK) P.M.B 3011, Kano, Nigeria


INTRODUCTION
A system that allows for remote control of different electrical and electronic home appliances is known as home automation system (HAS). Domestic home automation systems may use robotics, embedded controllers, programmable logic circuits and other computer technologies for monitoring and control of household appliances. The energy saving feature of home automation is the most important feature, especially for clients who are preoccupied, the total energy usage can be monitored so as to ensure proper and efficient power usage by offing all the redundant appliances, by so doing, energy consumption is minimized [1,2]. For the internet-based home automation, its most exciting feature is the convenience. The time when the geyser is to be turned on and wait for the water to get hot is over. The geyser can be tuned on from office/place work or anywhere provided that there is internet connectivity, so that on getting home, the water is ready for use, this saves one a lot of time. For security purpose, one can conveniently be monitoring the house remotely through surveillance cameras. In the event of property intrusion, the scheme is designed to monitor the situation. The user can conveniently and comfortably be controlling and monitoring the sound system as well as the light intensity from the sofa via the home entertainment section of the scheme, while watching and enjoying an exciting movie. There is an unavoidable need for energy conservation by any available means due to continual growth in population, leading to higher energy demand. Remote monitoring of electrical and electronic appliances will help a great deal towards minimizing the energy consumption problem. Gartner [3] prompted that, by the year, 2020, there could be over 26 to 64 billion linked devices. Internet of Things (IoT) is quickly attracting attentions both within and outside of the hi-tech space. The IoT's idea not only has the vista of influencing the way we live, but also impacting our work life. It is based on this concept that the idea of linking devices with an on and off switches to the internet came up. Over the years, the IoT has swiftly advanced; it has become the topic of discussion in offices, households, institutions and even in some industries too. Internet of Things is defined as the linkage of physical devices and objects, embedded with electronics, some forms of hardware and internet connectivity so that these devices can interrelate and interconnect with one another through a web server and can subsequently be remotely monitored and controlled [4][5][6]. The IoT structure is usually employed in areas in which the human continuous physical presence is not automatically needed [7]. The development of an internet-based home automation system is the main objective of this research. The goal is to build a pedestal via which communication between web applications and an embedded controller positioned at a remote place somewhere in the universe will be possible.

RELETED WORKS
In order to monitor and also control home appliances, ZigBee was used in the design, development and implementation of a ZigBee-based Home Automation scheme [8]. The ZigBee's user interface (UI) is both simple and supple and the scheme can be accessed remotely. In order to take care of safety as well as security challenges of the scheme, dedicated virtual home was further incorporated. A scheme that works based on wireless fidelity networking technique using an Arduino Uno platform was proposed in [9], it is a wi-fi based home automation scheme that uses Android and Arduino board. The Android operating system forms the graphical user interface (GUI) that links the user to the hardware section thereby establishing an interaction with the home appliances. Apart from the monitoring and control features of the scheme, it also provides the power consumption details of the connected devices to the user.
A system capable of influencing all the other existing associated systems was designed and proposed in [10]. In this system, alerts and device statuses are directly sent to the user's phone through wi-fi connected embedded controller. The alerts are received regardless of the user's location even if the user is not connected to the internet. The scheme is named the "IoT-based smart security & home automation system". The existing prototype used the TI-CC3200 launch pad board embedded controller, which usually contains an onboard wi-fi shield through which the control and monitoring of all the home appliances is made possible. For sufficient security of smart houses, a proposed feasible scheme was presented in [11]. The scheme is titled "integration of smart house and smart meter to key-based and identity management scheme". A low cost and smart home automation system through Internet of things was proposed in [7]. Apart from the control of home appliances, the scheme is believed to also be applicable for online billing through the internet. To minimize energy consumption in the house, an algorithm was developed using motion sensors in [12]. A home automation for visually disabled persons using hand recognition was proposed in [13]. The scheme permits the visually disabled persons to relate with the home appliances. In [14], a scheme that uses cloud computing services to collect and stores information was proposed. In this scheme, the stored information is used to generate neural network prototypes which are used for energy conservation purpose in the house. Disabled persons can easily control Home appliances like fans, lamps, television, air-conditioners, and radio. using the IoTbased monitoring and control of the smart home by eye-tracking, proposed in [15].

METHODOLOGY
The design and methodology used are fully explained in this section. Many components are required to be able to realize the proposed system, ranging from block diagram of the hardware, the system architecture, the circuit diagram and development of the software.

System architecture
The system architecture has been explained in detail. Figure 1 shows a home automation scheme using an embedded controller. The design is made such that the embedded controller interrelates with the user mobile software by dint of a network server using internet protocol. The UI is used to give commands to the embedded controller. Based on the predefined control algorithm governing the microcontroller, it will then execute the required tasks. The embedded controller displays the device status via the LCD screen; it also updates this information onto the server for the user mobile application. The safe communication between the user mobile application, the user interface (UI) and the control unit take place via the server. Once the user is identified, an access is granted to the Web page. An embedded controller was used in this design due to its compacted motherboard, affordability, and tractability. Integrated circuits (ICs) can be absolutely replaced by the embedded controller. The functionality of an embedded controller can be easily modified since it is reprogrammable. Arduino Uno R3 embedded controller was used in this study for it has an ATmega16U2 which offers more memory and higher speed. However, this scheme totally relies on mobile connectivity to the internet, and this is its main limitation. The remote monitoring and control of this scheme is totally impossible once the connectivity is compromised. The Input/output limit of the embedded controller used will determine the number of devices that the scheme can monitor and control. In addition, a programmable logic circuit (PLC) may be used to replace the embedded controller; embedded controllers are not as robust as PLCs. However, the embedded controller was preferably chosen over the PLC solely based on the cost consideration. Furthermore, system prototyping has made the Arduino embedded controller the finest possible choice, because PLCs are not open-source. The system architecture comprising the Web and its components, the communication and the hardware sections, is shown in Figure 1.

Hardware system diagram
Microcontrollers are autonomous systems having been imbedded with memory, processor and other peripherals. Nowadays, smartphones, home appliances, automobiles, computers and smart watches are imbedded with contemporary programmable microcontrollers a reason why microcontrollers are known as "embedded controllers". Based on the memory requirement, length of programming and complexity level of software, embedded systems may either be extremely sophisticated or otherwise. Solenoids, buttons, LCDs, numerical relays, humidity sensor, heat sensor, and light intensity sensor are parts of input/output devices as shown in Figure 2.

Device construction
After completion of the design, all the required components necessary for the realization of the design were verified and successfully gathered. The system hardware modeling and simulation were achieved using the circuit diagram. Proteus virtual system modeling environment (VSM), Version 8.0, was used for the Simulation purpose.

Software development
To use the ATMega328p Microcontroller in an electronic hardware, its prior programming is necessary. The programming language used in programming the microcontroller is the assembly programming. For proper functioning of the microcontroller, the coding has to be accurate and feasible. KEIL micro vision 4 was used to confirm the feasibility of the codes. The simulation was performed via Proteus Virtual System Modeling (VSM) Version 8.0. The codes were burnt onto the microcontroller using arduino sketch 1.8.7 software. A hex code was generated; compiled and stored in the computer. The stored hex code was burnt onto the microcontroller through arduino sketch 1.8.7 software. Flow chart of the software design is shown in Figure 3.
To help the user to easily have access to the door, the authentication section in the flow chart is designed. The design was made to ensure that all unauthorized access to the door are controlled. Password checks for matching are performed inside the first loop of the codes, if the password matching is a success, access is given to the user, but access will be denied otherwise. Checks for appropriate alert and beep sound are designed to run inside the second loop. Figure 4 shows the arduino codes for unauthorized access attempt.

RESULTS AND DISCUSSION
The simulation result was obtained through the use of Proteus 8.0. And Proteus 8.0 environment was used in linking the components' design numbers, so as to maintain the effectiveness of the design.

Website
Many reasons may lead to the creation of web sites, ranging from businesses, education, campaigns, and entertainment. Web sites can now be used in the control of home appliances. An Arduino web server is used to control and monitor the power consumption of home appliances by providing a clickable user interface (UI) through which the user can send signals to the server. Java Scripts, XML and HTML were used in creating the web site. A user with full access will be able to monitor the power consumption status as well as switch on or off devices/appliances via the user interface (UI). The web site homepage is accessible at all times, and it can be accessed by anybody.

Web login page
An authorized person must login via the login page to be able to access the control panel and the notification page as shown in Figure 5. The login details of the user are required before getting full access to the application platform for controlling the appliances. For security reasons, the username style was designed to accommodate all alphabets and spaces. A simple click of the buttons on the user interface (UI) control side will automatically send an equivalent signal to the server, the server will subsequently switch on or off the required appliances. Furthermore, the user gets updates of matching images of the appliances' status via the server.

Control panel
The control panel is shown in Figure 6. It is the most essential part of the web design part; the control here is basically on home appliances. The user can be able to see and control the appliances. Figure 6 shows the control buttons of the kitchen bulb, bedroom bulb, main room bulb and main door, all in off state. Hence, a user can accessibly be able to turn on or off any appliance(s) at ease.

Notification page
Whenever there is an unauthorized access, the owner will receive notifications from the system on the notification web page. Figure 7 shows an intruder who was detected trying a wrong password, the detected messages were displayed on the page; this was integrated for the improvement of system security.

The system unit
The system unit is shown in Figure 8. It is contained inside a 15cm x 8cm x 5cm polyvinyl chloride (PVC) case. A vent was formed to reduce the overheating of components. All the physical components connected such as the keypad to be used for login, the LCD screen unit to use for displaying messages, are shown in Figure 8.

The system testing
The testing comprises of various processes of the opening/closing of doors using the keypad, opening/closing of doors using the web control panel and turning the bulbs on or off using the web control panel.

Opening/closing of the door using keypad
The basic means of accessing the door system is the Keypad; Figure 9 demonstrates how the door is open beginning from a-c. The door can only be opened by a user who already has a registered password, the user will simply type in the password, and after successful password verification the door will then automatically start to open. The user can view the process in real-time through the LCD display as shown in Figure 9c. To close the door, the user will simply replicate the procedures of door opening.

Opening/closing of the door via the web control panel
In the event of any unforseen problem with the keypad control, the door can alternatively be accessed via the web application control as sown in Figure 10. The door can only be opened from the web application control panel after a successful login, Figure 10 shows an inactive state of the main door control button, the blue color on signifies the main door is opened.

Switching the bulbs from the web control panel
The bulbs can alternatively be switched on or off via the web control panel; Figure 11 shows how the control panel can be used to switch on or off the bulbs. The control buttons in blue color indicate the on status of appliances such as the kitchen bulb, bedroom bulb and main room bulb. A user can only access the web application control panel after a log in. Similarly, after a successful login, the web control application panel can be used to switch on or off the bulbs. Figure 11. Door opening via the web control panel

AREA OF APPLICATION
The IoT-based home automation and energy management smart security system is basically applicable to home appliances, but can be extended to offices, hospitals, marketplaces such as super markets, malls and stores.

Surveillance and security
Surveillance cameras, security sensors and other sensors can be integrated with the system to help the operator to properly monitor his vicinity.

Management of power consumption
The Real-time monitoring of appliances helps in the reduction of energy consumption, and also provides an opportunity to turn ON or OFF the appliances remotely.

Entertainment
Appliances can be either switched ON or OFF via the system. Hence the system can be connected to another one, such as illumination/lighting system, and Sound system.

Access control
With the help of the keypad section, a Digital locking system can be incorporated into the system; thereby providing monitoring and enhancing security about movement into and out of the house.

CONCLUSION
In this paper, summary of the design and development of the network home automation method has been presented. As a result of the numerous devices connected to the internet, the IoT-controlled home automation structure possesses an abundant application in the skill-driven flea market. The work in this paper demonstrates the procedures of both accessibility and control of appliances through either the unit keypad or the network control panel. In order to improve efficiency of the system's individual components, the components are modularized, thereby certifying the system integration with a wide range of devices. The basic idea of the IoT-based home automation, energy management and smart security system is to provide the client with a very safe and suitable system for efficient security, mobility and control.