SmartEnvironmentDataMonitoring-Final
SmartEnvironmentDataMonitoring-Final
net/publication/333158468
CITATIONS READS
6 2,028
1 author:
Amir Hammami
College of Sciences and Humanities - Afif- Shaqra University - Saudi Arabia
4 PUBLICATIONS 12 CITATIONS
SEE PROFILE
All content following this page was uploaded by Amir Hammami on 03 March 2020.
Abstract—This research proposed a web-based monitoring Arduino are not expensive. They offer low cost technologies.
system that can help to view in real time environment data like It is possible to put several autonomous devices in different
temperature and humidity. By using sensors connected to places that send the data continuously. Real-time monitoring
Arduino Microcontroller, the system collects data, transmits becomes possible through this platform.
them to the Raspberry Pi Minicomputer which stores them on
remote server and makes them available to Internet users. We This paper is structured as following: section 2 presents
use Wi-Fi Router based on GSM/GPRS Module as the network several related works dealing with the problematic of data
unity to send collected environment data to ThingSpeak web collection and publishing them to the Internet. Section 3
server. A supervisor through a dashboard monitors various gives more details about Internet of Things concept and the
data. The system can help to resolve emergencies. In this way, associated architecture. In section 4 we describe the overall
it simultaneously improves the quality of the environment system architecture and present offered services and features.
through constant attention. This project enters in the concept Section 5 introduces hardware equipment that makes up our
of Internet of Things which consists of integrating the real- system. A description of the software part will be presented
world into the Internet. in section 6, before concluding the paper and citing the
perspectives in section 7.
Keywords—Environment Monitoring, Internet of Things,
Arduino, Raspberry Pi
II. LITERATURE REVIEW
I. INTRODUCTION We distinguish tow axes depending on the content of the
literature review: (i) The first axe deals with the subject and
Internet of Things (or IoT) is a new IT concept that has
the problematic of monitoring environment data. (ii) The
emerged in recent years and is growing very quickly. The
second axe deals with technical aspect of the project
main purpose focuses on connecting real-world objects to the
implementation.
Internet through different technologies. We can connect
temperature, rain, humidity and soil sensors to servers
connected to the Internet. It is therefore possible to store A. Environment Data Monitoring
different types of information (temperature, humidity …) Data monitoring system has been widely used in many
then analyze them later and make appropriate decisions and fields especially in case of weather station. Authors in [1]
interventions. Real data, collected from the various sensors, present an automated weather station for real time and local
inform the users about the evolution of their environment in measurements. Their system continuously measures several
real-time. Beyond the simple provision of information, the weather factors. The results are displayed in an iOS and
aggregation of these data from heterogeneous sources Android application through blynk 1 platform. Two parts
enables to quantify the surrounding environment in order to compose the system which are located indoor and outdoor.
identify trends and enrich uses. After collecting data and Another weather station is presented in [2]. The hardware
transmitting them to database, the supervisor monitors these module is based on Arduino board and Zigbee wireless
data and observes evolution. If data exceeds a certain technology. It measures the meteorological data including air
threshold, alerts can be evoked. temperature and barometric pressure.
In this research project, we propose a computer system
B. Technical Aspects
whose main objective is to connect different sensors to a web
server linked with a database. It is possible to collect From a technical point of view, data monitoring issue has
different data for a later exploitation. This system consists of been treated widely since the emergence of the Internet of
two parts: hardware and software. The hardware part collects Things. We define three major roles: collect data, store
information in real time using sensors connected to the values and finally access these values. Data collection can be
Arduino Microcontroller. Arduino is also attached to performed using sensors connected to Arduino MC or
Raspberry Pi Minicomputer via serial communication. RPi attached to Raspberry Pi Minicomputer. Data storing can be
transmits data to Internet based on Wi-Fi router via wireless done locally on each board or remotely on servers located in
communication. The software part takes care of storing the Internet. Finally data visualization can be performed by
collected environment data on remote database. Using a direct access to Arduino or Raspaberry Pi if data is stored
Python script on RPi, we publish values to ThingSpeak locally. It can also be done via web navigators that access
sever. It is then possible to monitor data and execute web servers if data is stored remotely.
selection queries in order to analyze, extract relevant
information, act and make specific decisions.
The main advantage of our approach is the real-time
environment data monitoring and the ability to read
information from Internet while being located in another
place. In addition hardware components like sensors and 1
https://www.blynk.cc/
(2019 ICCIS) 978-1-5386-8125-1©2019 IEEE
III. INTERNET OF THINGS The second direction: from top to bottom includes
projects where we activate actuators. From the Application
A. Definition Layer we perform actions. These actions are transmitted to
IoT is referred to as “a set of technologies for accessing the bottom Layer (usually located on another device) and do
the data collected by various devices through wireless and something. For example it is possible to turn on and turn off
wired Internet networks” [3]. Although there are notable a fire extinguisher when fire ignites from outside by simple
differences in the definitions of IoT, a common explanation Internet connection without risking injury.
is the ability to provide valuable and beneficial information
by various devices through wireless and wired Internet IV. SYSTEM ARCHITECTURE
networks. In another words it consists of connecting real The System proposed in this paper has the following
world to Internet. Things are objects from the surrounding features:
environment like temperature and light. Sensors and
actuators are connected to remote servers through Internet. Measure of temperature, humidity and other
environment data through sensors connected to
B. Architecture Arduino MC.
The architecture of Internet of Things is based on four Transmission of collected data (GPS location and
layers as described in [4]: Physical Layer, Process Layer, other values) to Raspberry Pi Minicomputer using
Network Layer and finally Application Layer. Number of USB cable,
researchers adds another layer called Business Layer. The
bottom layer the physical layer interacts with the real world. Publishing values to a remote server (ThingSpeak)
It is composed of two parts: sensors and actuators. Sensors periodically after a predefined time interval (Push
are electronic components which role consists of sensing and Mode),
collecting data from real objects. A better term for a sensor is A supervisor monitors the collected data in real-time
a transducer [5]. A transducer is any physical device that and can visualize positions on Google map using
converts one form of energy into another. So, in the case of a Smartphone or Laptop (Pull Mode) by simple Internet
sensor, the transducer converts some physical phenomenon connection.
into an electrical impulse that can then be interpreted to
determine a reading. There are many different types of With data collected and analyzed, we can make
sensors. Flow sensors, temperature sensors, voltage sensors, decision about this environment and perform
humidity sensors, and the list go on. Another type of intervention.
transducer that we encounter in many IoT systems is an
actuator. In simple terms, an actuator operates in the reverse The system follows a layered architecture that can be
direction of a sensor. It takes an electrical input and turns it mapped to the Internet of Things layers. In particular the
into physical action. For instance, an electric motor, a Application Layer concerns the analysis layer based on web
hydraulic system, and a pneumatic system are all different technologies. This architecture implements the previous
types of actuators. The Process Layer is the brain part to listed features.
control all connected devices. It can be composed of: Application Layer
Arduino Microcontroller or Raspberry Pi Minicomputer. It Dashboard
contains hardware and software working together to achieve
special goal. The network Layer enables connectivity and it
is responsible of sending and receiving data based on wired Network Layer Wi-Fi Router
or wireless network. On top of the architecture we find the
Application Layer that illustrates the purpose of the IoT
project. An Internet navigator loads a dynamic web page Process Layer Arduino attached to RPi
acting as a monitor to visualize the collected data through
sensors. It may contain buttons to activate actuators for
example. Perception Layer Sensors
From this architecture we can extract two different
directions of flow of instructions: From bottom to the top and Fig. 1. Layered Architecture
from top to the bottom. The first direction typically concerns
monitoring-based applications like GPS Tracking or From this architecture we identify four major steps to
Continuous Environment Monitoring System like the enable real-time data monitoring:
proposed one. These kinds of applications follow three main
steps: (i) Data collection from sensors, (ii) local or remote 1. Capture environment data like temperature and humidity.
storage and (iii) Analysis step. Data collection is realized in This is done using sensors connected to Arduino board,
the physical layer (called also Perception Layer). It is used 2. Make the Arduino write the values to the Serial port to
for gathering data from various sensors. The amount of data Raspberry Pi,
collected can increases in an exponential manner. Here we
talk about Big Data issues. After collecting data the next step 3. Have a Python program running in the Raspberry Pi that
deals with Storage. It can be done locally on SD memory reads from the Serial port and then stores the values into
card for example or on remote database located on the ThingSpeak server,
Internet. Here we talk about Cloud Computing. Finally the 4. In the end, we can point the internet browser to a
Analysis step deals with how to use these collected data and ThingSpeak website and get a plot of the collected data.
more interesting what decision can be taken.
Store data on remote
Web Server
GPS
Coordinates
Send Data
V. HARDWARE COMPONENTS
The associated electronic components for the different
layers and their functionalities are given below:
A. Perception Layer
Sensors convert various forms of physical energy into
electrical energy, allowing microcontrollers to read changes
in the physical world. Many sensors work by converting the Fig. 4. Humidity Sensing Component
energy they read into a changing electrical resistance by
using a variably resistive material at their heart. For example, On the other hand, for measuring temperature the
Photoresistors or light dependent resistors change their component uses a NTC temperature sensor or a thermistor. A
resistance when exposed to a change in light energy. In order thermistor is actually a variable resistor that changes its
to read changes in resistance, we typically place these resistance with change of the temperature. It is made by
sensors in a voltage divider circuit, which converts the sintering of semiconductive materials such as ceramics or
resistance change into a changing voltage. polymers in order to provide larger changes in the resistance
with just small changes in temperature. The term “NTC”
The DHT11 is a digital sensor that gets relative humidity means “Negative Temperature Coefficient”, which means
and temperature readings. Because of their low cost and that the resistance decreases with increase of the temperature.
small size, DHT11 sensors are perfect for lots of different
DIY electronics projects. The sensor consists of a humidity
sensing component, a NTC temperature sensor (or
thermistor) and an IC on the back side of the sensor.
The main idea of this project is to use Arduino as the VI. SOFTWARE IMPLEMENTATION
extension of Raspberry Pi, and make the best of both boards. In the software implementation we distinguish three
We can easily access the GPIO pins on connected Arduino, levels: Arduino, Raspberry Pi and ThingSpeak.
just like they are on Raspberry Pi; accept analog input and
generate accurate PWM output via the GPIO pins on A. Arduino Level
Arduino. It is also possible to make use of the shields for
Arduino, indirectly on Raspberry Pi. Sensors convert various forms of physical energy into
electrical energy, allowing microcontrollers to receive
Our proposition consists of connecting several sensors to signals. This microcontroller is Arduino Board. So we use
Arduino Microcontroller which is also attached to Raspberry Arduino IDE to write a sketch (C program) and flush this
Pi using a standard USB cable. This solution allows us to program to the Arduino board. The program consists of two
make profit of the benefits of both boards. parts:
1. Initializing pins connected to sensors as inputs (setup()
C. Network Layer: Wi-Fi Router with SIM Card
function)
Raspberry Pi will push environment data values to a
remote server. The suitable solution consists of using a Wi-Fi 2. Infinite loop responsible of reading values, send them to
router which has two interfaces: (i) an external interface and serial port and waits a delay.
(ii) an internal interface. The external interface is based on For temperature and humidity sensor (DHT11) we use a
GSM/GPRS standard. It allows the router to be connected to library written in C language called dht.h that can be
Internet using the GSM network operator of the country. downloaded from Internet.
B. Raspberry Pi Level #Convert from Celius to Farenheit
Where to put the data became the next question. A TWF = 9/5*TW+32
customized solution consists of building a private web
server. This web server contains dynamic webpages that
interact with a database. A programming script like PHP can
be used to store data on tables and then perform selection
queries. Using a plotting JavaScript library like Flot2 allows
visualizing data on charts.
Another solution which is a simplified approach consists
of sending all collected data to a predefined remote server.
Such servers exist on Internet and are free for use for some
period of time. We can cite Google Sheets3, Dweet.io4 and
ThingSpeak5. Fig. 9. Temperature and humidity experiments
2
https://www.flotcharts.org/
3
https://spreadsheets.google.com
4
http://dweet.io/
5
https://thingspeak.com/