INTEGRATING IOT WITH CLOUD
INTEGRATING IOT WITH CLOUD
IOT or the ‘Internet Of Things’ is a concept of a network of “things”, which include devices like sensors that are embedded with software, to connect to the internet. The devices are connected to each other and to the internet in order to exchange data. The concept of Internet Of Things is an amalgamation of various technologies, embedded systems, analysis of data in real-time, and machine learning. The idea behind IOT is to provide objects with an artificial intelligence so that they transfer data to the internet about their surroundings and perform certain operations based on the results derived from the data.
With the evolution of the digital world, there is the need to store and process massive volumes of data. Taking the example of IOT, the sensors produce a lot of data. The data produced by the sensors is huge and, storing and processing that volume of data can be very difficult. Simple physical servers cannot hold all of the data generated by the devices and the processing of the data also becomes slow. To solve the problem of storing and processing data, the concept of cloud computing can be applied. Cloud computing technology is a delivery of the IT resources needed to store and process data by as pay-as-you-go system. The task of buying and maintaining physical servers is expensive and tedious, but cloud computing can solve that problem by providing the services required at the cost of us using the resources.
Integrating IOT with the cloud allows for real-time processing of data. The data sent by the sensors in the IOT network can be cleaned, stored, and interpreted in the cloud and automatic responses can be sent back to the sensors to carry out certain actions based on the results obtained by interpreting the data. The most common example associated with IOT is the concept of ‘smart homes’. The idea behind smart homes is connecting the household devices like lights, fans, air conditioners, security systems, televisions, heaters, and so on with embedded devices to make them sensor devices which can be connected to the internet where the owner of the house can remotely control the appliances in the household which is a part of the IOT network.
The purpose of the project is to integrate the IOT devices to the cloud by taking an example of the cloud platform Thingspeak. Thingspeak is a platform that provides an analytics service that allows the users to visualise, analyse, and accumulate live streams of data into the cloud. The platform allows the user to collect and send data from the sensor network privately to the cloud platform. With the help of MATLAB, the data is visualized and analysed. The conclusion arrived from analysing the data can trigger a reaction which is sent to the sensor network to be executed.
Fig.1: Node MCU connected to the bread board
The Fig.1 shows a NodeMCU connected to a bread board where the NodeMCU is an IOT sensor device. The NodeMCU is a firmware which integrates a USB onto a surface mounted board which further contains the Micro Controller Unit(MCU) and an antenna. The NodeMCU is widely used in IOT systems as it comes with an integrated Wi-Fi SoC(System on Chip). The NodeMCU is the sensor which is connected to the household devices to connect them to the IOT network and in turn the internet. Attaching the NodeMCU to the household devices and connecting them to the IOT network allows the owners to control the functioning of the household devices via the internet even if they are not physically present home.
The signals which are sent from the devices are in the form of analog signals. The breadboard has a built-in system which converts the analog signals to digital signals, it is called ADC or Analog to Digital Convertor. The ADC values obtained from the household devices are sent to the Thingspeak cloud through a wireless medium as shown in Fig.2.
Fig.2: ADC values sent to Thingspeak
The values sent to the Thingspeak are processed and plotted into graphs which is then translated using the MQTT protocol. The project uses the MQTT protocol or the Message Queuing Telemetry Technique, which is a lightweight protocol used for messaging. This protocol is used to translate the signals obtained from the household devices. The processed graphs are translated by the MQTT protocol and the trigger response is sent to the household devices by the Thingspeak platform to be executed. Fig.3 shows the graphs drawn from the ADC values sent to the cloud.
Fig.3: Graphs drawn from the ADC values 3.00 and 2.00
Fig.4: The section of the code depicting the connection to the Thingspeak cloud
Fig.4 shows the section of the code that connects the devices to the Thingspeak cloud. After establishing the connection to the cloud, the NodeMCU transmits to the cloud the data in the form of ADC values. The ADC values are then used to plot graphs as shown in Fig.3. The MQTT protocol then translates the graphs to come to a conclusion as to what the device needs to do. The trigger response ins then sent to the device to be executed. For example, the light was switched on in a room when no one is home. The sensors fitted in the light fixture detect that there is no one present in the room, but the light is still on. It sends the signal to the cloud. Analysing the information, the cloud sends a trigger to switch off the light in the room.
With the help of IOT integrated with cloud, the execution of the concept of ‘smart homes’ has become easier. The owner can control the household devices connected to the IOT network with the help of an application, remotely. This allows for various benefits like reduction of utility bills, stops unnecessary wastage of resources like water and electricity, and many more. If the security system installed in the house is connected to the IOT cloud it becomes easier for the owners to manage the security of their home by allowing them to update the password remotely, getting alerts if anyone tries to break-in, and alerts the police if anyone tries to break-in. While the cost of installation may be high, the benefits obtained from ‘smart homes’ is high in comparison.