IoT Based Home Automation System over Cloud

Internet of Things (IoT) is a system of interrelated computing devices where all the things, including every physical object, can be connected - making those objects intelligent, programmable and capable of interacting with humans. As more and more data are generated each day, IoT and it's potential to transform how we communicate with machines and each other can change the world. The user operates the smart home devices year in year out, have produced mass operation data, but these data have not been utilized well in the past. This project focuses on the development of home automation system based on internet of things which allows the user to automate all the devices and appliances of home and merge them to provide seamless control over every side of their home. The data can be used to predict the user’s behavior custom with the development of a machine learning algorithm, and then the prediction results can be employed to enhance the intelligence of a smart home system. The designed system not only gives the sensor data but also process it according to the requirement, for example switching on the light when it gets dark and it allows the user to control the household devices from anywhere. The cloud is used to send the sensor data through Wi-Fi module and then a decision tree is implemented which decides the output of the electronic devices also, it is used to achieve the power control and local data exchanging which provide the user interface, store all the information corresponding to the specific house, and query the function information of an individual home appliance.


INTRODUCTION
The Internet of Things is a system of related computer devices, machines and digital devices, objects, animals or people that are equipped with unique identifiers and the ability to transmit data over the network without the need for human-human or human-human interaction. It is a computational concept that describes the idea of combining physical objects of everyday use with the Internet to enable communication between things and people. IoT describes a world in which almost everything can be connected and communicate in an intelligent way. Devices can be any objects, such as smart phones, Internet televisions, sensors, electronic devices, etc. To collect and exchange data, electronics, software, sensors and network connectivity are embedded in them. With the increase in the level of sophistication in basic devices and growing concerns about environmental requirements to develop an intelligent system that is self-aware of the environment and can analyze and react at its own discretion without the need to use the human factor, called Automated Systems. The proposed system focuses on the development of an online home automation system based on the Internet of Things, which allows the user to automate all devices and home appliances and connect them to ensure smooth control over each page of their home. The data can be used to predict non-standard user behavior by developing a machine learning algorithm, and then the prediction results can be used to increase the intelligence of the smart home system. Designed system not only transmits data from the sensor, but also processes them as required, for example, turns on the light when it gets dark, and allows the user to control the household appliances from anywhere. The cloud is used to send data from sensors via the Wi-Fi module, and then implements a machine learning algorithm that also determines the efficiency of electronic devices, serves to achieve power control and local data exchange that provide user interface, storage all information relating to of a specific house and asking for information about the functions of a single household appliance. To enable or disable the Google LED assistant, you can use it to send voice commands.

Methodology
The proposed system uses the ESP8266 Wi-Fi module which is connected to the sensors and the electronic devices. It uses a Wi-Fi network to connect it from the cloud. The Wi-Fi module sends the Humidity and Temperature data to the cloud which allows the user to monitor the readings. The user can change the speed of the fan and switch ON or OFF the light. Machine Learning Algorithm is used to adjust the electronic devices according to the user behavior. Data from the sensors is stored in a CSV file using python. Using this data, the dataset is being made to make the appliances learn according to the user's behavior. The DHT11 sensor is connected to the ESP8266 which provides the data in a room. Many implementations may exist for a given specification or standard. System implementation generally benefits from higher levels of user involvement and management support. User participation in the design and operation of information systems has several positive results. First, if users are heavily involved in systems design, they move opportunities to meld the system according to their priorities and business requirements, and more opportunities to control the outcome. Second, they are more likely to react positively to the change process. Incorporating user knowledge and expertise leads to better solutions.
The relationship between the user and the designer has traditionally been a problem in the implementation of the software. Users and Information systems specialist tend to have different concerns.

User Concern
Will the system deliver the information I need for my works?
How quickly can I access the data? How easily can I retrieve the data? How much clerical support will I need to enter data into the system? How will the operation of the system fit into my daily business schedule?

System Architecture
The core of the home automation system is Node MCU ESP8266 which is a small size, low cost micro-controller. It can easily interact with the outside world and is compatible with C language. The Wi-Fi module is used in the project which is controlled by Arduino IDE when we upload the code, making use of an ARM architecture. All the components are connected to the Wi-Fi module which controls their functioning. The LDR is used to detect the presence or absence of light and it works on the principle of photoconductivity. DHT11 sensor detects the current Humidity and Temperature of the room. A relay is an electromagnetic switch operated by relatively small electric currents that can turn on/off much larger currents. Finally, Wi-Fi module acts as a web server and cloud interface is used to control the relay. Router is used for communication between the devices.

Fig 2: System Architecture of Home Automation
Circuit Diagram: NodeMCU is a system on a chip, DHT11 is connected to board using Digital pin D1 and LDR sensor is connected to board using Analog pin A1 .5v 4 Relay module is connected to NodeMCU using pins from D2 to D5 and a 5v Relay module is connected to pin D6. These relays are used to control the voltage output for the electrical appliances. 4 Potentiometer with 10K Ohm resistance is connected to 4 Relay modules in series. The potentiometer is connected to a dc motor, Potentiometer is used to control the speed of the dc motor. Speed of the DC motor is controlled by using the data of DHT11 sensor (temperature and humidity). 1 The relay module is connected to the LED strip. The LED strip will be turned OFF or ON based on the LDR sensor input. NodeMCU is powered up using a 9V battery and one more 9V battery is used to power up dc motor and led strip.

Fig 3: Circuit Diagram
Implementation Steps: Step 1: To establish connection between the client and the server, the Wi-Fi option in the Smartphone is enabled.
Step 2: It is connected to the Wi-Fi module of the system.
Step 3: Each electronic/electrical appliance in the system is connected to the digital pins on the Wi-Fi Module.
Step 4: A Relay is used for connecting each device to the Node MCU, which helps in converting high Voltage supply to low voltage.
Step 5: A C-program is loaded on to the microprocessor chip on the Node MCU which specifies what action is to be performed on receiving inputs. Step 6: A Cloud Interface is developed which enables the end user to monitor and control the appliances from any remote location.
Step 7: Socket Programming has been used to achieve client-server communication.
Step 8: Successful controlling and monitoring of appliances.

Conclusion
The project in general has been successfully implemented. The software produced for the project is functionally correct, reasonably robust, and usable. The project has met the entire General and Non-Functional Requirements and in addition, has been implemented in a modular fashion, which can be easily modified or rewritten at a later stage. The user interface is easy to use and works in all web browsers. It does not require any propriety interfaces or plug-ins to operate. This means that the Home Automation System is accessible from any web browser and that the system could be usable from anywhere on the Internet and therefore from anywhere on the planet. The software is robust. The design of the software means that most errors are caught in a nonfatal manner, meaning that the software can continue executing even after a bad request.
The proposed system can be further used for enhancements can be like Securing the data transfer and add other security measures.
Advance machine learning algorithm for the device can also be applied.
Applying the system for managing traffics smart cities, etc.