Abstract .................................................................................................................................................. 3 Introduction............................................................................................................................................ 4 What is SCADA? .................................................................................................................................. 4 How does SCADA work?...................................................................................................................... 4 SCADA is Electric Distribution ............................................................................................................. 4 Block Diagram ..................................................................................................................................... 5 Block No.1 ....................................................................................................................................... 6 Block No.2 ....................................................................................................................................... 6 Main Block ...................................................................................................................................... 7 Flow Diagram of Block No.1 and No.2 ................................................................................................ 8 Circuit...................................................................................................................................................... 9 Voltage Measurement ................................................................................................................... 10 Microcontroller .................................................................................................................................... 11 TM4C123G ........................................................................................................................................ 11 Arduino.............................................................................................................................................. 12 SCADA Software ................................................................................................................................... 13 SCADA for Block No.1........................................................................................................................ 14 SCADA for Block No.2........................................................................................................................ 14 SCADA for Main Control Block .......................................................................................................... 14 Overview of SCADA software............................................................................................................ 15 Tab “Main” of SCADA........................................................................................................................ 15 Connect Panel ............................................................................................................................... 15 Area Panel..................................................................................................................................... 15 Diagram Panel............................................................................................................................... 16 Tab “Load Shedding” of SCADA......................................................................................................... 16 Area load shedding panel ............................................................................................................ 17 Tab “Graph” of SCADA ...................................................................................................................... 17 Database of SCADA ........................................................................................................................... 18 Wireless Communication of SCADA.................................................................................................. 19 Code ...................................................................................................................................................... 20 Code for TM4C123G.......................................................................................................................... 20 Code for Arduino............................................................................................................................... 242 Code for “Block No.1” SCADA ........................................................................................................... 25 SCADA.java.................................................................................................................................... 25 panel_Area1.java .......................................................................................................................... 25 panel_Areas.java........................................................................................................................... 27 panel_for_tab_1.java ................................................................................................................... 28 panel_ for_tab_2.java .................................................................................................................. 29 panel_ for_tab_3.java .................................................................................................................. 29 panel_Serial_Connect.java ........................................................................................................... 30 panel_Current_Graph.java .......................................................................................................... 31 panel_Voltage_Graph.java ........................................................................................................... 32 panel_tab2_Area1.java................................................................................................................. 32 Thread_Socket.java....................................................................................................................... 35 Thread_Database.java .................................................................................................................. 37 Thread_Diagram_Refreshing ........................................................................................................ 39 Thread_Receiving_Comm............................................................................................................. 39 Thread_Sending_Comm ............................................................................................................... 41 panel_Diagram.............................................................................................................................. 41 Reference............................................................................................................................................. 433 Abstract A model of automation of electric distribution using SCADA (supervisory control and data acquisition). There are 3 consumption areas Area1, Area2 and Area3. Area1 is controlled by a SCADA software running on a laptop, similarly Area2 and Area3 are controlled by another SCADA software running on another laptop. A third laptop is also placed for controlling all the three areas wirelessly through internet, thus acting as a master remote control. SCADA software is coded in java. Communication between the consumption Areas and SCADA software on laptop is carried through microcontrollers Arduino and Tiva TM4C123G. ADC (Analog to digital) modules of both microcontrollers are used for taking input from measuring devices installed in the consumption areas and this data is send to laptops by USB data cable through UART module on the microcontrollers.4 Introduction What is SCADA? SCADA (Supervisory control and data acquisition) is an industrial automation control and data gathering system at the core of many modern industries. SCADA is used for automation in almost every industry for example food, beverage, manufacturing, oil, power, recycling, transportation, agriculture etc. How Do SCADA Systems Work? SCADA systems deploy multiple software and hardware elements that allow industrial organizations to: • Monitor, gather, and process data. • Interact with and control machines and devices such as valves, pumps, motors, relays and more, which are connected through HMI (humanmachine interface) software. • Record events into a log file. 1 SCADA in Electric Distribution SCADA system for a power distribution application is a typically a PCbased software package. Data is collected from the electrical distribution system. SCADA in Electric Distribution is used for following tasks • Gathering data regarding voltage, current etc. from various regions. • Operating circuit breakers and relays in case of faults, maintenance or load shedding. • Storing data from future research on making the operation of the system better. 15 BLOCK Diagram Figure 1:Project Block Diagram6 The block diagram consists of 3 main blocks: 1) Block No.1 2) Block No.2 3) Main Control With further observation we see that “Block No.1” has “Area1”, which is a circuit model representing a consumption area. “Block No.2” has “Area2” and “Area3”, which are also circuit models representing consumption areas. 1) Block No.1 We see that “Block No.1” has “Area1”, which is a circuit model representing a consumption area. The circuit diagram of “Area1” consist of a transformer, relay, variable load, voltage and current measuring equipment. The voltage and current values from the measuring equipment of “Area1” is provided to the microcontroller “TM4C123G”. Output pin from “TM4C123G” is given to the relay in “Area1” for turning it ONOFF. “TM4C123G” is connected to a Laptop through a USB cable, from where its gets the command for the operation of relay, and to which it sends values of current and voltage of “Area1”. The laptop has a Java base SCADA software which has a GUI (Graphics User Interface) for easy use. The software displays value of current and voltages, provides a button for turning “Area1” off, shows graphical representation of current and voltages over time, provides option to turn off “Area1” for specified amount of time and also store important information regarding “Area1” in a database based on MySQL with the help of
Trang 1Table of Contents
Abstract 3
Introduction 4
What is SCADA? 4
How does SCADA work? 4
SCADA is Electric Distribution 4
Block Diagram 5
Block No.1 6
Block No.2 6
Main Block 7
Flow Diagram of Block No.1 and No.2 8
Circuit 9
Voltage Measurement 10
Microcontroller 11
TM4C123G 11
Arduino 12
SCADA Software 13
SCADA for Block No.1 14
SCADA for Block No.2 14
SCADA for Main Control Block 14
Overview of SCADA software 15
Tab “Main” of SCADA 15
Connect Panel 15
Area Panel 15
Diagram Panel 16
Tab “Load Shedding” of SCADA 16
Area load shedding panel 17
Tab “Graph” of SCADA 17
Database of SCADA 18
Wireless Communication of SCADA 19
Code 20
Code for TM4C123G 20
Code for Arduino 24
Trang 2Code for “Block No.1” SCADA 25
SCADA.java 25
panel_Area1.java 25
panel_Areas.java 27
panel_for_tab_1.java 28
panel_ for_tab_2.java 29
panel_ for_tab_3.java 29
panel_Serial_Connect.java 30
panel_Current_Graph.java 31
panel_Voltage_Graph.java 32
panel_tab2_Area1.java 32
Thread_Socket.java 35
Thread_Database.java 37
Thread_Diagram_Refreshing 39
Thread_Receiving_Comm 39
Thread_Sending_Comm 41
panel_Diagram 41
Reference 43
Trang 3Abstract
A model of automation of electric distribution using SCADA (supervisory control and data acquisition) There are 3 consumption areas Area1, Area2 and Area3 Area1 is controlled by a SCADA software running on a laptop, similarly Area2 and Area3 are controlled by another SCADA software running on another laptop A third laptop is also placed for controlling all the three areas wirelessly through internet, thus acting as a master remote control SCADA software is coded in java Communication between the consumption Areas and SCADA software on laptop is carried through microcontrollers Arduino and Tiva TM4C123G ADC (Analog to digital) modules of both microcontrollers are used for taking input from measuring devices installed in the consumption areas and this data is send to laptops by USB data cable through UART module on the microcontrollers
Trang 4Introduction
What is SCADA?
SCADA (Supervisory control and data acquisition) is an industrial automation control and data gathering system at the core of many modern industries SCADA is used for automation in almost every industry for example food, beverage, manufacturing, oil, power, recycling, transportation, agriculture etc
How Do SCADA Systems Work?
SCADA systems deploy multiple software and hardware elements that allow industrial organizations to:
• Monitor, gather, and process data
• Interact with and control machines and devices such as valves, pumps, motors, relays and more, which are connected through HMI (human-machine interface) software
• Record events into a log file [1]
SCADA in Electric Distribution
SCADA system for a power distribution application is a typically a PC-based software package Data is collected from the electrical distribution system SCADA in Electric Distribution is used for following tasks
• Gathering data regarding voltage, current etc from various regions
• Operating circuit breakers and relays in case of faults, maintenance or load shedding
Trang 5BLOCK Diagram
Figure 1:Project Block Diagram
Trang 6The block diagram consists of 3 main blocks:
1) Block No.1
We see that “Block No.1” has “Area1”, which is a circuit model representing a consumption area The circuit diagram of “Area1” consist of a transformer, relay, variable load, voltage and current measuring equipment
The voltage and current values from the measuring equipment of “Area1” is provided to the microcontroller “TM4C123G” Output pin from “TM4C123G” is given to the relay in “Area1” for turning it ON/OFF “TM4C123G” is connected to a Laptop through a USB cable, from where its gets the command for the operation of relay, and to which it sends values of current and voltage of “Area1” The laptop has a Java base SCADA software which has a GUI (Graphics User Interface) for easy use The software displays value of current and voltages, provides a button for turning “Area1” off, shows graphical representation of current and voltages over time, provides option to turn off “Area1” for specified amount of time and also store important information regarding “Area1” in a database based on MySQL with the help of WampServer
2) Block No.2
We see that “Block No.2” has “Area2” and “Area3”, which is are circuit models representing consumption areas The circuit diagram of “Area2” and “Area3” are identical to “Area1”, thus consisting of a transformer, relay, variable load, voltage and current measuring equipment each
The voltage and current values from the measuring equipment of “Area2” and “Area3” are provided to the microcontroller “Arduino” Output pin from “Arduino” is given to the relay in
“Area2” and “Area3” for turning them ON/OFF “Arduino” is connected to a Laptop through
a USB cable, from where its gets the command for the operation of relays, and to which it sends values of current and voltage of “Area2” and “Area3” The laptop has a Java base SCADA software which has a GUI (Graphics User Interface) for easy use The software displays value
of current and voltages, provides a button for turning “Area2” or “Area3” off, shows graphical representation of current and voltages over time, provides option to turn off “Area2” or
“Area3” for specified amount of time and also store important information regarding “Area2” and “Area3” in a database based on MySQL with the help of WampServer
Trang 73) Main Block
We see that there are no consumption areas in “Main Block”, only a laptop linked to the SCADA software of “Block No.1” and “Block No.2” This connection is represented by blue arrows, which show that the connection is wireless Thus the connection is made through the internet using the Sockets class of Java
The SCADA software in the laptop of “Main Block” can display value of current and voltages, provides a button for turning “Area1”, “Area2” or “Area3” off, shows graphical representation
of current and voltages over time, provides option to turn off “Area1”, “Area2” or “Area3” for specified amount of time and also store important information regarding “Area1”, “Area2” and “Area3” in a database based on MySQL with the help of WampServer Thus this provides
an overall control on all the consumption areas in the electric distribution system
Trang 8
Flow Diagram of Block No.1 and No.2
• Coded in Eclipse using Java.
• Displays Voltage & Current Values of each consumption areas.
• Option to Turn off desired Areas of a specific time.
• Displays Graphs of Voltages and Currents in each consumption areas
Database
• Coded in MySQL
• wampsever is used for storing data for each consumption area
in the local disk
• Data is added every 0.5sec.
• Data can be import to pdf, excel and other various formats.
Trang 9Circuit
There are two circuits First one represents consumption area “Area1” The second circuit represents two consumption areas, “Area2” and “Area3” The circuit of each consumption area is quite similar Each of one consist of Transformer which takes voltage from wapda and steps down After this a relay is connected in series for turning the consumption area ON/OFF
In case of relay being OFF a LED is turned ON indicating the consumption area is off The LED
is connected to NO (normally open) pin of the relay The circuit for turning on the LED is:
Figure 2: Circuit for Energizing LED
Digital output from Tiva TM4C123G is 3.3V whereas relays require 5V for operating This 5V can be obtained from node 3 of figure 2 For this we use the circuit shown in figure 3
Figure 3: Circuit for Energizing Relay
Trang 10Voltage Measurement
At node 1 the dc voltage is 17.3V to step it down to 1.65V we require a voltage bridge with the ratio of 9.5:1 Which in terms of standard resisters give the value of 430KΩ and 43KΩ Values are selected high because we only need voltage sample and want to keep in current
in divider minimum IC 7805 is placed in series to avoid voltage getting higher than 5V which would damage the microcontroller permanently
Figure 4: Voltage divider for TM4C123G
In case of voltage input for Arduino the value is set 2.5V instead of 1.65V because the maximum voltage for input in case of Arduino is 5V instead of 3.3V Which gives a ratio of 5.9:1 In case of standard resistors that can be achieved with 430KΩ and 68KΩ resistors
Figure 5: Voltage divider for Arduino
Trang 11Microcontroller
We used 2 different microcontrollers for each SCADA software The first microcontroller
“TM4C123G” is connected with “Area1” whereas the second microcontroller “Arduino” is connected to “Area2” and “Area3” Thus with the use of two different microcontrollers we are able to learn and show more versatility
TM4C123G
The TM4C123G Launchpad evaluation kit is a low-cost evaluation platform for ARM M4F based microcontrollers from Texas Instruments The design of the TM4C123G Launchpad highlights the TM4C123GHPM microcontroller with a USB 2.0 device interface and hibernation module [2]
Cortex-We used IAR Embedded Workbench as the IDE
Code for its operation is written in C language
The voltage and current values that were taken
from the circuit of consumption areas are given
to the input pins of the microcontroller The ADC
module is used for converting the incoming
analog signal into digital value ranging from 0 to
1024 The max input signal is 3.3V corresponding
to the maximum digital value 1024, and
minimum input signal is 0V corresponding to the
digital value of 0 We have selected the input as
1.65V so the digital value should be 512, thus
allowing us maximum range to measure
fluctuations in the value We have PE1 and PE2
as the two inputs for voltage and current of
“Area1” respectively
For controlling relays, we have use PB0 and PB1 as
digital output pins Depending upon the command given to the microcontroller it eithers sets the digital output pin value to 0V (OFF) or 3.3V (ON)
The commands from to the microcontroller are given from the SCADA software in the laptop which is attached to the microcontroller through a USB data cable These commands are read
by enabling and using the UART module of the microcontroller The values of voltages and current of the consumption area is also sent to the laptop by using the UART module of the microcontroller
Figure 6: TM4C123G launch evaluation kit [3]
Trang 12Arduino Uno
The Uno is a microcontroller
the ATmega328P It has 14
digital input/output pins (of
which 6 can be used as PWM
outputs), 6 analog inputs, a 16
MHz quartz crystal, a USB
connection, a power jack, an
ICSP header and a reset button
[4]
We used Arduino development
environment as the IDE Code for its
operation is written in Arduino programming language The voltage and current values that were taken from the circuit of consumption areas are given to the analog input pins of the microcontroller The analogRead() function is used for converting the incoming analog signal into digital value ranging from 0 to 1024 The max input signal is 5V corresponding to the maximum digital value 1024, and minimum input signal is 0V corresponding to the digital value of 0 We have selected the input as 2.5V so the digital value should be 512, thus allowing
us maximum range to measure fluctuations in the value We have A0, A1, A2 and A3 as the four inputs for voltage and current of “Area2” and “Area3” respectively
For controlling relays, we have use pin number 4 and 7 as digital output pins Depending upon the command given to the microcontroller it eithers sets the digital output pin value to 0V (OFF) or 5V (ON)
The commands from to the microcontroller are given from the SCADA software in the laptop which is attached to the microcontroller through a USB cable These commands are read by enabling and using the Serial class of the microcontroller The values of voltages and current
of the consumption area are also sent to the laptop by using the Serial.print() function of the Arduino
Figure 7:Arduino Uno [5]
Trang 13SCADA Software
There are three SCADA software, one for each laptop The first one is for the “Block No.1” which is configured for only “Area1” The Second one is for “Block No.2” which is configured for “Area2” and “Area3” and the third one is for “Main Control Block” which is configured for all 3 areas i.e “Area1”, “Area2” and “Area3”
SCADA for Block No.1
Figure 8:SCADA for Block No.1
Trang 14SCADA for Block No.2
SCADA for Main Control Block
Figure 10:SCADA for Main Control Block
Figure 9:SCADA for Block No.2
Trang 15Overview of SCADA Software
As you can see from figures 6, 7 and 8, all the three software are quite similar Each have 3 tabs which will be discussed in detail shortly Each Software can perform the following task
• Display Voltage & Current of consumption areas
• Display buttons for turning areas ON/OFF
• Display a Diagram showing status of each area
• Gives an option to turn OFF an area for specified time (Load Shedding)
• Plots Graphs of Voltage & Current w.r.t Readings
• Stores data for Voltages, Currents and status of relays in a database
Tab “Main” of SCADA
Figures 6, 7 and 8 show the “Main” tab of SCADA
1) Connect Panel
On the top is the connect button and a drop down menu for displaying all the active COM ports to which you can connect for serial communication between SCADA and micro controller
Figure 11: Connect Panel of SCADA
Figure 12: Area Panel of SCADA
Trang 163) Diagram Panel
On the right side of “Main” tab of
SCADA is the Diagram panel This
panel shows the status of each
area and attached relay status The
Diagram is live so it changes the
status from ON to OFF and vice
versa as soon as the relay is turned
off or the voltage in the area turns
to 0, representing fault in the area
Tab “Load Shedding” of SCADA
Figure 12 shows the tab 2 of SCADA software for “Main Control Block”
Figure 14: Tab "Load Shedding" of SCADA
Figure 13: Diagram Panel of SCADA
Trang 171) Area Load Shedding Panel
Figure 15: Area Load Shedding panel
This panel has three fields
Tab “Graph” of SCADA
Figure 14 shows the “Graph” tab of SCADA for “Block No.1”
Figure 16: Tab "Graph" of SCADA
As time passes number of readings for which the graph is plotted increases, hence increase the length of x-axis and compressing the already plotted graph to give space for new readings
to be plotted In case of SCADA software for “Block No.2” and “Main Control Block” each graph has multiple lines at one time to show voltage and current readings of all the areas
Trang 18Database of SCADA
Voltage value, current value, status of relay and Time at the moment of reading are store in MySQL database Data is store at the rate of one reading every 0.5sec The format of TimeAtMoment is dd/MM/yyyy_hh:mm:ss
Data from MySQL database can be:
Figure 17: Database of SCADA
Trang 19Wireless Communication between Blocks
We implemented wireless communication between remote locations using internet, which enables us to discard use of optic fiber wires The advantages of implementing wireless communication are:
• Optic fibers used for communication cost 10$ per meter, which is equal to 400 million Rupees for a 400 Km line Thus a large amount of money can be saved by implementing wireless communication
• Damaging and Repair issues of wiring are also discarded
• In a dense area wires add up to mess and can be difficult to maintain
Wireless communication between SCADA software is implemented using “Sockets” class of Java The “Main Control Block” SCADA acts as a host whereas the “Main Block No.1” and
“Main Block No.2” SCADA act as clients Value of voltages and currents from “Area1”,
“Area2” and “Area3” are send through a socket to the “Main Control Block” SCADA
Whereas relays can be turned ON/OFF using the “Main Control Block” SCADA Thus the
“Main Control Block” SCADA acts as a main control to overlook operation on all
consumption areas
Trang 20Code
Code for TM4C123G
#include <lm4f120h5qr.h>
#include "tm4c123gh6pm.h"
unsigned long int temp;
unsigned int val[2];
void printString(char *string);
void adc_get(unsigned int buff[2])