Você está na página 1de 57

Remote Industrial Data Acquisition,

Managing &Control System

This project is to be submitted to the Department of Engineering, COMSATS, Lahore for


the partial fulfillment of the requirement for the Bachelor’s degree in Computer
Engineering.

Internal Examiner External Examiner


Name:……………… Name:………………..
Signature:………...... Signature:……………

Department of Electrical Engineering


COMSATS, Lahore
Our work is dedicated to our families and teachers who have helped and
Encouraged us in every moment of our lives and made us able to achieve
this place.
ACKNOWLEDGEMENTS

All praises to ALLAH, the cherisher and the sustainer of the entire world, the most
gracious, the most merciful, who bestowed us with health and abilities to complete
this project in a success full manner.
We acknowledge all the teachers, friends and specially our parents who helped us not
only completing this project but also in other curriculums of our degree completion.
Once again thanks to all.
ABSTRACT

Phase-I of the project involves the acquisition of data from different sensors and logs
this into a personal computer having data base in visual basics where the data is
displayed for monitoring. Also set value defined which compares the actual data with
the set values and generates commands to control the controlling elements (in our
case relays) accordingly. So by the automatic control is achieved. The invention of
the remote control facilities the people in ordered to control their electrical and
electronics devices without manually operating them. Besides controlling the
equipment at the place of installation we have uploaded this on the internet to monitor
and control the equipment anywhere in the world.

Phase-II of the project involves the controlling and monitoring of different electronic
devices using GSM.
How It Works

The whole project will be consisting of two Phases

Phase-I

It will be consisting of Sensor-Based Data Acquisition, Monitoring & Control


System.

Phase-II

Design and Implementation of GSM-Based Monitoring & Control System.


The Phase-1 consists of six main parts
1. Sensors
2. A\D (ADC0809)
3. Microconntroller (AT89C51)
4. Max 232
5. ULN2803
6. Software
In Phase-1 Temperature sensor is used which is an analog transducer it produces a
voltage according to the temperature. it produces 10mV/1C,it can measure
temperature from(-50C to 150)voltage generated by the LM35 is analog this voltage
is given to the analog to digital converter, the A\D converter converts this analog
voltage to 8 bit binary number by Sampling, Quantization and Coding.
The A\D converter is a 28 pin IC. It can take 8 analog inputs, one at a time, and can
generate 8 bit binary number according to it. There are three pins 23(ADDR2),
24(ADDR1), 25(ADDR0), which are used to multiplex the inputs to the A\D
converter.
The program in the microcontroller sends the different combination to the address
pins of the A\D converter to select the input to the A\D converter. when input is
entered the A\D converter, the six no.(start)pin of the A\D converter is made high by
the controller, to start conversion from analog to digital. During conversion process
microcontroller monitors the EOC (End of Conversion) pin which is #9 of the A\d
converter. When it becomes high mean the analog to digital conversion is completed.
After it microcontroller sends high to OE (Out put Enable) pin of the A\D converter.
This pin is used to get out the digital information from the A\D converter this digital
output is given to the port#2 of the microcontroller. The microcontroller gets this
digital number and converts into corresponding temperature. This temperature value
is then sends to the PC through serial port using Max232.
Max232 IC is used to make compatibility between TTL and RS232standard.TTL
means transistor to transistor logic it is used in the IC mean ICs required +5v or -5v to
operate.RS232standard used in serial port of the PC. It uses high value for logic0 and
1.it uses -3 to -25 for logic 1 and 3 to 25 for logic 0.Max232 has two sides one is TTL
and other isRS232.TTL side is connected to ICs and RS232 side is connected to PC
serial port. By this compatibility between to standard is made.
There is software in the PC which is made by using Visual Basic. All the temperature
readings from different sensors are logged into the software automatically. The
software receives all the values from sensors after every second. The software shows
the current temperature and previous temperatures of all the sensors. There is also a
set point. Upper limit and lower limit options in the software. We can set the
temperature in the software in the set point option for all the sensors invidually.when
the actual temperature coming from the sensors is greater than the set point then the
software itself generated a command and send it to the microcontroller through
Max323.the relays are attached to the pot#1 of the microcontroller. according to the
signal from the PC microcontroller generated logic high to its pin of port#1.at port #1
of the microcontroller a relay driving IC ULN2803 is connected, this IC is used to
drive the relays. This has Darlington pairs in it. It provides ground path to energize
the coil of relay. And which we want to control is attached to the relays. Relay has
three contacts, common, normaly open, normally close. when p1.0 is made high by
the signal from PC then pin#1 of the ULN2803 is also high by this relay attached to
pin#28 of ULN2803 is energized because current flows through its coil, and its
contacts changes from normally closes and load attached to it become on or off
according to its connections with relay.

Block Diagram of Phase-1

Data logged is PC software can be accessed remotely by running the client program
on any PC in the world which is connected to the internet. Client software has also
the similar front panel view as host. We can also see all parameters on he remote PC
and can also change set point.
Introduction
SCADA is an acronym that stands for supervisory Control and Data Acquisition.
SCADA refers to a system that collects data from various sensors at a factory, plant
or in the other remote locations and then send this data to a central computer which
then manages and controls the data.

Supervisory Control and Data Acquisition (SCADA) is a system that allows an


operator at a master facility to monitor and control processes that are distributed
among various remote sites.

A properly designed SCADA system saves time and money by eliminating the need
for service personnel to visit each site for inspection, data collection\logging or make
adjustments, Real-time monitoring, system modifications,troubleshooting,increased
equipment life, automatic report generating . . .these are just a few of the benefits that
come with today’s SCADA system.

Other benefits SCADA systems provide:


• Reduce operational costs
• Provides immediate knowledge of system performance
• Improves system efficiency and performance
• Increases equipment life
• Reduces costly repairs
• Reduces number of man=hours(labor costs) required for troubleshooting or
service
• Frees up personnel for other important tasks
• Facilitates compliance with regulatory agencies through automated report
generating
• And more. . . . .

History of SCADA System


The development of SCDA can be traced back to the early 1900’s with the advent of
telemetry. Telemetry involves the transmission and collection of data obtained by
sensing real time conditions, the monitoring of remote condition became possible
with the convergence of electricity, telegraph, telephone, and wireless communication
technology. Throughout the last century, more industries, such as gas, electric, and
water utilities, used telemetry systems to monitor processes at remote sites.

SCADA began early sixties as an electronic system operating as input\output (I\O)


signal transmissions between a master station and Remote Terminal Unit (RTU)
station.

The master station would receive the I\O transmission from the RTU through a
telemetry network and then store the data on mainframe computers.
In the early seventies, DCS (Distributed Control System) were developed. the
ISAS5.1 standards defines a distributed control system as a system that while being
functionally integrated consists of subsystems, which may be physically separate and
remotely located from one another. Large manufactures and process facility utilize
DCS primarily because they required large amount of analog control.

Good SCADA systems today not only control processes but are also used for
measuring,forecasting,billing,analyzing and planning, today’s SCADA system must
meet a whole new level of control automation, interfacing with yesterday’s obsolete
equipment yet flexible enough to adapt to tomorrow’s changes.

Whether you need a new system or are upgrading an older one, it is important to
know the system components before you decide on whom to talk with what
equipment you will need for your particular applications.

Components of SCADA system


SCADA systems typically have four major elements:

Master Terminal Unit(MTU)


remote Terminal unit(RTU)
Communication equipment
SCADA software

Master Terminal Unit (MTU)


The Master Terminal Unit is usually defined as the master of heart of a SCADA
system and is located at the operator’s center control facility. The MTU initiate
virtually all communication with remote sites and interfaces with an operator. Data
from remote field devices (pumps, valves, alarms, etc) is sent to the MTU to be
processed, stored and\or sent to the other systems. For example, the MTU may send
the data to the operator’s display console, store the information, and then send an
operator’s initiate command to a field pump’s RTU.

Remote Terminal Unit (RTU)


The Remote Terminal Unit is usually defined as a communication satellite within the
SCADA system and is located at the remote site. The RTU gathers data from field
devices (pumps, valves, alarms, etc) in memory until the MTU initiate a send
command. some RTUs are designed with microcomputers and programmable logic
controllers(PLCs) that can perform function at the remote site without any direction
from the MTU.in addition,PLCs can be modular an expandable for the purpose of
monitoring and controlling additional field devices. Within the RTU is the central
processing unit (CPU) that receives a data stream from the protocol that the
communication equipment uses. The protocols open like modbus, Transmission
Control Protocol and internet protocol (TCP\IP) or a proprietary closed protocol.
When the RTU sees its node address embedded in the protocol, data is interpreted and
the CPU directs the specified action to take.

Communication Equipment
The way the SCADA system network (topology) is set up can vary with each system
but there must be uninterrupted, bidirectional communication between the MTU and
the RTU for a SCADA or Data Acquisition system to function properly. This can be
accomplished in various waysides. private wire lines, buried
cable,telephone,radios,modems,microwaves dishes,satellites,or other atmospheric
means, and many times, systems employ more than one means of communicating to
the remote site. this may include dial-up or dedicated voice grade telephone lines,
DSL (Digital Subscriber Line).integrated services digital network(ISDN).cable, fiber
optics,WiFi.or other broadband services.

SCADA Soft wares


A typical SCADA system provides a Human Machine Interface (HMI) allowing the
operator to visualize all the function as the system operating. The operator can also
use the HMI to change the set points, view critical condition alerts and warnings, and
analyze, archive or present data trends. Since the advents of Windows NT, the HMI
software can be installed on PC hardware as reliable representation of the real system
at work.

Features and Benefits of SCADA System


“Automation is a need for today’s competitive market where quality, cost and
availability is playing major role. Through automation only we can achieve these
parameters and compete in the market”. Some of the benefits, which we can achieve
with the help of industrial automation, are:
Achieve more with less
Elimination of human error
Consistency of product
Minimize energy consumption
Easy diagnosis of fault
Reduction in resources(chemical,water,energy,etc)
Reduce manpower
Data collection and consolidation
Effective application for complex tasks
Trending and report generation
Environmental protection
Improve safety and health
Reduce maintenance
Effect on productivity

In industry we are interested in the quality as well as the quality of the final product.
So the productivity of an industry should increase.fortunately, the industrial
automation results in the improved quality of product in the following aspects.
Increasing production by avoiding manual delays.
Improving productivity by achieving the optimum efficiency of the machine.
Avoiding reprocessing and improving the productivity.
Automation improves the power saving possibilities and hence the cost of product
goes down.
By avoiding manual error it improves the quality of product and hence
productivity.
Automation can give useful data of the machines which increases the possibility
of analyzing the causes of low of poor productivity.
Introduction
Data acquisition system, as the name implies, are products and\or processes used to
collect information to document or analyze some phenomenon. In the simplest form,
a technician logging the temperature of an oven on a piece of paper is performing
data acquisition. As technology has progressed, this type of process has been
simplified and made more accurate, versatile, and reliable through electronic
equipment.equiment ranges from simple recorder to sophisticated computer systems.

The component of data acquisition system included appropriate sensors that convert
any measurement parameters to an electrical signal, which is acquired by data
acquisition hardware.

Acquired data are displayed,analyze,and stored on a computer, either using vendor


supplied software, or custom displays and control can be developed using various
general purpose a programming languages such ass BASIC, C, Fortran, Java, Lisp,
Pascal.specialised programming languages used for data acquisition include, EPICS
used to build large scale data acquisition systems, Lab VIEW, which offers a
graphical programming environment optimized for data acquisition and MAT Lab
provides a programming language but also built-in graphical tools and libraries for
data acquisition and analysis.

Types of Data Acquisition Systems

Serial Communication Data Acquisition Systems


Serial communication data acquisition systems are a good choice when the
measurement needs to be made at a location which is distant from the computer.
There are several different communication standards, RS232 is the most common but
only support transmission distances up to 50 feet, RS485 is superior to RS232 and
supports transmission distances to 5,000 feet.

USB Data Acquisition Systems


The Universal Serial Bus (USB) is a new standard for connecting PCs to peripheral
devices such as printer, monitor, modems and data acquisition devices. USB offers
several advantages over conventional serial and parallel connections, including higher
bandwidth (up to 12 Mbits\s) and the ability to provide power to the peripheral
device.
USB is ideal for data acquisition applications. Since USB connection supply power,
only one cable is required to link the data acquisition device to the PC, which most
likely has at least one USB port.
Data Acquisition Plug-in Boards
Computer data acquisition boards plug directly into computer bus. Advantages of
using boards are speed (because they are connected directly to the bus) and cost
(because the overhead of the packaging and power is provided by the
computer).boards offered are primarily for IBM PC and compatible computers.
Feature provided by the cards can vary due to number and type of input (voltage,
thermocouple, and on\off), outputs, speed and other function provided; each board
installed in the computer is addressed at a unique input\output map location. The I\O
map in computer provides the address locations the processor uses to gain access to
the specific device required by its program.

Parallel Port Data Acquisition Systems


The standard port on a computer which is commonly used for a printer connection
can also be used to connect to a data acquisition device. A parallel port system often
supports very high sample rates. Although the distance between the computer and the
data acquisition device is limited to a few feet.

How data is acquired


Data acquisition begins with the physical phenomenon or physical property of an
object (under investigation) to be measured. This physical property or phenomenon
could be the temperature or temperature change of a room, the intensity or intensity
change of a light source, the pressure inside a chamber, Te force applied to an object.
Or many other things, an effective data acquisition system can measure all of these
different properties or phenomena.

A transducer is a device that converts a physical property or phenomenon into


corresponding measurable electrical signal, such as voltage, current, change in
resistance or capacitor values, etc.the ability of a data acquisition system to measure
different phenomenon depends on the transducers to convert the physical
phenomenon into signals measurable by the data acquisition hardwre, transducers are
synonymous with sensors in DAQ systems. There are specified transducers for many
different applications, such as measuring temperature, pressure, or fluid flow.DAQ
also deploy various signals conditioning techniques to adequately modify various
different electrical signals into voltage that can be digitized using ADCs.

Signal may be digital (also called logic signals sometimes) or analog depending on
the transducer used.

Signal conditioning may be necessary if the signal from the transducer is not suitable
for the DAQ hardware to be used. The signal may be amplified or deamplified, or
may require filtering, or a lock-in amplifier is included to perform demodulation.
Various other examples of signal conditioning might be bridge completion, providing
current or voltage excitation to the sensor.isolation, linearization, etc.
Analog signals tolerate almost no cross talk and so are converted to digital data.
Before coming closer to a PC or before traveling along the long cables. For analog
data to have a high signal to noise ratio, the signal to be very high. And sending+-10
Voltages along a fast signal path with a 50 Ohm termination requires powerful
drivers. With a slightly mismatched or no termination at all, the voltage along the
cable right rings multiple time until it is settled in the seeded precision. Digital data
can have +-0.5 volts. The same is true for DACs.also digital data can be sent over
glass fiber for high voltage isolation or by means of Manchester encoding or similar
through RF-couplers. Which prevent net distortion.
Components of the Data Acquisition System

Sensors (temperature Measurement)


Temperature is also one of the most impotent parameter in industry. There are several
ways to measure the temperature including.
Bi-materials thermometers
Resistive Thermometers
Thermocouple Thermometers
Semiconductor Junction Thermometers
Infrared Thermometers
Liquid-in-Glass Thermometers

In our project we used LM35 temperature sensors for measuring of temperature

LM35 (temperature sensor)

LM35 temperature sensors are precisions integrated-circuit temperature sensors,


Whose out put voltage is linearly proportional to the Celsius (centigrade) temperature.
The LM35 thus have an advantage over linear temperature sensors calibrated is
Kelvin, as we don’t need to subtract a large constant voltage from its output to obtain
convenient centigrade scaling.
The Lm35 does not require nay external calibration or trimming to provide typical
accuracies of +-1/4C at room temperature an+-3/4C over a full -55 to +150C
temperature range. Low cost is assured by trimming and calibration make interfacing
to readout or control circuitry especially easy. It can be used with single power
supplies, or with plus and minus supplies, as it draws only 60*10^6A from its supply,
it has very low self-heating, less than 0.1C in still air.

The LM35 is rated to operate over a -55C to +150C temperature range. While the
LM35C is rated for a -40 to 110C range (-10 with improved accuracy).the LM35
series is available packaged in hermetic TO-46 transistor package, the LM35d is also
available in an 8-lead surface mount small outline package and a plastic To-220
package.
Features of LM35
Calibrated directly in ° Celsius (Centigrade)
Linear + 10.0 mV/°C scale factor
0.5°C accuracy guarantee able (at +25° C)
Rated for full -55° to +150°C range
Suitable for remote applications
Low cost due to wafer-level trimming
Operates from 4 to 30 volts
Less than 60 µA current drain
Low self-heating, 0.08°C in still air
Nonlinearity only ±1D4°C typical
Low impedance output, 0.1 W for 1 mA load
ADC0808

In our Phase-1 we have used ADC0808 A/D converter for converting the eight analog
inputs coming from different sensors into 3-bits digital outputs. The ADC0808 data
acquisition component is a monolithic CMOS device with an 8-bit analog-to-digital
converter, 8-channel multiplexer and microprocessor compatible control logic. The 8-
bitA/D converter uses successive approximation as the conversion technique. The
converter features a high impedance chopper stabilized comparator, a256R voltage
divider with analog switch tree and a successive approximation register. The 8-channel
multiplexer can directly access any of 8-single-ended analog signals. The device
eliminates the need for external zero and full-scale adjustments. Easy interfacing to
microprocessors is provided by the latched and decoded multiplexer address inputs and
latched TTL TRI-STATEÉ outputs.

The design of the ADC0808, ADC0809 has been optimized by incorporating the most
desirable aspects of several A/D conversion techniques. The ADC0808, ADC0809 offers
high speed, high accuracy, minimal temperature dependence, excellent long-term
accuracy and repeatability, and consumes minimal power. These features make this
device ideally suited to applications from process and machine control to consumer and
automotive applications.
Features of ADC 0808

Easy Interface to all microprocessors


Operates ratio metrically or with 5V dc or analog span adjusted
voltage reference
No zero or full scale adjust required
8-channel multiplexer with address logic
0V to 5V input range with single 5V power supply
Outputs meet TTL voltage level specifications
ADC0808 equivalent to MM74C949

Key Specification

Pin Number Description


1 IN3 - Analog Input 3
2 IN4 - Analog Input 4
3 IN5 - Analog Input 5
4 IN6 - Analog Input 6
5 IN7 - Analog Input 7
6 START - Start Conversion
7 EOC - End Of Conversion
8 2(-5) - Tri-State Output Bit 5
9 OUT EN - Output Enable
10 CLK - Clock
11 Vcc - Positive Supply
12 Vref + - Positive Voltage Reference Input
13 GND - Ground
14 2(-7) - Tri-State Output Bit 7
15 2(-6) - Tri-State Output Bit 6
16 Vref - - Voltage Reference Negative Input
17 2(-8) - Tri-State Output Bit 8
18 2(-4) - Tri-State Output Bit 4
19 2(-3) - Tri-State Output Bit 3
20 2(-2) - Tri-State Output Bit 2
21 2(-1) - Tri-State Output Bit 1
22 ALE - Address Latch Enable
23 ADD C - Address Input C
24 ADD B - Address Input B
25 ADD A - Address Input A
26 IN0 - Analog Input 0
27 IN1 - Analog Input 1
28 IN2 - Analog Input 2

8051 Microcontroller

The Intel 8051 is an 8-bit microcontroller which means that most available operations are
limited to 8 bits. There are 3 basic "sizes" of the 8051: Short, Standard, and Extended.
The Short and Standard chips are often available in DIP form, but the Extended 8051
models often have a different form factor, and are not "drop-in compatable". All these
things are called 8051 because they can all be programmed using 8051 assembly
language, and they all share certain features (although the different models all have their
own special features).

Features
8-bit data bus
16-bit address bus
32 general purpose registers each of 8 bits
16 bit timers (usually 2, but may have more, or less).
3 internal and 2 external interrupts.
Bit as well as byte addressable RAM area of 16 bytes.
Four 8-bit ports, (short models have two 8-bit ports).
16-bit program counter and data pointer
Typical Applications

8051 chips are used in a wide variety of control systems, telecom applications,
robotics as well as in the automotive industry. By some estimations, 8051 family
chips make up over 50% of the embedded chip market.
Basic Pins

PIN 9: PIN 9 is the reset pin which is used reset the microcontroller’s internal registers
and ports upon starting up.2 machine cycyle should be high at this pin.

PINS 18 & 19: The 8051 has a built-in oscillator amplifier hence we need to only
connect a crystal at these pins to provide clock pulses to the circuit.

PIN 40 and 20: Pins 40 and 20 are VCC and ground respectively. The 8051 chip needs
+5V 500mA to function properly, although there are lower powered versions like the
Atmel 2051 which is a scaled down version of the 8051 which runs on +3V.

PINS 29, 30 & 31: As described in the features of the 8051, this chip contains a built-in
flash memory. In order to program this we need to supply a voltage of +12V at pin 31. If
external memory is connected then PIN 31, also called EA/VPP, should be connected to
ground to indicate the presence of external memory. PIN 30 is called ALE (address latch
enable), which is used when multiple memory chips are connected to the controller and
only one of them needs to be selected. We will deal with this in depth in the later
chapters. PIN 29 is called PSEN. This is "program select enable". In order to use the
external memory it is required to provide the low voltage (0) on both PSEN and EA pins

Ports

There are 4 8-bit ports: P0, P1, P2 and P3.

PORT P1 (Pins 1 to 8): The port P1 is a general purpose input/output port which can be
used for a variety of interfacing tasks. The other ports P0, P2 and P3 have dual roles or
additional functions associated with them based upon the context of their usage.

PORT P3 (Pins 10 to 17): PORT P3 acts as a normal IO port, but Port P3 has additional
functions such as, serial transmit and receive pins, 2 external interrupt pins, 2 external
counter inputs, read and write pins for memory access.

PORT P2 (pins 21 to 28): PORT P2 can also be used as a general purpose 8 bit port
when no external memory is present, but if external memory access is required then
PORT P2 will act as an address bus in conjunction with PORT P0 to access external
memory. PORT P2 acts as A8-A15, as can be seen from fig 1.1

PORT P0 (pins 32 to 39) PORT P0 can be used as a general purpose 8 bit port when no
external memory is present, but if external memory access is required then PORT P0 acts
as a multiplexed address and data bus that can be used to access external memory in
conjunction with PORT P2. P0 acts as AD0-AD7,

Oscillator Circuits

The 8051 requires the existence of an external oscillator circuit. The oscillator circuit
usually runs around 12MHz, although the 8051 (depending on which specific model)
is capable of running at a maximum of 40MHz. Each machine cycle in the 8051 is 12
clock cycles, giving an effective cycle rate at 1MHz (for a 12 KHz clock) to 3.33MHz
(for the maximum 40MHz clock).

Internal Architecture

Data and Program Memory

The 8051 Microprocessor can be programmed in PL/M, 8051 Assembly, C and a number
of other high-level languages. Many compilers even have support for compiling C++ for
an 8051.

Program memory in the 8051 is read-only, while the data memory is considered to be
read/write accessible. When stored on EEPROM or Flash, the program memory can be
rewritten when the microcontroller is in the special programmer circuit.

Program Start Address

The 8051 starts executing program instructions from address 0x00 in the program

Direct Memory

The 8051 has 256 bytes of internal addressable RAM, although only the first 128 bytes
are available for general use by the programmer. The first 128 bytes of RAM (from 0x00
to 0x7F) are called the Direct Memory, and can be used to store data.
Special Function Register

The Special Function Register (SFR) is the upper area of addressable memory, from
address 0x80 to 0xFF. This area of memory cannot be used for data or program storage,
but is instead a series of memory-mapped ports and registers. All port input and output
can therefore be performed by memory mov operations on specified addresses in the
SFR. Also, different status registers are mapped into the SFR, for use in checking the
status of the 8051, and changing some operational parameters of the 8051.

The 8051 has 4 selectable banks of 8 addressable 8-bit registers, R0 to R7. This means
that there are essentially 32 available general purpose registers, although only 8 (one
bank) can be directly accessed at a time. To access the other banks, we need to change
the current bank number in the flag status register.

The A register is located in the SFR at memory location 0xE0. The A register works in a
similar fashion to the AX register of x86 processors. The A register is called the
accumulator, and by default it receives the result of all arithmetic operations. The B
register is used in a similar manner, except that it can receive the extended answers from
the multiply and divide operations. When not being used for multiplication and Division,
the B register is available as an extra general-purpose register.

MAX 232
The MAX232 is an integrated circuit that converts signals from an RS-232 serial port to
signals suitable for use in TTL compatible digital logic circuits. The MAX232 is a dual
driver/receiver and typically converts the RX, TX, CTS and RTS signals.

The drivers provide RS-232 voltage level outputs (approx. ± 7.5 V) from a single + 5 V
supply via on-chip charge pumps and external capacitors. This makes it useful for
implementing RS-232 in devices that otherwise do not need any voltages outside the 0 V
to + 5 V range, as power supply design does not need to be made more complicated just
for driving the RS-232 in this case.
The receivers reduce RS-232 inputs (which may be as high as ± 25 V), to standard 5 V
TTL levels. These receivers have a typical threshold of 1.3 V, and a typical hysteresis of
0.5 V.

The later MAX232A is backwards compatible with the original MAX232 but may
operate at higher baud rates and can use smaller external capacitors – 0.1 F in place of
the 1.0 F capacitors used with the original device
Features

2.7V Operation
Dual Band, Triple Mode
Three LNA Gain Settings (Cellular)
Two LNA Gain Settings (PCS)
18mA in Low-Gain Mode
19.5mA in Paging and Madigan Mode
26.5mA in High-Gain, High-Linearity Mode
16.5mA in FM Mode, High-Gain, Low-Linearity
Mode
2.5dB (type) Cascade Noise Figure
Adjustable LNA IIP3, +5dBm to +13dBm
Ultra-Small 28-Pin Package (5mm x 5mm)

Applications

Portable Computers
Low-Power Modems
Interface Translation
Multi drop Rs-232 Networks

Relays

A relay is an electrically operated switch. Current flowing through the coil of the relay
creates a magnetic field which attracts a lever and changes the switch contacts. The coil
current can be on or off so relays have two switch positions and they are double throw
(changeover) switches.

Relays allow one circuit to switch a second circuit which can be completely separate
from the first. For example a low voltage battery circuit can use a relay to switch a 230V
AC mains circuit. There is no electrical connection inside the relay between the two
circuits; the link is magnetic and mechanical.
The coil of a relay passes a relatively large current, typically 30mA for a 12V relay, but it
can be as much as 100mA for relays designed to operate from lower voltages. Most ICs
(chips) cannot provide this current and a transistor is usually used to amplify the small IC
current to the larger value required for the relay coil. The maximum output current for the
popular 555 timer IC is 200mA so these devices can supply relay coils directly without
amplification.

Relays are usually SPDT or DPDT but they can have many more sets of switch contacts,
for example relays with 4 sets of changeover contacts are readily available. For further
information about switch contacts and the terms used to describe them please see the
page on switches.

Most relays are designed for PCB mounting but you can solder wires directly to the pins
providing you take care to avoid melting the plastic case of the relay.

The supplier'
s catalogue should show you the relay's connections. The coil will be
obvious and it may be connected either way round. Relay coils produce brief high voltage
'
spikes'when they are switched off and this can destroy transistors and ICs in the circuit.
To prevent damage you must connect a protection diode across the relay coil.

Advantages of relays:

Relays can switch AC and DC, transistors can only switch DC.
Relays can switch high voltages, transistors cannot.
Relays are a better choice for switching large currents (> 5A).
Relays can switch many contacts at once.

Disadvantages of relays:
Relays are bulkier than transistors for switching small currents.
Relays cannot switch rapidly (except reed relays), transistors can switch
many times per second.
Relays use more power due to the current flowing through their coil.
Relays require more current than many ICs can provide, so a low power
transistor may be needed to switch the current for the relay'
s coil
The programming languages and software used in our Phase-1 are listed below:

C language
Keil version 3
Proteus
Express PCB
Ms visual basic
Microsoft Excel
Microsoft Access

C Language
C is a general-purpose computer programming language developed in 1972 by Dennis
Ritchie at the Bell Telephone Laboratories to implement the Unix operating system

Although C was designed for writing architecturally independent system software, it is


also widely used for developing application software.

C is an imperative (procedural) systems implementation language. It was designed to be


compiled using a relatively straightforward compiler, to provide low-level access to
memory, to provide language constructs that map efficiently to machine instructions, and
to require minimal run-time support. C was therefore useful for many applications that
had formerly been coded in assembly language.

Despite its low-level capabilities, the language was designed to encourage machine-
independent programming. A standards-compliant and portably written C program can be
compiled for a very wide variety of computer platforms and operating systems with little
or no change to its source code, while approaching highest performance. The language
has become available on a very wide range of platforms, from embedded
microcontrollers to supercomputers.
The code is given below:

#include <reg51.h>
#include <lcd.h>

void send(unsigned char value)


{
SBUF=value;
while(TI==0);TI=0;
}

unsigned char receive(void)


{
while(RI==0);RI=0;
return SBUF;
}

void send_string(byte *text)


{
do{send(*text);text++;}while(*text!='
\0'
);
}

void main()
{
byte *text1=" Temprature ";
byte *text2="\n SET-VALUE : \n";
byte *text3=" SET-VALUE : " ;
byte *text4=" Current Temprature \n" ;
byte sat_value;

#ifndef MONITOR51
SCON = 0x50; /* SCON: mode 1, 8-bit UART, enable rcvr */
TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */
TH1 = -3; /* TH1: reload value for 9600 baud @ 11.0592MHz */
TR1 = 1; /* TR1: timer 1 run */
TI = 1; /* TI: set TI to send first char of UART */
#endif

s1=0;s2=0;d2=0;d1=0;
read_adc=25;
rw=0;

lcd_ini();
send_string(text4);
lcdcmd(0xC6);
bcd();
send(d2+48);
send(d1+48);
send('C');send('
\n'
);

while(1)
{
int preview;

lcdcmd(0x81);
lcdprint(text1);
lcdcmd(0xC6); //LINE TWO POSITION
preview=tlong;
get_temp();
read_adc=value;
bcd();

if(tlong!=preview){send(d2+48);send(d1+48);send('
C');}//show temperature on
Serial Port
if(tlong>=sat_value)out=0;
else out=1;
if(sw1==0)
{

lcdcmd(lcd_clr); //clear lcd


lcdprint(text3); //Print setting mode text on lcd
send_string(text2);
lcdcmd(0x0C6); //move cursor on Second line 6th column
lcddata(s2+48); //print setting commands on LCD
lcddata(s1+48);
lcddata('C');
//lcdcmd(0x086);
while(sw1==0);

s2=receive();send(s2);s1=receive();send(s1);

lcdcmd(0x0C6);
lcddata(s2);
lcddata(s1);
s2=s2-48;s1=s1-48;
sat_value=s2*10;
sat_value=sat_value+s1;
MSDelay(150);
//while(sw1==1);
lcdcmd(lcd_clr);

}
s_delay(100);
}

void get_temp()
{

P1 = 0xFF; //make port one as input


INTR = 1; //make INTR an input
R_D = 1;

W_R = 0;
W_R = 1; //start conversion high to low pulse
while(INTR==1); //wait for end of conversion
R_D = 0; //conversion finished enable rd
value= P1;

void s_delay(unsigned int x)


{
int i;
for(i=0;i<x;i++)
{

MSDelay(1);
if(sw1==0)break;

}
Keil software

When starting a new project, simply select the microcontroller you use from
the Device Database and the µVision IDE sets all compiler, assembler, linker,
and memory options for you.
Numerous example programs are included to help you get started with the
most popular embedded 8051 devices.
The Keil µVision Debugger accurately simulates on-chip peripherals (I²C,
CAN, UART, SPI, Interrupts, I/O Ports, A/D Converter, D/A Converter, and
PWM Modules) of your 8051 device. Simulation helps you understand
hardware configurations and avoids time wasted on setup problems.
Additionally, with simulation, you can write and test applications before target
hardware is available.
When you are ready to begin testing your software application with target
hardware, use the MON51, MON390, MONADI, or FlashMON51 Target
Monitors, the ISD51 In-System Debugger, or the ULINK USB-JTAG Adapter
to download and test program code on your target system.

Proteus

Proteus is an easy-to-use application for creating printed circuit-board layouts,


and is good for hobbyists or students working on small projects. The trial
download is basically a pared-down version of Lab center Electronics'
professional PCB application. Proteus creates simple PCBs with 16 copper layers,
two silk screens, and four user/mechanical layers, plus an auto router. Completed
designs are suitable for reports, tutorials, or articles. During testing, we found we
were forced to register the program before most of the basic functions would
work. Also, as the trial version has a 100-pin limitation, we only were able to test
Proteus on small schema. Very user-friendly, Proteus Lite is a great program for
creating PCBs--but if the trial limitations don' t suit you, be sure to check out other
programs that aren' t as fettered.
Visual basics

Visual Basic was one of the first products to provide a graphical programming
environment and a paint metaphor for developing user interfaces. Instead of worrying
about syntax details, the Visual Basic programmer can add a substantial amount of code
simply by dragging and dropping controls, such as buttons and dialog boxes, and then
defining their appearance and behavior.

Although not a true object-oriented programming language in the strictest sense, Visual
Basic nevertheless has an object-oriented philosophy. It is sometimes called an event-
driven language because each object can react to different events such as a mouse click.

Since its launch in 1990, the Visual Basic approach has become the norm for
programming languages. Now there are visual environments for many programming
languages, including C, C++, Pascal, and Java. Visual Basic is sometimes called a Rapid
Application Development (RAD) system because it enables programmers to quickly
build prototype applications.

Language features

Visual Basic was designed to be easy to learn and use. The language not only allows
programmers to create simple GUI applications, but can also develop complex
applications. Programming in VB is a combination of visually arranging components or
controls on a form, specifying attributes and actions of those components, and writing
additional lines of code for more functionality. Since default attributes and actions are
defined for the components, a simple program can be created without the programmer
having to write many lines of code. Performance problems were experienced by earlier
versions, but with faster computers and native code compilation this has become less of
an issue.

Although programs can be compiled into native code executables from version 5
onwards, they still require the presence of runtime libraries of approximately 1 MB in
size. This runtime is included by default in Windows 2000 and later, but for earlier
versions of Windows like 95/98/NT it must be distributed together with the executable.

Forms are created using drag-and-drop techniques. A tool is used to place controls (e.g.,
text boxes, buttons, etc.) on the form (window). Controls have attributes and event
handlers associated with them. Default values are provided when the control is created,
but may be changed by the programmer. Many attribute values can be modified during
run time based on user actions or changes in the environment, providing a dynamic
application. For example, code can be inserted into the form resize event handler to
reposition a control so that it remains centered on the form, expands to fill up the form,
etc. By inserting code into the event handler for a key press in a text box, the program can
automatically translate the case of the text being entered, or even prevent certain
characters from being inserted.

Visual Basic can create executables (EXE files), ActiveX controls, or DLL files, but is
primarily used to develop Windows applications and to interface database systems.
Dialog boxes with less functionality can be used to provide pop-up capabilities. Controls
provide the basic functionality of the application, while programmers can insert
additional logic within the appropriate event handlers. For example, a drop-down
combination box will automatically display its list and allow the user to select any
element. An event handler is called when an item is selected, which can then execute
additional code created by the programmer to perform some action based on which
element was selected, such as populating a related list.

Alternatively, a Visual Basic component can have no user interface, and instead provide
ActiveX objects to other programs via Component Object Model (COM). This allows for
server-side processing or an add-in module.

The language is garbage collected using reference counting, has a large library of utility
objects, and has basic object oriented support. Since the more common components are
included in the default project template, the programmer seldom needs to specify
additional libraries. Unlike many other programming languages, Visual Basic is generally
not case sensitive, although it will transform keywords into a standard case configuration
and force the case of variable names to conform to the case of the entry within the
symbol table entry. String comparisons are case sensitive by default, but can be made
case insensitive if so desired.

The Visual Basic compiler is shared with other Visual Studio languages (C, C++), but
restrictions in the IDE do not allow the creation of some targets (Windows model DLL's)
and threading models.

Characteristics present in Visual Basic

Visual Basic has the following traits which differ from C-derived languages:
Multiple assignment available in C language is not possible. A = B = C does
not imply that the values of A, B and C are equalled. The boolean result of "Is
B = C?" is stored in A. The result stored in A could therefore be false(0) or
true(-1)
Boolean constant True has numeric value −1.[3] This is because the Boolean
data type is stored as a 16-bit signed integer. In this construct −1 evaluates to
16 binary 1s (the Boolean value True), and 0 as 16 0s (the Boolean value
False). This is apparent when performing a Not operation on a 16 bit signed
integer value 0 which will return the integer value −1, in other words True =
Not False. This inherent functionality becomes especially useful when
performing logical operations on the individual bits of an integer such as And,
Or, Xor and Not.[4] This definition of True is also consistent with BASIC
since the early 1970s Microsoft BASIC implementation and is also related to
the characteristics of CPU instructions at the time.
Logical and bitwise operators are unified. This is unlike some C-derived
languages (such as Perl), which have separate logical and bitwise operators.
This again is a traditional feature of BASIC.
Variable array base. Arrays are declared by specifying the upper and lower
bounds in a way similar to Pascal and Fortran. It is also possible to use the
Option Base statement to set the default lower bound. Use of the Option Base
statement can lead to confusion when reading Visual Basic code and is best
avoided by always explicitly specifying the lower bound of the array. This
lower bound is not limited to 0 or 1, because it can also be set by declaration.
In this way, both the lower and upper bounds are programmable. In more
subscript-limited languages, the lower bound of the array is not variable. This
uncommon trait does exist in Visual Basic .NET but not in VBScript.

Relatively strong integration with the Windows operating system and the
Component Object Model.
Banker' s rounding as the default behavior when converting real numbers to
integers with the Round function.
Integers are automatically promoted to reals in expressions involving the
normal division operator (/) so that division of an odd integer by an even
integer produces the intuitively correct result. There is a specific integer
divide operator (\) which does truncate.

By default, if a variable has not been declared or if no type declaration character is


specified, the variable is of type Variant. However this can be changed with Deftype
statements such as DefInt, DefBool, DefVar, DefObj, DefStr. There are 12 Deftype
statements in total offered by Visual Basic 6.0. The default type may be overridden for a
specific declaration by using a special suffix character on the variable name (# for
Double, ! for Single, & for Long, % for Integer, $ for String, and @ for Currency) or
using the key phrase As (type). VB can also be set in a mode that only explicitly declared
variables can be used with the command Option Explicit.

Performance and other issues

Earlier counterparts of Visual Basic (prior to version 5) compiled the code to P-Code or
Pseudo code only. Visual Basic 5 and 6 are able to compile the code to either native or P-
Code as the programmer chooses. The P-Code is interpreted by the language runtime,
also known as virtual machine, implemented for benefits such as portability and small
code. However, it usually slows down the execution by adding an additional layer of
interpretation of code by the runtime although small amounts of code and algorithms can
be constructed to run faster than the compiled native code. Visual Basic applications
require Microsoft Visual Basic runtime MSVBVMxx.DLL, where xx is the relevant
version number, either 50 or 60. MSVBVM60.dll comes as standard with Windows in all
editions after Windows 98 while MSVBVM50.dll comes with all editions after Windows
95. A Windows 95 machine would however require inclusion with the installer of
whichever dll was needed by the program.

Microsoft Excel
Microsoft Excel (full name Microsoft Office Excel) is a spreadsheet-application written
and distributed by Microsoft for Microsoft Windows and Mac OS X. It features
calculation, graphing tools, pivot tables and a macro programming language called VBA
(Visual Basic for Applications). It has been the most widely used spreadsheet application
available for these platforms since version 5 in 1993.

Features

Excel offers users the useful ability to write code using the programming language Visual
Basic for Applications (VBA). Programmers write this code using an editor viewed
separately from the spreadsheet. Manipulation of the spreadsheet entries is controlled
using objects. With this code any function or subroutine that can be set up in a Basic- or
Fortran-like language can be run using input taken from the spreadsheet proper, and the
results of the code are instantaneously written to the spreadsheet or displayed on charts
(graphs). The spreadsheet becomes an interface or window to the code, enabling easy
interaction with the code and what it calculates.

The most common and easiest way to generate VBA code is by use of the macro recorder
function that writes the code for the actions that the user carries out with
mouse/keyboard. There is a relative/absolute toggle button that allows the user to switch
between the two whilst recording a macro. Relative/absolute in this context means the
relative to the start cell location or an absolute cell reference for example cell A1 (column
A, row 1).Certain features such as loop functions and screen prompts by their own
properties cannot be recorded, but must be entered into the VBA module directly by the
programmer.

The macros can easily be activated using a button using the form menu, and advanced
users can use user prompts to create an interactive program.Although conceptually simple
to understand (especially using a macro recorder), the combination of multiple steps
under many different constraints/conditions requires a robust testing/quality control
processes to gain regular/reliable/predictable results for the product to realise its benefits.
Microsoft Access Database
Microsoft Access database is available with the Microsoft Office Professional
suite of business products therefore no additional database software is
required if your company purchases computers with this suite of products
already installed.
Microsoft Access database is likely to be available and supported for years to
come because Microsoft is the premier software company in the world.
MS Access is the most widely used desktop database system in the world.
If database support is important to you then Access may be your best choice
since Access has more support and development consultants than any other
desktop database system.
It is significantly cheaper to implement and maintain compared to larger
database systems such as Oracle or SQL Server.
Company consulting rates are typically lower for Access database consultants
compared to Oracle or SQL Server consultants.
Fairly complex databases can be setup and running in 1/2 the time and cost of
other large database systems (the simpler the database the greater the cost
advantage).
Access integrates well with the other members of the Microsoft Office suite of
products (Excel, Word, Outlook, etc.).
Other software manufacturers are more likely to provide interfaces to MS
Access than any other desktop database system.
When designed correctly, Access databases can be ported (usually with some
difficulty) to SQL Server or Oracle. This is important if you want to start
small or develop a pilot database system and then migrate to the larger
database management systems.
An Access database can be placed on a website for access for remote users.
Simple screens can be developed within Access, Data Access Pages. Or full
control and functionality can be implemented using Active Server Page (ASP)
programming. Note that you still have the same simultaneous connection
limitations described above.

Features

Microsoft Access is known for its ability to empower non-professional developers to


create database applications on their own. Users can easily create tables, queries, forms
and reports, and connect them together with macros. Advanced users can use VBA to
write rich solutions with advanced data manipulation and user control.

The original concept of Access was for end users to be able to “access” data from any
source. Access offers the ability to import and export data to many formats including
Excel, Outlook, ASCII, dBase, Paradox, FoxPro, SQL Server, Oracle, ODBC, etc. It also
has the ability to link to data in its existing location and use it for viewing, querying,
editing, and reporting. This allows the existing data to change and the Access platform to
always use the latest data. It can even perform heterogeneous joins between data sets
stored a

cross different platforms. Access is often used by people downloading data from
enterprise level databases for manipulation, analysis, and reporting locally.

A significant strength of Microsoft Access is its Jet Database format (MDB or ACCDB in
Access 2007) which can contain the application and data in one file. This makes it very
convenient to distribute the entire application to another user, who can run it in
disconnected environments.

One of the benefits of Access from a programmer's perspective is its relative


compatibility with SQL (structured query language) — queries can be viewed graphically
or edited as SQL statements, and SQL statements can be used directly in Macros and
VBA Modules to manipulate Access tables. Users can mix and use both VBA and
"Macros" for programming forms and logic and offers object-oriented possibilities. VBA
can also be included in queries.
The Phase-II consists of four main parts

GSM Mobile
Interface between device panel and GSM Mobile
Base Station
Software

GSM Tube
Interface Panel
Mobile Well

GSM
Mobile PC

Block diagram of phase-II


GSM Mobile

We have used SONY ERICSSON T290 for this purpose mainly because of two reasons

• It operates in text mode


• It communicates serially with the PC
• It is also cheap in market

This mobile operates in both 900/1800 GSM band

Sony Ericsson T290

Data sheet

GENERAL 2G Network GSM 900 / 1800 - T290i


GSM 850 / 1900 - T290a
Announced 2004, 4Q
Status Available
SIZE Dimensions 101 x 44 x 19 mm
Weight 73 g
DISPLAY Type STN, 4096 colors
Size 101 x 80 pixels, 1.45 inches
- Wallpapers, themes
SOUND Alert types Vibration; Downloadable polyphonic ring tones, composer
Speakerphone Yes
- Ring tones can be assigned to phonebook entries
MEMORY Phonebook 250 entries x 5 fields, Picture call
Call records 10 dialed, 20 received and missed calls
Internal 400 KB
Card slot No
DATA GPRS Class 8 (4+1 slots), 32 - 40 kbps
HSCSD No
EDGE No
3G No
WLAN No
Bluetooth No
Infrared No
port
USB Yes
CAMERA No
FEATURES Messaging SMS, EMS, MMS, Email
Browser WAP 1.2.1
Radio No
Games 2 - Deep Abyss and Five Stones + Downloadable
Colors
GPS No
Java No
- T9
- Organizer
- Voice control
- Voice memo
BATTERY Standard battery, Li-Ion 700 mAh (BST-30)
Stand-by Up to 300 h
Talk time Up to 12 h
Interface between Panel and GSM Mobile

We have developed a interface which will convert electrical signal into GSM based
signal and vice versa. The interface receives electrical signal and status information and
converts it to the GSM signal.
We have designed a circuit which will act as a bridge between the device panel and the
mobile phone. The idea behind this circuit is very simple

We have used a microcontroller ATMEL (89C51) which will serve as a heart of the
circuit, a MAX232 IC is used to translate TTL into RS232 standard because our mobile
phone is connected serially with our circuit. A ULN 2803 IC is used to provide interface
between the controller and the relays, thus in this way we have achieved our goal, our
circuit is very simple, efficient and proven.
Base Station
A Base station is the main room handling all the operations regarding Phase-2, it will act
as a main control unit compromising of a PC and a mobile phone attached to it through a
serial port.
We have designed a GUI in Visual Basic which provides user friendly and simple
environment for the user to handle and manage all the activities.

The best option to connect a phone to the PC is to use a standard RS232 serial cable.

Software
Visual Basic was designed to be easy to learn and use. The language not only allows
programmers to create simple GUI applications, but can also develop complex
applications. Programming in VB is a combination of visually arranging components or
controls on a form, specifying attributes and actions of those components, and writing
additional lines of code for more functionality. Since default attributes and actions are
defined for the components, a simple program can be created without the programmer
having to write many lines of code. Performance problems were experienced by earlier
versions, but with faster computers and native code compilation this has become less of
an issue.
Conclusion and Future Work

The current trends towards industrial automation are to develop an INTERNET and GSM
based system that provides insensitivity to electromagnetic noise in industry, and
communication and control capabilities within one module. This project demonstrates the
versatile use of INTERNET and GSM in automation industry. It is cheaper and more
efficient solution to monitoring and control. So this project is a good effort to
demonstrate the use of INTERNET and GSM in automation industry.

This system has created more efficient and failsafe operating conditions, enabling
operators to monitor and controls and processes from remote locations in real-time. The
automation introduced increases the efficiency of production process through more
reliable monitoring and increased control.

The technique used in this project can be modified in more refined and controllable
automated solution for industrial processes, by developing some control not only on the
central control console, but also on the remote terminal unit side. This will help in the
more distributed control. Though the complexity of the whole system will increase but
the tendency to manage a large magnitude of the process variables can be effectively
enhanced
References

Stuart A boyar ,SCADA: supervisory control and data acquisition, second edition,
MC graw-hill,N.Y,1992
P. Bhartia and R.E Collins, Modern principles of automations, third edition, MC
graw-hill,N.Y,1996
David bailey, practical SCADA for industry, wiley, N.Y,1995
www.ni.com/labviewzone
www.verio.co.uk
www.gsm-modem.de/gsm-modem-module.html
www.bioenabletech.com/gsm
GSM And Personal Communications Handbook by Sigmund Redl,
Matthias Weber, Malcolm W. Oliphant
The GSM Network: The GPRS Evolution: One Step Towards UNTS (Paperback)
www.gsmarena.com/sony_ericsson_t290-909.php
www.atmel.com/
www.electro-tech-online.com/micro-controllers/21879-microcontroller-89c51-
atmel.html
Microelectronic Circuit Analysis and Design by Donald Neamen (Hardcover -
Feb 21, 2006)
Computer Methods for Circuit Analysis and Design (Electrical Engineering) by
Kishore Singhal and Jiri Vlach (Hardcover - Aug 19, 1993)

Introduction to GSM: Physical Channels, Logical Channels, Network, and


Operation by Lawrence Harte (Paperback - Oct 2004)
The GSM System for Mobile Communications by Michel Mouly and Marie-
Bernadette Pautet (Hardcover - Jun 1992)
Electronic circuit and devices theory
Schematic of Phase-I
PCB design of phase-II
Schematic of Phase - II

Você também pode gostar