Smart Home Automation System

—Due to the increasing number of systems getting automated, a home automation system is being designed here.The Smart Home Automation System is being designed keeping in mind the necessity to eliminate the need for any kind of human interference that is required to operate the home appliances. In order to provide automation, a lot of factors need to be considered such as, human presence, current temperature, the state of the electrical appliances, the time of the day and the user activity. The system must also be able to monitor the user activity on a regular basis and learn in the process. Thus, enabling the system to respond intelligently and provide better user experience. By training the system with some test cases, the system can map the user activity to the above mentioned factors. The system learns from these test cases and can predict the next activity by matching the current activity to the previous scenarios. The system then responds accordingly, by giving the expected result .


I. INTRODUCTION
e are living in the world of automation where most of the systems are getting automated, such as industrial automation, homes and other business sectors. Home automation systems are advancement to the mechanization processes wherein human efforts are needed with the machinery equipments to operate various loads in homes. It involves automatic controlling of home appliances using different technologies and controllers over desktops, laptops smart phones or tablets.Machine learning is a concept which involves the system learning over time. The use of machine learning in this system is the sole reason why the system is superior to the existing systems. The minimized number of wires and connected devices ensures that there is a hassle free system which benefits the end user in all possible aspects. This concept of using machine learning in order to design a home automation system is something that has not been attempted before and the success of this project may lead the way to new openings in the existing market.

II. SYSTEM ARCHITECTURE
The system is a technical solution based on a combination of hardware and software modules for camera data collection, data conversion, main controller module, machine learning module, system states saver module and device controller module. The object detection module detects the presence of humans in a particular room and also sends the temperature sensor's readings, with a given frequency or request from the main controller system. The module is able to communicate with devices from different manufacturers with different software interfaces processing data from sensors. The main controller module manages the interaction of all modules based on internal parameters of the system including sensor parameters, time, output data from the machine learning module and commands from system manual control module. Machine learning module computes the internal parameters of the system, coming from the main controller and use machine learning methods and decides to change the internal system parameters based on input values. System state storage module is responsible for storing the system sensor parameters and machine learning module results. Data stored in this module are used as training data for machine learning module.
The device controller module changes the state of the devices and its configurations in the home. The hardware of the module is able to manage devices using standard wireless data transmission, infrared remote control, and sockets with a remote control. Arduino board is the main component in the device controller module. The board is coded to respond to certain inputs by controlling the states of the devices.
First, the data is received from the object detection module. If necessary, the machine learning module is activated and current system state with a new sensor parameters are the input data for this module. After the decision-making process, the new calculated state of the system comes back to the main controller module, which sends it to the devices control module. Devices control module converts values of the system using the data conversion module to a new value according to devices setting.
Each room of the house is equipped with temperature sensors and climate control. For the accuracy of the temperature W control, each room is equipped with at least three temperature sensors, which are located in different parts of the room at different heights that increases the accuracy of the temperature. The temperature in the room is set as an arithmetic average performance of all room temperature sensors. Also, if one temperature sensor parameter have deviation in the room more than 15% from the average -this value is not included in the calculations, as is the likelihood that the sensor is under influence of other foreign factors which distort the values of temperature (flow of cold air from the air conditioner, performance of infrared heater, etc.) and message for the user is displayed with a recommendation to change the location of the sensor or eliminate extraneous factor distortion.
The system save the hourly temperature of each room, presence of people in the house parameters, the day parameter and enabled lighting for the last month. History of the sensors data is used as a training sample in learning artificial neural network. The machine learning module uses artificial neural network to predict the desired by residents temperature settings in each of the rooms in real time by changing the parameters of the system.
The sample dataset consisting of factors such as Day of the week, time of the day, room, outside and inside temperatures as input parameters and the output parameters as light and fan controls is as follows:

IV. PRACTICAL USAGE
The Object Detection module implements the YOLO (You Only Look Once) algorithm to detect the objects in the captured image. The YOLO algorithm has many advantages compared to other object detection algorithms, as it is faster (can process 45 frames per second), can handle images with low quality and understands generalized object representations. The object detection module makes use of raw images as its test cases and aims at classifying the objects that are detected within the image. The objects that are identified from this module are then sent to the Machine Learning module.
The Machine Learning module implements the Naive Bayes algorithm to predict the state of the appliances. To train the Machine learning module, datasets consisting of all the necessary parameters such as the day of the week, time of the day, and the temperature, presence of the person, presence of the cars, etc. The datasets considered for training and testing is of considerable length and must represent most of the common possibilities.
The working of the module, as a whole, starts with the capture of images in the room or the garage by the camera. The objects which are then detected by the Object Detection module is then used by the Machine Learning module to predict the state of the appliances at the instance, that the image was taken from the camera.
On the other hand, the Machine Learning requires the csv (comma separated values) files for training the model. There are three devices that are being controlled in the home automation system. They are: While considering continuous valued attributes such as the time of the day or a multi valued attribute like day of the week, the attribute values can be grouped together which show common characteristics. For example, we can expect the user behaviour; i.e., the presence of user in the home or the time at which he leaves the home; to be more or less similar throughout the week days and this can vary drastically from the weekends.
In the similar way, since the time of the day attribute is a continuous valued attribute where each second of the day represents a new value to that attribute, we can divide the attribute into different time zones, again considering the behaviour of the user.
Hence, to make the system faster and more efficient:  The day of the week attribute is separated into two values:  1 (represents-Monday, Tuesday, Wednesday, Thursday and Friday).  2 (represents-Saturday and Sunday).

VI. CONCLUSIONS
A truly intelligent Smart Home is a multi-layer system which requires little to no management on a user's part and is capable of making decisions based on historical and real-time data. Thus, the system is able to identify significant user actions, assess the probability events those actions trigger and issue appropriate commands to other devices within the network. The goal of Home Automation is to bring down any manual settings to almost zero.
Currently, many Smart Home offerings are missing this.However, using machine learning principles we can significantly minimize the inconvenience for connected home owners, who often have to set up and operate their not-sosmart devices manually. User detection is done using cameras and accordingly the appliances are turned ON/OFF, which maybe according to the user requirements.By collecting user data such as user actions on a particular time of the day, the outside temperature and the day of the week, a relation can be established between the user actions and the collected data. This data is used to predict user's next step and provide valuable suggestions and give more automation.