C. Air Quality Monitoring System Using Raspberry Pie and Web Socket
C. Air Quality Monitoring System Using Raspberry Pie and Web Socket
28
International Journal of Computer Applications (0975 – 8887)
Volume 169 – No.11, July 2017
which it replaces. You can find here your board warranty Rails framework implements Web Socket through Action Cable.
informations. Once the devices are connected to the Arduino Once this action cable is established, there will be full duplex
Mega, we can be able to read data from the devices. communication channel between the web server and the
Raspberry Pi. This channel exist until it is manually stopped,
The Raspberry Pi [3] is the next component in our system. The hence the real time data reading can be achieved.
Raspberry Pi is a mini computer that was developed in the
Raspberry Pi foundation in the United Kingdom that was
introduced to teach basic computer science to students.
Raspberry Pi has a quad core Cortex processor. Raspberry Pi 3
used in this paper features a Broadcom Videocore IV with 1 GB
Ram and Ethernet and 802.11 wireless connectivity as well.
Raspberry Pi includes various ports such as HDMI, 3.5mm
audio-video jack 4 usb 2.0, Ethernet and Camera Serial
Interface. The sensors are connected to the Arduino Mega and
the Arduino Mega Plays an interface between the Sensors and
Raspberry Pi. All these are on the hardware side of the system.
Let’s move on to the software side.
The concept of web socket [4] has been used in this paper. Web
socket was introduced as a specification when HTML5 was
developed. Its name was coined by two people Ian Hickson and
Michael Carter in collaboration with IRC chat room. Later,
Google Chrome 4 was the very first browser that included web
socket enabled as default. It is a computer communication
Figure 1.1
protocol which has a full duplex connection between the client
and the host over a single TCP connection. HTTP is a protocol 5. CHALLENGES FACED
in which when a browser requests for a page, the server returns 1. Security
the page and connection is closed. The WebSocket protocol As millions of devices are connected together, security is one of
enables interaction between a browser and a web server with the key features that need to be focused on. Since these sensors
lower overheads, facilitating real-time data transfer from and to detect very sensitive information it is necessary for us protect
the server. This is made conceivable by giving an that data that is in transit from the outside world. Major
institutionalized path to the server to send substance to the industries like defense, medical etc require security as the data
program without being requested by the customer, and taking can be extremely critical in nature.
into consideration messages to be passed forward and backward
while keeping the association open. Along these lines, a two- 2. Data
way (bi-directional) progressing discussion can occur between a The effect of the IOT on capacity is two dimensional in sorts of
program and the server. The communications are done over information to be put away: individual information (buyer
TCP port number 80 (or 443 in the case of TLS-encrypted driven) and enormous information (undertaking driven). As of
connections), which is of benefit for those environments which now being used in key verticals, for example, human services
block non-web Internet connections using a firewall. and monetary administrations, enormous information is
Comparable two-way program server correspondences have changing how and why organizations gather and store
been accomplished in non-institutionalized ways utilizing information. IT administrators that are already tasked with
stopgap advances, for example, Comet. keeping the storage centers running will also have to figure out
how to store protect and make all the incoming data accessible.
Ruby on Rails [5] is a server side web framework written in If, as Gartner, estimated, storage servers are only being used to
Ruby. Rails have a framework that includes a model, view and a between 30 and 50 percent of capacity, the physical capabilities
controller. It provides a default access to a database, a web are there. Managing them, however, is an entirely different
service and web pages. It uses JSON for data transfer and problem.
HTML, CSS, Javascript for display and user interfacing. It uses
convention over configuration software engineering technique as 3. Storage Management
well. However, even if the capacity is available now, there will be
further demands made on storage and one that will have to be
4. IMPLEMENTATION addressed as the need to access this information becomes more
The entire system is connected through various connectors. important. Businesses will have weighed up the economics of
According to figure 1.1, the sensors are connected to the storage against the value of IoT information.
Arduino Mega which acts as the interface. The Arduino Mega
needs a power source so that the sensors start working. The 6. CONCLUSION
Raspberry Pi provides the power supply to the Arduino Mega as In this way our attempt of making a model for observing
well as the sensors. The Raspberry Pi can be connected to the contamination, for the most part the measure of carbon
power supply either through a USB Cable or a charger. Once the monoxide, carbon dioxide, methane, smoke utilizing sensors
power supply is given, the sensors start to detect data. The data MQ2, MQ7 and MQ135 individually alongside DHT sensor to
detected by the sensors is sent to the Arduino Mega, when the gauge temperature and stickiness, progressively was executed.
sensor specific code is run on it. We can actually see the data This model is stationary and can be deployed in different places.
coming through the serial monitor in the Arduino IDE. A UDP The sensor measurements of various gases, temperature and
connection is created between the Arduino and Raspberry Pi humidity are accurate.
through a Ruby Code which is run on the Raspberry Pi. Once the
The future enhancement to this model can be done by deploying
data reaches the Raspberry Pi, the only thing left out is to send
the sensors to a movable object. As it is implemented in real
the data to the web server hosted by Ruby on Rails. The Ruby on
time, these sensors can be deployed to a movable robot so that it
29
International Journal of Computer Applications (0975 – 8887)
Volume 169 – No.11, July 2017
can move around detecting the various gases present in the [2] Arduino, https://www.arduino.cc/
surroundings. This model can be implemented near industrial
areas so that it can detect the gases and if the gases exceed the [3] Raspberry Pi, https://www.raspberrypi.org/
standard limits of pollution, a website can be designed to inform [4] Web Socket, https://www.websocket.org/
the industrial agents to reduce the pollution. These sensors can
also be implemented in drones which can move around and [5] Ruby on Rails, http://rubyonrails.org/
detect the polluting gases in the environment. Security measures [6] Sunil Karamchandani, et al. ”Pervasive Monitoring of
can be enhanced to protect the data that is being sent through the Carbon Monoxide and Methane using Air Quality
components by introducing new protocols. Prediction”, 2016 IEEE
7. REFERENCES [7] Internet of Things based Smart Environmental Monitoring
[1] Sensors and its Details, http://www.china- using the Raspberry-Pi Computer, 2015 IEEE
total.com/Product/meter/gas-sensor/Gas-sensor.htm
IJCATM : www.ijcaonline.org
30