0% found this document useful (0 votes)
46 views57 pages

Arduino-Nano Based Implementation of Supervisory Control

Uploaded by

Znar Saeed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views57 pages

Arduino-Nano Based Implementation of Supervisory Control

Uploaded by

Znar Saeed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

Al-Nilain University

Faculty of Engineering

Department of Control Engineering

Arduino-Nano Based Implementation of Supervisory Control

A Thesis Submitted in Partial Fulfillment of the Requirements of the Master


Degree in Control Engineering

Presented by:

Firas Abdelraheam Mohammed Khabir

Supervised by:

Dr. Abdelrahim Ahmed Mohammed Ate

Dr. Diaeldin Ali Ibrahim Zayan

September, 2020

1
‫سورة المجادلة االية ‪11‬‬

‫‪i‬‬
Acknowledgments

I am very grateful to all my teachers at University of Al-Nilain, who have


taught me the skills for this work. I am very thankful to my supervisors, who has
been very cooperative and understanding.

ii
DEDICATION

To my Parents

To my Supervisors

To my Friends

iii
TABLE OF CONTENTS
TOPIC PAGE
‫االية‬ i

Acknowledgement ii

Dedication iii

List of figures vii

Abstract ix

CHAPTER ONE
INTRODUCTION
1.1 Overview 1
1.2 Problem Statement 3
1.3 Objectives 4
1.4 Research methodology 4
1.5 Thesis outlines 5
CHAPTER TWO
LITERATURE REVIEW
2.1 Introduction 6
2.2 Remote Terminal Unit 7
2.3 Master Terminal Unit 8
2.4 Communication Channel 9
2.5 Literature survey 10
2.6. Low-cost SCADA system 11
2.6.1. Low-cost hardware 11

iv
2.6.1.1 PIC microcontroller based system 11
26.1.2 ESP8266 based system 12
2.6.1.3 Arduino Based systems 12
2.6.2. Low-cost server 13

2.6.3. IoT based SCADA systems 14

2.6.4. Thingspeak based SCADA 15

2.7. Security of SCADA systems 16

2.8 Components used in SCADA technology 18

2.8.1. Xbee module 18

2.8.1.2. API Mode 20


21
2.8.1.3. Xbee Operation Modes
21
2.8.2. Arduino
22
2.8.3 Relay
2.8.3.1 Types of Relays 23
2.8.4 DHT11 Temperature Sensor 23

CHAPTER THREE
Research Methodology
3.1 Introduction 27

3.2. System Block diagram 27

3.3 Circuit Diagram 30

3.4 System Flowchart 32

CHAPTER FOUR
RESULTS AND DISCUSSION
4.1 Introduction 33

4.2 Communication Test 33

4.2.1 Xbee to Xbee 34

v
4.2.2. Arduino to Arduino 35

4.2.3. Data Transmission 35

4.3 Scenario from one Station 37

CHAPTER FIVE
CONCLUSIONS AND RECOMMENDATIONS
5.1 Conclusions 39

5.2 Recommendations 40

References 44

vi
LIST OF FIGURES
FIGURE PAGE
Figure 2.1: General SCADA System Architecture 6

Figure 2.2: Xbee module 18

Figure 2.3: Arduino Uno 22

Figure 2.4: Relay module 23

Figure.2.5: DHT11 sensor 25

Fig 3.1: RTU 29

Figure 3.2: MTU 29

Figure 3.3 MTU circuit diagram 30

Figure 3.4: RTU circuit diagram 33

Fig. 3.5: System Flow chart 32

Fig.4.1: Xbee to Xbee Configuration 34

Fig.4.2: Scenario from one Station 37

vii
LIST OF TABLES
FIGURE PAGE
Table 2.1. Xbee RF module specifications 19

viii
ABSTRACT
A system has been suggested to gather the data identified from environment
and yield status and control the system automatically in view of the gathered data.
To monitor the environment inside the station. Different parameters have been
considered such as: temperature and humidity, which has been measured using
DHT11 temperature and humidity sensor, which has been be interfaced with
Arduino Board. It is a closed loop system that will execute control action to adjust
temperature, humidity, if any unwanted errors occur.
The designed system comprises on: DHT 11 sensor, Arduino Nano, XBee for
wireless communication between RTU and MTU, Relays and Fans, Serial monitor
for display the station data on it. The proteus simulator program is used to
implement the whole system which consists of the RTU and MTU, then VSPE
program is used to configure the RTU with MTU.
The obtained results show the console output under the scenario from one
station. The notification “Station one Data” on the serial monitor display
indicates that data is received as a result of change in the RTU. The console output
illustrates the positions of the sender and receiver.

ix
‫المستخلص‬
‫تم اقتراح نظام ٌجمع البٌانات من البٌئة المحٌطة والتحكم فً النظام تلقائٌا بناءا على ضوء تلك‬
‫البٌانات التً تم جمعها ‪ .‬لمراقبة الظروف البٌئٌة داخل المحطة ‪ ,‬هنالك معامالت مختلفة تم وضعها فً‬
‫االعتبار مثل ‪ :‬درجة الحرارة و الرطوبة النسبٌة والتً تم قٌاسها بإستخدام حساس الحرارة و الرطوبة‬
‫‪ DHT 11‬و الذي تم توصٌله مع بوردة األردوٌنو ‪ٌ .‬عتبر هذا النظام نظام حلقة مغلقة و الذي ٌنفذ عملٌة‬
‫التحكم لضبط درجة الحرارة و الرطوبة فً حالة حدوث أي أخطاء غٌر مرغوب فٌها ‪.‬‬
‫النظام المصمم ٌشتمل على االتً ‪:‬‬
‫حساس الحرارة و الرطوبة ‪ , DHT 11‬بوردة أردوٌنو نانو ‪ ,‬وحدة إرسال و إستقبال السلكٌة‬
‫ألجل االتصال الالسلكً بٌن المحطة ‪ RTU‬و وحدة التحكم الرئٌسٌة ‪ , MTU‬المرحالت والمراوح‬
‫‪ ,‬شاشة عرض لعرض بٌانات المحطة علٌها فً وحدة التحكم الرئٌسٌة ‪ . MTU‬تم إستخدام برنامج‬
‫المحاكاة ‪ Proteus‬لتمثٌل النظام الذي ٌحتوي على المحطة ‪ RTU‬و وحدة التحكم الرئٌسٌة ‪ , MTU‬بعد‬
‫ذلك تم استخدام برنامج ‪ VSPE‬لربط المحطة ‪ RTU‬مع وحدة التحكم الرئٌسٌة ‪. MTU‬‬
‫النتائج التً تم الحصول علٌها توضح الخرج من سٌنارٌو محطة واحدة ‪.‬‬
‫التعبٌر ”‪ “Station one Data‬الظ اهر على شاشة العرض ٌوضح أن البٌانات تم استقبالها كنتٌجة‬
‫للتغٌٌر الذي طرأ على المحطة ‪ .‬حالة الخرج توضح موقع المرسل و المستقبل ‪.‬‬

‫‪x‬‬
CHAPTER ONE
INTRODUCTION
1.1 Overview
The advancement and innovations in technology triggers the needs for
controlling and monitoring of different environmental parameters such as
temperature, humidity and CO2. The system hardware platforms are basically low-
power embedded microcontroller systems with on board sensors and analog I/O
ports for connecting the sensors. Sensor devices are placed at different locations to
collect the data and predict the behavior of a particular area with variations in
selected environmental parameters [1]. The output of each sensor is then loaded
and displayed in a serial monitor.
There are so many embedded devices to interact with environment by
connecting internet. The increment of these types of objects is achieving the
development of microcontroller based systems which are replacing old
complicated electronic circuits. By using IOT, control any electronic equipment in
homes and industries can be controlled. Moreover, read a data from any sensor and
analyze it graphically from anywhere in the world. Arduino is a microcontroller
board which works as a tiny computer. Arduino is a platform to develop an
interaction with required programming software. Arduino UNO is microcontroller
unit to fetch a data of humidity and temperature from DHT 11 sensor and process it
and give it to a ESP8266 module (Wi-Fi module). In this paper we have different
sections to trace the temperature and humidity. Section I defines the humidity and
temperature by using humidity and temperature sensor DHT11, section II reads the
DHT sensor module’s output and extracts temperature and humidity values into a
suitable number in percentage and Celsius scale, section III system displays

1
humidity and temperature on LCD, Section IV defines analyzing and designing the
system architecture, section V shows the result and future scope [2].
A greenhouse is an exceptionally outlined homestead structure building to
give a more controllable environment to better harvest generation, crop security,
product seeding and transplanting. Also, the accessible space of area for
developing yields has been altogether diminishing; following to more space of area
is vigorously utilized for housing and commercial ventures as a part of this present
day period. In most tropical nations, the utilization of greenhouse has been
developed for cost effective farming i.e. organic products, new blossoms and
vegetables generation.
The effectiveness of plant creation inside greenhouse depends fundamentally
on the conformity of ideal atmosphere development conditions to attain to high
return at low cost, great quality and low natural burden. To attain to these
objectives a few parameters, for example, light, temperature and humidity, soil
moisture must be controlled ideally given certain criteria through warming,
lighting, ventilation and water creation. Persistent checking and controlling of
these ecological variables gives significant data relating to the individual impacts
of the different elements towards acquiring most extreme harvest creation.
Greenhouse situations present remarkable difficulties to great control.
Temperature changes happen quickly and fluctuate broadly relying upon sun
powered radiation levels, outside temperatures and moistness levels in the
greenhouse.
According to the literature reviewed there were some related systems that
were designed by different researchers. Some systems were designed to predict
only temperature of an environment, some humidity and some restricted gas. The
followings are some of the reviewed works.

2
A system for remotely prediction of environmental parameters like
temperature, atmospheric pressure and relative humidity was designed by [3]. The
system uses Arduino microcontroller, sensors and an LCD display for data output.
The output is analog in nature but is presented as digital by means of analog
to digital converter interfaced with a microcontroller. Data analysis is done by the
PC with a graphical user interface.
Another system was developed for monitoring of environmental parameters
like temperatures, humidity, and quality of air. The system was implemented using
smart phones. Data was collected from sensor nodes to the destination ZigBee
network and then retransmitted to the end node using Bluetooth network [4]. A
Supervisory Control and Data Acquisition system (SCADA) was developed for
measuring and controlling of the environmental parameters like temperature,
pressure and humidity remotely by using an integrated wireless SCADA system. It
uses GPRS based mobile network to display it predicted data using LCD screen.
The major setback recorded by this work was it dependence on large
infrastructure for implementation [5]. A prototype product of a Web Based
Temperature Monitoring System was developed; it allows the users to monitor the
temperature condition of particular environment. Hardware and C programming
language as a software specifications and an active Server Page (ASP) scripting
language was used as the server side scripting to make available the current
temperature at the web browser [6].

1.2 Problem Statement


Sudanese industries majorly include biomedical, agricultural and
pharmaceutical which are the pillars of country economy. The monitoring of
temperature and humidity are major areas for all these industries. Any kind of

3
unbalancing in the environmental conditions or unset parameters can create
financial loss in the productivity of pharmaceutical and agriculture industries.
The main problem of the research is monitoring of temperature and humidity
of a Greenhouse and the specific problem are:
 Changes that occur in climate parameters such as: Temperature, humidity and
light intensity.
 Greenhouse installations require a large amount of wires and cables to distribute
sensors and actuators, therefore an embedded based solution with wireless
technique can be proposed.
1.3 Objectives
The main objective of this work is to design and implement SCADA system
for monitoring temperature and humidity using Arduino board, DHT11 and XBee
modules.
The second objective is to use ZigBee protocol in the transmission of data
from RTU to MTU.
1.4 Research methodology
The proposed system has two components simulated in proteus simulators,
hardware components and software components. Hardware component are those
components that detect and organized the environment parameter e.g. Arduino
board, bread board, sensors, jumper wires, USB cable for connecting Arduino
board with computer. Then second component is Arduino software which tells
what hardware component of Arduino to do. The software has an environment in
which codes are typed and edited. Initially, the hardware connection is made and
deployed, the connection in environment surfaces to detect the temperature and
humidity, while a program codes extract and organize data from the sensors,
manage it and display variations in the environmental parameters.

4
Sensor devices are placed at different locations to collect the data and predict
the behavior of a particular area with variations in selected environmental
parameters, the output of each sensor is then loaded and displayed in a serial
monitor. The program in Arduino IDE uses looping i.e. a particular program will
keep on iterating until it has been terminated.

1.5 Thesis Layout


Thesis consists of five chapters. Chapter 1 introduces basic overview,
methodology, objectives and approach for this work. Chapter 2 deals with the
necessary background. This includes basics of SCADA technology and its features
related to environment monitoring, this chapter covers the SCADA and the related
methods. Chapter 3 explains the structure and functionalities of the software and
discusses a use case. Chapter 4 introduces the results. Chapter 5 concludes the
thesis with summary of the entire project and possibilities of future research.

5
CHAPTER TWO
LITERATURE REVIEW
2.1 Introduction
The supervisory control and data acquisition (SCADA) system is generally
considered a necessary part of monitoring and control for large processes,
including oil and gas production, paper manufacturing, and power generation. The
system often consists of hardware architecture and a software package. From the
hardware perspective, the system mainly includes remote terminal units (RTUs)
and master terminal units (MTUs). The core part of a RTU is a programmable
controller (PC), such as micro-processor or single-board computer. RTUs are
responsible for acquiring remote data from sensors or other data sources and
implementing control strategies. MTUs are in charge of handling data processing
and human-machine interaction [2]. The RTUs are connected to MTUs with
SCADA system communication channels, as shown in the figure 2.1

Figure 2.1: General SCADA System Architecture


6
The software package contains scripts running on PLCs, programs and
databases on MTUs, as well as graphical user interface (GUI) for human-machine
interaction. The software package should be designed to satisfy all kinds of
customized needs and to achieve predefined functionalities. However, with the
popularity of World Wide Web (WWW), there is an increasing need for SCADA
systems to incorporate web-based GUIs for access via Internet [7].

2.2 Remote Terminal Unit


RTUs are an essential part for achieving distribution automation in SCADA
systems. They collect in-field data from analog or digital sensors and other data
sources at each remote site and send data back to MTUs via a communication
system. They are also in charge of outputting analog or digital signals to actuators
to realize feedback control.
However, traditional RTUs often do not have the ability to do calculations
and only support a limited number of communication protocols. They are like
human beings who have eyes, ears and hands, but no heart. Therefore, data storage,
processing, and calculations have to be done on MTUs. This brings a lot of
potential risks and issues such as control dropout when communication between
RTUs and MTUs fails and the efficiency of feedback control is constrained by
network speed, load, and throughput.
Following the rise of PLCs such as micro-processors or single-board
computers, RTUs are more likely to include PLCs to reduce overall product cost,
improve exibility and enhance performance, because it is possible to off-load the
communication channel and the MTUs by performing calculations locally.
Early PLCs are normally programmed in a visual language called ladder
logic, whereas recent micro-processors and single-board computers support
advanced programming languages such as C, C++, and Python. These newly-
7
developed instances of RTUs are essentially PC systems with CPUs, random
access memory, nonvolatile memory, I/O ports, analog-to-digital converters, and
network infrastructure, minimizing the learning curve for engineers who are
already experienced with desktop PCs.

2.3 Master Terminal Unit


MTUs, also known as data servers, host computers, or base stations, are an
indispensable part of modern SCADA systems. They connect through
communication protocols to RTUs for data and information exchange. Modern
MTUs are essentially reliable industry computers which gather data from RTUs,
store data, and host service for human-machine interaction. In certain cases, MTUs
also need to process data and give feedback control signals to RTUs.
Recent SCADA systems often have both database servers and application
servers for MTUs.
RTUs are regarded as clients and provide information and resources required
by servers. Database servers typically contain a relational database management
system (DBMS) such as MySQL, Oracle, SQL-Server, or Access that is used for
storing a huge amount of field data and supporting a variety of user queries [7].
With hundreds of thousands of sensors generating data continuously, cloud
storage and cloud computing might be introduced to future SCADA systems to
provide solutions in the cloud environment. Application servers are required to
provide human-machine interaction services such as data monitoring and manual
control.
Both servers have to deal with access control management to serialize access
to shared resources by multiple clients [7].

8
2.4 Communication Channel
RTUs and MTUs are interconnected through a variety of communication
channels, which will constrain the speed and security at which data acquisition and
control can be performed [6]. These channels typically include radio links, leased
lines, phone lines, fiber optics, cables, and/or a combination of these techniques[7].
Special attention should be paid to the revolution of WWW since the late
1990s [7]. Ethernet TCP/IP, the backbone of WWW, has been preferred by modern
SCADA systems to overcome the limitations of analogue communications and to
be more flexible in terms of expansion and reconfiguration [7].
Emerging wireless technologies and deep research in wireless sensor
network (WSN) make it possible to build wireless SCADA systems that provide
efficient, convenient, and reliable distributed information processing and long-
distance monitoring and control [7]. Wireless network is becoming increasingly
widely used in industry for data and information exchange. Technologies include
GSM, GPRS, 3G/4G, UMTS, WiMax, MBWA, Wi-Fi, Bluetooth, ZigBee, and
UWB [7].
Especially, the move to wireless Ethernet on the basis of IEEE 802.11
standard seems to be the next generation of WWW revolution in industrial
communication networks [2], because it reduces the huge cost of wiring and
provides a high degree of convenience and mobility, wired Ethernet does.
Other considerations in SCADA system communication channels include
reliability, security, and exibility.
Several security issues have been brought to attention, including access
control, firewalls, intrusion detection, cryptography, key management, as well as
device and operating system security [3]. To increase exibility and redundancy,
communication should not be limited at the RTU-MTU level. Instead, data sharing
and forwarding are expected to happen between different RTUs [4].
9
2.5 Literature survey
SCADA is not a novel field. Before the transistor comes into the picture, old
telephone wire based systems were emerging in the field of SCADA system. By
the end of the 1950s, Westinghouse and North Electric Company developed the
first SCADA called Visicode [8]. Then it gradually developed after the invention
of the transistor which led to high power computers, minicomputers,
microprocessors, etc. A SCADA has three main parts, Master Terminal Unit
(MTU), Remote Terminal Units (RTUs) and Human Machine Interface (HMI).
Many SCADA systems are developed in the world for monitoring and
controlling purposes. Although this topic covers a vast area, in this literature
survey, low cost and open source options are mainly discussed. There are three
primary objectives of this literature survey. The first objective is to review low-
cost conventional SCADA technologies.
Secondly, to evaluate IoT based technologies. Security of SCADA assessed
systems as the third objective.

A. M. Gurilo et al. [9] present a SCADA for a wireless sensor and actuator
networks for monitoring of critical infrastructure in a cost-effective way with
eliminating problems associated with typical SCADA. Problems that happen due to
the lack of deployment flexibility of the sensors that feed it with monitoring data.
Authors have given a solution using a gateway and a web services approach
for a web-based SCADA which can be accessed through the Internet. They have
also presented a real scenario using an open source SCADA called MANGO
physically applying to monitor an electrical grid.

10
They have identified several characteristics in a SCADA:
 Dynamism: nodes are flexible and mobile, and that has to be easily added
and removed through less wiring.
 Retrofit: addition of new technology or features to older systems.
 Ease of installation: sensor should not need a separate energy source.
 Redundancy: reliability is one of the one of the key feature that needs to be
added into SCADA system.

Additionally, they have defined some challenges associated with developing a


SCADA system as:
 Real-time communications.
 Management support.
 Security.

2.6 Low-cost SCADA system


2.6.1 Low-cost hardware
2.6.1.1 PIC microcontroller based system:
G.D. Andreescu. [10] presents a SCADA system with low-cost elements
such as PIC18F4620 microcontroller, GSM modem, Ethernet controller, RTC
board, digital thermometer and an LCD. In the proposed solution remote
commands and monitoring are enabled by using two solutions:
1) GSM/3G Short Message Service (SMS) / phone calling or
2) The web page hosted by the PIC microcontroller. AT commands are used to
control the GSM modem.

11
Although PIC microcontrollers are lower in costs, it is much difficult to
handle PIC microcontroller compared to an Arduino. And it is also challenging to
interface devices to PIC compared to Arduino.

2.6.1.2 ESP8266 based system:


Design of a remote control plug using ESP8266 module is presented by Y. P.
Zhang et.al. [11] Since the concept behind IoT is to connect every sensor and
actuator to the internet through an IP address, this project can be treated as a start.
Though remote controlling of a plug is not a new concept, this design can be
treated as a vital solution with an application of ESP8266 and home appliances
plugged in smart plug, as people can control devices anytime anywhere. Wi-Fi
module is essential to the whole IoT services because existing approaches mainly
deal with aspects and issues related to connectivity and communication.
ESP12E can be considered as one of the emerging trends due to the IoT
architecture and low-cost nature of ESP8266. However, this paper narrow down
the applicability of ESP8266 for a home application where it has a vast span of the
application domain. This device can be used as a server itself as well as a client.

2.6.1.3 Arduino Based systems


A SCADA system to visualize and monitor the status of a critical
infrastructure system has been presented in [12]. This potential has given rise to
the concept of a web-based controlling to allow end users to access and color
recognition is used. The proposed system in this paper is developed using Arduino
microcontroller board.
Although Arduino and web-based systems are much more superior

12
compared to PIC based systems, novel Arduino plus IoT based systems play much
more superior role compared to the web-based system [11].

2.6.2 Low-cost server


LabVIEW and Simulink based implementations S. G. Hegde et. al. [13]
introduce a low-cost SCADA which behaves as a Remote Terminal Unit (RTU)
and helps in gathering the data from the PLC.
In their approach, they have following steps:
 The remote terminal unit will collect data from a series of PLCs and make a
database of the received data.
 This data is then sent to a server with the help of ZigBee. The necessary
factors are also shared with the help of a Bluetooth module.
 It is done using LabVIEW with including low-cost hardware devices such as
the ZigBee, Bluetooth, GSM/GPRS module and an LCD.

A. Soetedjo et al. [14] present data acquisition systems which are


technologically advanced to monitor the wind speed, solar irradiation, and PV
temperature based on a low-cost AVR microcontroller. This project is also a one of
the example for a low-cost SCADA system which uses a low-cost PV module
other than an expensive pyrometer.
When analyzing used software and hardware:
 The integrated-circuit (IC) temperature sensor LM35 and a cup-type
anemometer are used to measure the temperature and the wind speed
respectively.
 LabVIEW is used to develop the control algorithm.

13
 Instead of a desktop computer they have used a microcontroller to store data
in a serial EEPROM.
 Modbus is used as the protocol for communication between DAQ and other
devices.

They also present a framework of Intranet-SCADA using LabVIEW based


data acquisition and management. It describes a configuration of RTU to access
and transmit real-time data over the Intranet or Internet. LabVIEW based program
is developed to control the water level in a reservoir. In this paper, cost of
LabVIEW not being taken into account. Though it is straightforward to implement
LabVIEW based systems are expensive compared to other low-cost approaches.

Using Open source SCADA software Grilo A. Met. al. [9] present, a web
based SCADA software called Mango is used. A SCADA system using WSANs to
visualize and monitor the status of a CI system has been presented. Some of the
common challenges existing in these systems: real-time, management and security
are addressed in the paper [9].

The main drawback of using a standard SCADA software is that those only
communicates using several protocols, and it is difficult to customize the protocol
without a specific training on the system [15].

2.6.3 IOT based SCADA systems


An agent-based distributed SCADA system is presented by B. T. Sergi et al.
[16] and it is a proposal to integrate Public Key Infrastructure (PKI) functionalities,
concerning on distributed features, into Industrial Control Systems (ICS).

14
To implement several agents are defined such as interface agent, agent
controller, instrument agent, process agent and host agent. Since it has agent-based
architecture, it can also be considered as a multi-agent based SCADA that having a
lot of features.
Additionally, they have shown how a Public Key Infrastructure could be
built with distributed elements to be used within a distributed control system. Plus,
in the end, the discussion of security threats because of Multi-Agent system for a
SCADA is briefly discussed.

C. Felipe et al. [17] introduce a wireless communication system related


sensor concept that deals with temperature variations during the scaled industrial
process.
There is access to these sensors from anywhere since these sensors are used
IoT technology.
The PLC executes according to the set points of temperature sensors, and
this PLC can be contact or control via a graphical programming platform using
which sensor data has been collected into a cloud. This system uses a SCADA to
monitor the system. Also, the system communicates by forming of Petri nets which
acts according to discrete events and the software used to model that
communication system is WoPeD software.

2.6.3.1 Thingspeak based SCADA


Due to open source nature of the thingspeak server, many researches are now
being conducted using the thingspeak server.
In their project work author uses the IOT thingspeak web server which is an
open API service that can be used with sensors to monitor the sensed data at cloud
level and amalgamated [18]. A unique feature of getting the sensed data to the
15
MATLAB R2016a utilizing a channel ID and read API key that is assigned by
services and able to track data value at particular intervals. This project uses an
Arduino UNO board, ESP8266 Wi-Fi Module that helps to process and transfer the
sensed data to the thingspeak cloud.
The main drawback of using thingspeak.com server is that it only allows
user to upload data at very low frequency, where the user can supply data for each
15 S. But when the same server is installed locally it will enable the user to upload
data at any frequency [18].

2.7 Security of SCADA systems


Z. Bonnie et al. [19] present the differences between SCADA systems and
standard IT systems and also discussed how to identify the danger engaged with
the SCADA and how to protect SCADA. This paper has presented set of security
property goals as well.
Also, this article describes the way of identifying possible cyber-attacks like
cyber induced cyber-physical attacks on SCADA and how to measure and
safeguard SCADA system from such attacks by measuring the impact on SCADA.
Moreover, this gives a comparison between SCADA and traditional IT
networks. Authors have set several security goals or features that should be
included in a SCADA system:
 Security property goal.
 Timeliness - the time-criticality of the control system.
 Availability - equipment within the system should be ready for use when is
needed.
 Integrity - data within a SCADA system being genuine and intact without
unauthorized intervention.

16
 Confidentiality - unauthorized person should not have any access to
information.
 Graceful Degradation - Isolation of attacked without being spreading.
 Trust model - the underlying physical security is provided. Notably, the
SCADA server or Master Terminal Unit (MTU) is physically secure, i.e., we
assume there is no direct physical tempering on the server where the central
control and estimation algorithms reside.
 Threat Model - threats to sensor networks and to conventional IT systems
are also threats to SCADA system.
Hasan et al. [20] give an overview of Trust systems used for SCADA system
which includes fire-walling and network intrusion detection functionalities. Also,
TRUST system can monitor incoming and outgoing traffic as well. However, to
lowering both capital and operational costs, only the essential nodes have been
connected to the system, and those nodes are called TRUST nodes. From the point
of network topology, this paper has discussed forming the trust network also has
achieved to build up a method to protect SCADA while connecting a minimal
number of nodes.
In that case, to distribute the nodes and to measure the geographical
dispersion, network segmentation approach and the minimum spanning tree (MST)
methods has been used.

17
2.8 Components used in SCADA technology
2.8.1. Xbee module
The Xbee family of embedded RF modules (from Digi International)
provides OEMs with a common footprint shared by multiple platforms, including
multipoint and ZigBee/Mesh topologies, and both 2.4 GHz and 900 MHz
solutions. For this project, considering the needs for low cost, low power, self-
healing and networ discovery and interopera ility it s necessary to wor with the
Xbee S2 modules.
The Xbee module is shown in the figure 2.2

Figure 2.2: Xbee module

The Xbee ZB and Xbee-PRO ZB ZigBee will the RF module to use, since its
firmware implements the ZigBee protocol. Some of the features given by the
manufacturer are depicted in Table 2.1

18
Table 2.1. Xbee RF module specifications
Specifications Xbee RF Module Value

Performance

Indoor / Urban range

Outdoor range LOS

Transmit Power Output

RF data rate

Receiver Sensitivity
Power
Supply voltage 2.1-3.6 V
Operating Current (RX) 35 – 40 mA

Operating Current (TX) 38 – 40 mA


Idle Current 15 mA
Power down current 1 mA
General

Operating Band ISM 2.4 GHz


Supported topologies Point-to-point, point
to multipoint, P2P
and Mesh
Number of Channels 16

The parameters of this module can be set via AT commands or via API, by
using the free software X-CTU.

19
2.8.1.1. Transparent Mode
The module act as a serial line replacement. All UART data received
through the DIN pin is queued up for RF transmission. When RF data is received,
the data is sent out through the DOUT pin. The module configuration parameters
are configured using the AT command mode interface.

2.8.1.2. API Mode


API (Application Programming Interface) mode is a frame-based method for
sending and receiving data to and from a radio's serial UART. The API is an
alternative to the default transparent mode.
When in API mode, all data entering and leaving the module is contained in
frames that define operations or events within the module. API operation facilitates
the following:
 Change the radio parameters without entering Command Mode.
 Receive success/failure status of each transmitted RF packet.
 Identify the source address of each received packet and view the RSSI.

As an alternative to Transparent Operation, API Operations are available.


API operation requires that communication with the module be done through
a structured interface (data is communicated in frames in a defined order). The API
specifies how commands, command responses and module status messages are
sent and received from the module using a UART Data Frame.

20
2.8.1.3. Xbee Operation Modes
a) Idle Mode
When not receiving or transmitting data, the RF module is in Idle Mode. The
module shifts into the other modes of operation under the following conditions:
 Transmit Mode (Serial data in the serial receive buffer is ready to be
packetized).
 Receive Mode (Valid RF data is received through the antenna).
 Sleep Mode (End Devices only).

b) Transmit Mode
When serial data is received and is ready for packetization, the RF module
will transmit the data. The destination address determines which node will receive
the data. When data is transmitted from one node to another, a network-level
acknowledgement is transmitted back across the established route to the source
node. This acknowledgement packet indicates to the source node that the data
packet was received by the destination node. If a network acknowledgement is not
received, the source node will re-transmit the data.

c) Receive Mode
If a valid RF packet is received, the data is transferred to the serial transmit buffer.

d) Sleep Mode
Sleep modes allow the RF module to enter states of low power consumption
when not in use. The Xbee RF modules support both pin sleep (sleep mode entered
on pin transition) and cyclic sleep (module sleeps for a fixed time).

21
2.8.2. Arduino
Arduino is an open-source project that created microcontroller-based kits for
building digital devices and interactive objects that can sense and control physical
devices. It supports the languages C and C++. It is able to read inputs - light on a
sensor, a finger on a button, or a Twitter message - and turn it into an output -
activating a motor, turning on an LED, publishing something online.
Arduino has some benefits: Inexpensive, Simple, Open source and extensible
software and hardware.
The Arduino Uno is shown in the figure 2.3

Figure 2.3: Arduino Uno

2.8.3 Relay
A relay is an electromechanical device that is actuated by an electrical
current.
The current flowing in one circuit causes the opening or closing of another
circuit. Highly sophisticated relays are utilized to protect electric power systems
against trouble and power blackouts as well as to regulate and control the

22
generation and distribution of power. In the home, relays are used in different
appliances like refrigerators, washing machines and dishwashers, and heating and
air-conditioning controls. Every relay contains a sensing unit, the electric coil,
which is powered by AC or DC current. When the applied current or voltage
exceeds a threshold value, the coil activates the armature, which operates either to
close the open contacts or to open the closed contacts.
When a power is supplied to the coil, it generates a magnetic force that
actuates the 6 switch mechanism. The magnetic force is, in effect, relaying the
action from one circuit to another. The first circuit is called the control circuit
while the second is called the load circuit.
The Relay module is shown in the figure 2.4

Figure 2.4: Relay module

2.8.3.1 Types of Relays


There are two basic types of relays: Electromechanical and Solid State.
Electromechanical relays have moving parts, whereas solid state relays have
no moving parts. Advantages of Electromechanical relays include: lower cost, no
heat sink is required, multiple poles are available, and they can switch AC or DC
with equal ease.

23
a) Electromechanical Relays General Purpose Relay
The general-purpose relay is rated by the amount of current its switch
contacts can handle. Most versions of the general-purpose relay have one to eight
poles and can be single or double throw. These are found in computers, copy
machines, and other consumer electronic equipment and appliances. Power Relay:
The power relay is capable of handling larger power loads –10-50 amperes or
more.
They are usually single-pole or double-pole units. Contractor: A special type
of high power relay, it’s used mainly to control high voltages and currents in
industrial electrical applications. Because of these high power requirements,
contactors always have double-make contacts. Time-Delay Relay: The contacts
might not open or close until sometime interval after the coil has been energized.
This is called delay-on-operate. Delay-on-release means that the contacts
will remain in their actuated position until some interval after the power has been
removed from the coil. A third delay is called interval timing. Contacts revert to
their alternate position at a specific interval of time after the coil has been
energized. The timing of these actions may be a fixed parameter of the relay, or
adjusted by a knob on the relay itself, or remotely adjusted through an external
circuit.
b) Solid State Relays
These active semiconductor devices use light instead of magnetism to
actuate a switch. The light comes from an LED, or light emitting diode. When
control power is applied to the device’s output, the light General Purpose Relay is
turned on and shines across an open space. On the load side of this space, a part of
the device senses the presence of the light, and triggers a solid state switch that

24
either opens or closes the circuit under control. Often, solid state relays are used
where the circuit under control must be protected.

2.8.4 DHT11 Temperature Sensor


The DHT11 is a basic, digital temperature and humidity sensor. It detects
temperature, humidity, heat index and other related parameters. DHT11 reads it
data in small scale and the read data is processed in two second intervals.
This module features a humidity and temperature complex with a calibrated
digital signal output means DHT11 sensor module is a combined module for
sensing humidity and temperature which gives a calibrated digital output signal.
DHT11 gives us very precise value of humidity and temperature and ensures
high reliability and long term stability. This sensor has a resistive type humidity
measurement component and NTC type temperature measurement component with
an 8-bit microcontroller inbuilt which has a fast response and cost effective and
available in 4-pin single row package.

The DHT11 sensor is shown in the figure 2.5

Figure 2.5: DHT11 sensor

25
DHT11 module works on serial communication i.e. single wire
communication. This module sends data in form of pulse train of specific time
period. Before sending data to Arduino it needs some initialize command with a
time delay. And the whole process time is about 4 ms. The single-wire serial
interface makes system integration quick and easy. Its small size, low power
consumption and up-to-20 meter signal transmission making it the best choice for
various applications, including those most demanding ones. The component is
4-pin single row pin package. It is convenient to connect and special packages can
e provided according to users’ request.

26
CHAPTER THREE
RESEARCH METHODOLOGY
3.1 Introduction
In this research, an environment monitoring system has been developed
using Arduino module.
Other hardware components of the system are the two sensors used for
temperature and humidity namely: DHT11 temperature sensor. At the core of the
software part of the system is a simple algorithm that received the readings of the
selected parameters and process them for display.

3.2 System Block diagram


As we observe in the block diagram, first one is the RTU of the field which
contains five blocks, which are as follows:
Arduino Nano, DHT11 sensor, XBee transmitter, Relays and Fans. Arduino
Nano plays an important role in the field, as it is the microcontroller used to
control the various actions performed by our device. We are using a DHT11 sensor
which will gather the readings of temperature and humidity. All this information is
transmitted towards the receiver by using the XBee transmitter.
The system design consists three sections - one senses the humidity and
temperature by using humidity and temperature sensor DHT11. The second section
reads the DHT11 sensor module’s output and extracts temperature and humidity
values into a suitable number in percentage and Celsius scale. And the third part of
the system displays humidity and temperature on MTU. The system connection is
based on single wire serial communication. First Arduino send a start signal to
DHT11 module and then DHT11 module gives a response signal containing
temperature and humidity data.

27
Arduino collect and extract in two parts one is humidity and second is
temperature and then long term stability. This sensor has a resistive type humidity
measurement component and NTC type temperature measurement component with
an 8-bit microcontroller inbuilt which has a fast response and cost effective and
available in 4-pin single row package. DHT11 module works on serial
communication i.e. single wire communication.
This module sends data in form of pulse train during a specific time period.
Before sending data to Arduino it needs some initialize command with a
time delay. And the whole process time is about 4 ms. First of all, Arduino sends a
high to low start signal to DHT11 with 18 μs delay to ensure DHT’s detection.
And then Arduino pull-up the data line and wait for 20-40 μs for DHT’s response.
Once DHT detects a start signal, it will send a low voltage level response
signal to Arduino of time delay about 80 μs. And then DHT controller pull up the
data line and keeps it for 80 μs for DHT’s arranging of sending data. When data
bus is at low voltage level it means that DHT11 is sending response signal. Once it
is done, DHT again makes data line pull-up for 80 μs for preparing data
transmission. The length of high voltage level signal determines whether data bit is
“0” or “1”.
One important thing is to make sure pull-up resistor value because if we are
placing DHT sensor at < 20-meter distance, 5 k pull-up resistor is recommended. If
placing DHT at longer the 20 meter then use appropriate value pull-up resistor.

28
The block diagram of RTU is shown in the figure 3.1

DHT11 Sensor XBee Module

Arduino Nano

Relays Fans

Figure 3.1: RTU

On the receiver side the Xbee receiver is used to catch the signal and give to
the microcontroller. This microcontroller will read the signal and display the
message on the display.

The block diagram of MTU is shown in the figure 3.2

XBee Module Display


Arduino Nano

Figure 3.2: MTU

29
3.3 Circuit Diagram
The circuit diagram of MTU is shown in the figure 3.3

Figure 3.3: MTU circuit diagram

30
The circuit diagram of RTU is shown in the figure 3.4

Figure 3.4: RTU circuit diagram

31
3.4 System Flowchart
The system flowchart is shown in the figure 3.5

Start

System Initialization

XBee configuration

Read RTU Parameters

Send RTU Data to MTU

Display Data

Yes
Satisfied
?
No

Send Control signal for Fans

End

Figure 3.5: System Flow chart

32
CHAPTER FOUR
RESULTS AND DISCUSSION

4.1 Introduction
In this section the results of the prototype communication model are
analyzed based on the signal received at the receiver due to many cases. The
comparison of many scenarios is also performed.
In order to verify the proper operation of prototype, a common scenario was
designed to simulate variety of applications. Through the diverse landscape the
need for suitable simulation environment for frees space and urban canyon effects
should be employed.
The different scenarios considered for the simulation are as follows:
 Temperature monitoring.
 Humidity monitoring.
 Fan control.

This chapter explains several tests in order to evaluate data communication.


First, performing communication between the Xbees, and after that, performing
communication among Arduinos via wireless.

4.2. Communication Test


In order to make this test, two scenarios were taken into account:
 Xbee to Xbee: this is a communication via radio between the two modules.
 Arduino to Arduino: this is basically running a simple sketch in the Arduino
microcontroller that sends a message via serial to the Xbee, and this one

33
transmit it via radio to the receiver Xbee which subsequently sends this
message via serial.

4.2.1. Xbee to Xbee


First, with the X-CTU software, one Xbee was configured as a coordinator
and named “C”, and the other Xbee was set as a router and labeled “R2”. The
message from R2 to C was created with the packet assembler tool from the
software and is: “Hola C” and the message from C to R2 will e “Hola R2”.
For this purpose, we used the Arduino board as a Xbee adapter to configure it, in
order to use the X-CTU software features PAN ID and Operating channel on router
must match with the coordinator in order to be in the same network and ensure
communication.
Figure 4.1 shows the Xbee to Xbee Configuration.

Fig. 4.1: Xbee to Xbee Configuration


4.2.2. Arduino to Arduino
34
Now, for this test, both microcontrollers were placed again on the Arduino
boards and a simple sketch with a message was programmed on the Router board.

4.2.3. Data Transmission


The message that Arduino end node will send to the Coordinator will be:
” XX ºC, HmHm at node YY”, where XX represents the value of the varia le
measured (Temperature) and YY is the node identification, which can be LED or
R2. The Coordinator will receive an API frame like the one shown.
Unlike AT mode, API mode you can take advantage of the following:
 Acknowledgement (ACK) and Retries. When sending a packet, the
transmitting radio receives an ACK, indicating the packet was successfully
delivered. The transmitting radio will resend the packet if it does not receive
an ACK.
 Receive packets (RX), contain the source address of the transmitting radio.
 Configure a remote radio with the remote AT feature, among other features.

The entire frame has 37 bytes long, which includes: control headers,
payload, delimiter and checksum, each field of the API frame will be described
below:
 Start delimiter: 7E, which is useful to indicate the Xbee that a new frame has
arrived.
 Length: 37, refers to the number of bytes between length and checksum
fields.
 Frame type: 90, is the code for a received packet.
 64-bit source address: is the MAC address of the sender.
 16-bit source address: is the sender network address.

35
 Receive options: a 01 indicates that packet has been acknowledged.
 Received data: the message sent from the end device and received by the
coordinator.

Now, considering that a transmission event lasts 4 ms, this will be enough
information in order to obtain the real data rate.

(4-1)

Now, replacing data on (4.1):

(4-2)

Finally, focusing only on the payload of the frame, which is 24 bytes long,
then the data rate will be reduced to:

(4-3)

Both results in equations (4-2) and (4-3) are far away from the theoretical
data rate for Xbee devices which is 250 kbps.

36
4.3 Scenario from one Station
The figure 4.2 below shows the console output under the scenario from one station. Here the distance
between the sender and receiver is maintained reasonable. The notification “Station one Data” indicates that data
is received as a result of change in the RTU. The console output illustrates the positions of the sender and receiver.
The scene for the above scenario is shown in the figure 4.2.

Figure 4.2: Scenario from one station

37
In real application the amount of power transmitted and received is largely
dependent on the directional antenna mounted on the roof top.
Once the direct LOS is obstructed by buildings, reflections and diffractions
become predominant propagation mechanisms. The amount of power received due
to reflection and diffraction reduces with increase in the orientation angle of
directional antenna.

38
CHAPTER FIVE
CONCLUSION AND RECOMMENDATIONS
5.1 Conclusion
First of all, the state of the art in SCADA technologies was reviewed, and
among a broad amount of options to implement, based on criteria of low cost, easy
implementation, documentation, distance range, mesh networking, then it was
decided to use ZigBee (Xbee). Then we decided to work with Arduino
hardware/software, because every board costs, it is also easy to implement, the IDE
is programmed in C language an even more important.
Following that, communication tests were performed-on a first hand, it was
made a Xbee to Xbee test, and second, an Arduino to Arduino test via wireless,
aided by the Xbees- in order to ensure that data sent by RTUs was effectively
received by the MTUs for further processing or analysis.
This project meets with all of the objectives set. The system was designed to
receive the data sent by RTUs.
This project can be considered as a small step for creating a campus weather
station, or also to create a control and monitoring system for crops water irrigation,
that can be very useful for agriculture students in the campus as well or preventing
the risk of fire in determined times of the year.
There’s still a lot to work in the field of SCADA technology, since it has an
enormous potential to improve outdoor control systems and quality of life of
citizens within a called smart city for instance: the development of low-power
communication hardware, low-power microcontrollers, MEMS based sensors and
actuators, and energy-scavenging devices is necessary to enhance the potential and
the performance of sensor networks.

39
5.2 Recommendations
For future work, there are several fields of action and improvements that can
be carried out, there as follows:
 In order to better access data obtained during measurement actions, a web
server and a mobile web app can be developed.
 It is a very good option to make a graphic interface that shows in real time
the evolution of the values measured for every single node.
 Topics like security in SCADA communications were not addressed, and
for future investigations it can be proposed to study a method of secure
encryption of information.

40
References
[1] V. Anupriya, A. Manimozhi, D. Nivetha, P. Nivethitha,“Smart Environmental
Monitoring System Using La view”,International Journal Of Engineering And
Computer Science ,Vol. 6, no. 3, pp. 20705–20709, 2017.
[2] E. Gertz and P. Di Justo, “Environmental Monitoring with Arduino”, First
Edition. Calfornia: O’Reilly, 2012.
[3] K. A. Noordin, C.C. Onn and M. F. Ismail, “A Low-Cost Microcontroller-
based Weather Monitoring System”, CMU. Journal, Vol. 5(1), pp. 33, 2006.
[4] S. Choudhury, P. Kuchhal, and R. Singh, “ZigBee and Bluetooth Networ
ased Sensory Data Acquisition System”, Procedia - Procedia Comput. Sci., vol.
48, no.
, December 2015.
[5] O. D. Chinenye and O. Kingsley, “Design of a Supervisory Control and Data
Acquisition System for Monitoring Temperature and Light Intensity of a
Workstation”, American Journal of Engineering Research (AJER), Vol. 6, no. 8,
pp. 331–337, 2017.
[6] M. Kassim, M.N. Ismail and C.K.H. Che Ku Yahaya, “A We Based
Temperature Monitoring System 1 1”, International Journal of Multidisciolinary
Sciences and Engineering, Vol. 2, No. 1, pp. 17–25, 2011.
[7] J. Bedard, I. Inc, and R. Sanders, “Temperature and humidity monitoring
systems for fixed storage areas”, Geneva, 2014.
[8] Ujvarosi, Alexandru, “EVOLUTION OF SCADA SYSTEMS”, Bulletin of the
Transilvania University of Brasov, Vol. 9, 2016.
[9] A. M. Gurilo, J. Chen, D. Garrido and A. Casaca,“An Integrated WSAN and
SCADA System for Monitoring a Critical Infrastructure”, IEEE Transactions on
industrial informatics, 2014.

41
[10] G.D. Andreescu, G.E Horatiu, “SCADA element solutions using Ethernet and
mobile phone network”, IEEE 9th International Symposium on Intelligent Systems
and Informatics, pp. 303-308, Serbia, 2011.
[11] P. Zhang, T.Lui, X.Yang , Y.Mou, Y.H. Wei and D.chen, “Design of remote
control plug” , IEEE International Conference on Applied Superconductivity and
Electromagnetic Devices , 2015.
[12] S. Sanap, R. Nawale , S. Kapse, A.Kale and M. Korde, “ Exact virtualization
of Industrial Environment on Web Using SCADA with Artificial Intelligence”,
International Conference on Noida, pp. 99-103, 2015.
[13] S.G. Hegde, S.R. Desai, D.r. Gajanan, S.B. Kowligi and Sachin RC,
“Implementation of SCADA in industries using wireless technologies”,
IEEE international Conference, India, 2015.
[14] A. Soetedjo, Y. I. Nakhoda and D. Suryadi, “Development of data acquisition
system for hybrid power plant”, QiR (Quality in Research) International
Conference
on, Yogyakarta, 2013.
[15] J. L. Sarinda, T. lqbal and G. Mann, “Low-cost and open source SCADA
options
For remote control and monitoring of inverters”, IEEE 30th Canadian Conference
on
Electrical and Computer Engineering (CCECE), PP. 1-4, Windsor, 2017.
[16] Sergi Blanch- Torn, Fernando Cores, Ramiro Moreno Chiral, “Agent – based
PKI for Distributed Control System”, World Congress on Industrial Control
System

42
Security (WCICSS-2015), pp. 28-35 , 2015.
[17] Felipe. C, Yesion. C , Leonardo. R, “Wireless Sensor System According to the
Concept of IoT – Internet of Things”, International Conference on Computational
Science and Computational Intelligence, 2014.
[18] S. Pasha, “Thingspeak Based Sensing and Monitoring System for IoT with
Matlab Analysis”, International Journal of New Technology and Research (IJNTR)
, Vol. 2 , pp. 19-23, 2016.

[19] Bonnie Zhu, Anthony Joseph, Shankar Sastry, “A Taxonomy of Cyber


Attacks on SCADA Systems”, IEEE International Conferences on Internet of
Things, and Cyper, Physical and social Computing, 2011.
[20] M. Hasan and H.T. Mouftah, “Optimal Trust System Placement in Smart Grid
SCADA Networks”, IEEE Access, 2016.

43
Appendix

44
Arduino Code for one Station:

#include "DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT11 // DHT 11

DHT dht(DHTPIN, DHTTYPE);

void setup() {
Serial.begin(9600);
Serial.println("//*** Station one Data***//");
pinMode(3,OUTPUT);pinMode(4,OUTPUT);
dht.begin();
delay(2000);
}

void loop() {
delay(500);
Serial.println("//*** Station one Data***//");

float h = dht.readHumidity();
float t = dht.readTemperature();

if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
if (t>=40.0)
{
digitalWrite(3,HIGH);
//delay(2000);
}
if (h>=70.0)
{
digitalWrite(4,HIGH);

45
Serial.print("Hum1: ");
Serial.print(h);
Serial.print("\t \t");
Serial.print("Temp1: ");
Serial.print(t);
Serial.println(" *C ");
Serial.println(" \n");
if (Serial.available()>0) {
int x = Serial.read();
if (x=='a')
{
digitalWrite(3,HIGH);
//delay(2000);
}
if (x=='b')
{
digitalWrite(4,HIGH);
}
if (x=='z'&&h<70.0)
{
digitalWrite(4,LOW);
}
if (x=='z'&&t<40.0)
{
digitalWrite(3,LOW);
}

// else
// { digitalWrite(3,LOW); digitalWrite(4,LOW);}

}
}

46

You might also like