online monitor and control system

46
1 | Page The World Wide Web has made it possible to send a lot of data from one side of the world to the other side in almost no time. The use of the Internet for real-time interaction of the remote Controlling and Monitoring of the plants would give us many advantages. This technology cannot only be used in the industry, but also in the field of medicine, education etc. Although all this looks promisingly two main problems should be faced before the web based Control and Monitoring can be implemented. The first one is the aspect of time delay, which can lead to irregular data transmission and data loss. In the worst-case this can make the whole system unstable. The other one is the problem of Security. When Malicious hackers can grant access to a system the consequences can be catastrophic. Other problems concern the distance or logistics. If something goes wrong with the system, a lot of time and preparation can be needed before somebody can intervene to requirement specifications and system implementation 1.1 Problem faced by Ceramic Industry In all of the ceramic industry they have mostly two or three units like vitrified tiles, floor tiles etc. They need to have the monitor and control room for every unit. For that they need more no. of employers to monitor and control and also to synchronize the work they need to communicate all data & this process is very difficult with regular commination system. And if there is only one technician than they need to run to different control rooms, if person is late then may accident will occur and this will harm the person which is working with machine or may be damage is done to machinery part. To need more advance control room which give all data at one place and easily available to access hardware from any place. 1.2 Utility of the Project Now all industry turn towards computerized controlling system because it is easy to operate and easy to understand for that company they want to make the plan of computerized monitoring and control system which is centralize whole company. INTRODUCTION Chapter 1

Upload: biren-ramoliya

Post on 14-Jun-2015

1.448 views

Category:

Education


0 download

DESCRIPTION

We made system which give facility to control and monitor industry online, we are use RS232 interfacing of microcontroller and PC and we made VB application which continually read serial port and also same time save all data in My-SQL database it is also sends data from My-SQL database and one online application client side from that user can access all database thru that all industrial application.

TRANSCRIPT

Page 1: Online monitor and control system

1 | P a g e

The World Wide Web has made it possible to send a lot of data from one side of the

world to the other side in almost no time. The use of the Internet for real-time interaction

of the remote Controlling and Monitoring of the plants would give us many advantages.

This technology cannot only be used in the industry, but also in the field of medicine,

education etc.

Although all this looks promisingly two main problems should be faced before the web

based Control and Monitoring can be implemented. The first one is the aspect of time

delay, which can lead to irregular data transmission and data loss. In the worst-case this

can make the whole system unstable. The other one is the problem of Security. When

Malicious hackers can grant access to a system the consequences can be catastrophic.

Other problems concern the distance or logistics. If something goes wrong with the

system, a lot of time and preparation can be needed before somebody can intervene to

requirement specifications and system implementation

1.1 Problem faced by Ceramic Industry

In all of the ceramic industry they have mostly two or three units like vitrified tiles, floor

tiles etc. They need to have the monitor and control room for every unit. For that they

need more no. of employers to monitor and control and also to synchronize the work they

need to communicate all data & this process is very difficult with regular commination

system. And if there is only one technician than they need to run to different control

rooms, if person is late then may accident will occur and this will harm the person which

is working with machine or may be damage is done to machinery part. To need more

advance control room which give all data at one place and easily available to access

hardware from any place.

1.2 Utility of the Project

Now all industry turn towards computerized controlling system because it is easy to

operate and easy to understand for that company they want to make the plan of

computerized monitoring and control system which is centralize whole company.

INTRODUCTION

Chapter – 1

Page 2: Online monitor and control system

2 | P a g e

Our project will be useful in all industry where two or more plan is running or complex

monitoring and controlling system is there. It will provide next generation platform of

technology where large hardware and online application is running together with use of

sophisticated embedded system which allows in making our hardware to online which can

be controlled form anywhere with secured authentication.

Here company wants to combine three different systems. Means we want to monitor and

control three different points from one place. If there is one central control system than it

is very easy for the employee. So here we have established one monitoring and control

point from there we can control and monitor whole system. We are going to design one

website through which employee can login with his/her User Id and Password and get

authority to control all the controlling point.

Company wants to build very user-friendly and easy to operate central monitoring and

control system which can be operated by any of the employers. For that there is no need

to give a special training. Here each point of controlling through website is very easy. So

there is a reduction in time to solve a problem. So this time is utilized in manufacturing

more tiles.

It is helpful in most of industry to change its complex and static control system with

mobile control system through internet. It is easy to change the speed of motor and

temperature control with mouse click or keyboard keys. It is provide user-friendly

environment of control room and also make virtual work place.

Page 3: Online monitor and control system

3 | P a g e

Now a day‟s industry is running with more number of plants, for that industry turn to

make central control system, from where person can to monitor and control system.

The online monitoring and control system can be described as the whole of operations

performed to control or monitor a system situated in a closed network. It is based on

existing technologies, programming languages as VB and PHP specifications as HTTP.

2.1 Networked Control System (NCS):

A Networked Control System (NCS) is a control system wherein the control loops are

closed through a real-time network. The defining feature of an NCS is that control and

feedback signals are exchanged among the system's components in the form of

information packages through a network.

The functionality of a typical NCS is established by the use of four basic elements:

1. Sensors, to acquire information,

2. Controllers, to provide decision and commands,

3. Actuators, to perform the control commands and

4. Communication network, to enable exchange of information.

The most important feature of a NCS is that it connects cyberspace to physical space thus,

enabling execution of several tasks from long distance. In addition, networked control

systems eliminate unnecessary wiring thus, reducing the complexity and the overall cost

in designing and implementing the control systems. They can also be easily modified or

upgraded by adding sensors, actuators and controllers to them with relatively low cost and

no major changes in their structure. Moreover, featuring efficient sharing of data between

their controllers, NCS are able to easily fuse global information to make intelligent

decisions over large physical spaces.

BRIEF HISTORY OF THE WORK

Chapter – 2

Page 4: Online monitor and control system

4 | P a g e

Their potential applications are numerous and cover a wide range of industries such as:

space and terrestrial exploration, access in hazardous environments, factory automation,

remote diagnostics and troubleshooting, experimental facilities, domestic robots, aircraft,

automobiles, manufacturing plant monitoring, nursing homes.

2.2 Types of Communication networks:

Fieldbuses, e.g. CAN.

Ethernet

Wireless networks, e.g. Bluetooth or ZigBee. The term Wireless Networked

Control System (WNCS) is often used in this connection.

Advent and development of the Internet combined with the advantages provided

by NCS attracted the interest of researchers around the globe. Along with the

advantages, several challenges also emerged giving rise to many important

research topics. New control strategies, kinematics of the actuators in the systems,

reliability and security of communications, bandwidth allocation, development of

data communication protocols, corresponding fault detection and fault tolerant

control strategies, real-time information collection and efficient processing of

sensors data are some of the relative topics studied in depth.

The insertion of the communication network in the feedback control loop makes

the analysis and design of an NCS complex, since it imposes additional time

delays in control loops or possibility of packages loss. Depending on the

application, time-delays could impose severe degradation on the system

performance.

Page 5: Online monitor and control system

5 | P a g e

For IDP we have visited Morbi ceramic estate at ghutu road, Morbi. There is 300 to 400

ceramic companies make different type of tiles like vitrified tiles, floor tiles, wall tiles etc.

All companies are work with same procedure it may different for tiles type and size, at

there our group had been visited industry with reference of Ladani Girishbhai, and he is

the employer of Wintech Automation, all Automation Systems of most industry is made

by Wintech Automation in Morbi. We had visited a ceramic factory named “Real

Ceramic”; the main product of that company is a vitrified tile and floor tiles. When visited

a company we had observed that there are three main processes for making ceramic tiles

from raw material of sand and cement. The detailed description of those three processes

can be given as below:

1) In first phase they mix the raw material of sand and cement in the huge container

at very high pressure and this mixture has been given to the ceramic die.

First monitoring & control system has worked to count tiles at the end of

first process and store this data.

2) After completing the 1st phase, the tiles are entered into a heating chamber. The

temperature of that heating chamber is around 100 C to 900 C. Apart from this

function second monitoring & controlling system have to observed rod which is

used to move the tiles from one place to other place at definite speed. Speed for

that process is also control by second phase system. The Second monitoring &

controlling system also observed a gas pipe which supplies a gas to heating

chamber for maintain the temperature of heating chamber by burning that gas.

Because if temperature change, the structure of the tiles will be change. After

giving a proper temperature the printing is done on the ceramic tiles. Here also

temperature is important; the color of the tiles is depends on it. Changing in

temperature also change the brightness of the tiles.

So the second phase second monitoring & control system is monitor/maintain the

temperature of that heating chamber and speed of rod as well as the flow of gas

supplied to the heating chamber.

LITERATURE SURVEY

Chapter – 3

Page 6: Online monitor and control system

6 | P a g e

3) In 3rd

Phase, again they have to pass ceramic tiles from other heating chamber

which has a temperature around 600 to 1300 C. Here high temperature is required

for the good shape of the tiles. Secondary heating chamber is an identical module

of primary heating chamber which consists moving rod, gas pipe etc.

So in 3rd

phase same as 2nd

phase third monitoring & control system is monitor/maintain

the temperature of that heating chamber, speed of rod as well as the flow of gas supplied

to the heating chamber. Secondary heating chamber is also give actual color of the tiles.

After that the ceramic tiles is given to the coolant chamber, which has a temperature of

around 100 C so it make tiles cooler. For that third monitoring & controlling system is

maintain the temperature of that chamber as well as count the no. of tiles at the last stage

and compare it with the no. of tile counted earlier. This is basically a three stage process

in which monitoring & controlling system has to maintain temperature, pressure and

movement at each and every point. So it will make this process bit difficult for

monitoring & controlling.

Figure 3.a Tiles Making Process with Controlling Station

Page 7: Online monitor and control system

7 | P a g e

Now we will take an example of an issue which is discussed with industrial person.

According to that issue whenever tiles pattern is changed, technician need to change

thickness of tiles, printing style and temperature and it is very difficult to change all

parameter at different place, employee who handle all system is need to rush at all

monitoring and control system.

When any accident occurs in the company system activate the alarm but at the same time

if the controlling person is not there in the controlling chamber it is very dangerous for all

the workers working in company. We need to shift all three systems at one central place

then it is required to maintain all parameters like temperature, speed of rod etc. as it is.

We have two choose for solving

1) Use of Ethernet control IC.

2) Communicate with computer and database.

3.1 Use of Ethernet control IC

Ethernet control IC is use for make Ethernet enable system it is make possible to connect

microcontroller with RJ45, ENC28J60 is a one of the IC which widely used, it is based on

synchronous communication and also for that we need to develop TCP/IP protocols with

microcontroller and with send data to web page, we need to program our HTML web

page with microcontroller it somewhat tuff work, and also we need to purchase static IP

for use our system over internet.

3.2 Communicate with Computer and Database

We need to make interface microcontroller with computer and update database and now

one web page is show this data with good GUI and also user can able to update database.

We can easily use any free hosting side with lass many then previse method. And also

this method is providing good GUI interface and security.

For that we are choose second way communicate with computer and database for solving

this project.

Page 8: Online monitor and control system

8 | P a g e

Figure 3.b Implication Diagram of Project

•microcontroller is connect with hardware

microcontroller

•microcontroller is communicating with computer

VB application •web application

is communicating with VB application

web application

Page 9: Online monitor and control system

9 | P a g e

4.1 Block diagram of project:

Figure 4.a Block Diagram of Project

To implement our project we are having to possibilities one is use with Ethernet

controller IC and another is make some static software on computer which can

communicate with microcontroller or also save all data in online database.

IMPLEMENTATION OF THE

PROJECT WORK

Chapter – 4

Page 10: Online monitor and control system

10 | P a g e

In first case with Ethernet controller IC we need static IP for make it online, and in our

project we need to combine three controlling center in to one mobile controlling center it

is difficult to do this with only hardware we need to go for static software approach.

4.2 Component Use:

AT89C51RD2 Microcontroller

ADC8004

MAX232

VB 6.0

Microsoft Comm. Control 6.0(MSComm.)

Microsoft ADO Control 6.0(ADODC)

MY-SQL ODBC 5.1 driver

MY-SQL

Apache

4.3 Simulator and Emulator use:

Proteus 7.7

Keil 4.0

Virtual Serial Port Emulator

Serial Terminal

XAMPP

BASCOM

AVR Studio

In static software approach we need to make static software which can be communicate

with microcontroller or also it save data in online database. We will use serial-port with

USRT without handshaking or communicate microcontroller with static application of

computer. As a static application we can use C or VB but hear we need to provide static

GUI for user and it is difficult to make GUI application with C, and another reason is we

cannot able to easily update online database like My-SQL for that we are going with VB.

It is easy to make good GUI with VB and also we can able to update any database with

VB just use of ODBC component. And also for the serial communication VB have

separate component “Microsoft communication 6.0” for serial port interfacing.

Page 11: Online monitor and control system

11 | P a g e

Now for the online application we are choose PHP and HTML with My-SQL database,

because PHP is easy and open source also easy to use My-SQL with that.

For hardware part, we are using AT89C51RD2 Phillips IC with MAX232 because serial-

port communication and also for temperature and pressure monitoring we are using

ADC0808 analog to digital converter, and motor driver start motor.

4.4 System Requirement:

Operating system = windows XP, windows vista, windows 7

.Net framework 2.0

Internet connection

Apache 2.2

My-SQL Server 5.5

My-SQL ODBC driver 5.1

MSComm control 6.0

Page 12: Online monitor and control system

12 | P a g e

5.1 Microcontroller P89V51RD2:

The P89V51RD2 is an 89C51 microcontroller with 64kb Flash and 1024 bytes of data

RAM. A key feature of the P89V51RD2 is its X2 mode option. The design engineer can

choose to run the application with the conventional 89C51 clock rate (12clocks per

machine cycle) or select the X2 mode (6clocks per machine cycle) to achieve twice the

throughput at the same clock frequency. Another way to benefit from this feature is to

keep the same performance by reducing the clock frequency by half, thus dramatically

reducing the EMI. The Flash Program memory supports both parallel programming and

in serial In-System Programming (ISP). Parallel programming mode offers gang-

programming at high speed, reducing programming costs and time to market. ISP allows

a device to be reprogrammed in the end product under software control. The capability to

field/update the application firmware makes a wide range of applications possible. The

P89V51RD2 is also In-Application Programmable (IAP), allowing the Flash program

memory to be reconfigured even while the application is running.

5.1.1 Features Provided By P89V51RD2:

5V Operating voltage from 0 to 40MHz

64kB of on-chip Flash program memory with ISP (In-System Programming) and

Supports 12-clock (default) or 6-clock mode selection via software or ISP

SPI (Serial Peripheral Interface) and Enhanced UART

PCA (Programmable Counter Array) with PWM and Capture/Compare functions

Three 16-bit timers/counters

5.1.2 Basic Pins :

PIN 9: PIN 9 is the reset pin which is used reset the microcontroller‟s internal

registers and ports upon starting up. (Pin should be held high for 2 machine

cycles.)

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.

DETAIL ABOUT ALL COMPONENTS Chapter – 5

Page 13: Online monitor and control system

13 | P a g e

PIN 40 and 20: Pins 40 and 20 are VCC and ground respectively. The 8051 chip

needs +5V 500mA to function properly,

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 store enable". In order to use the external memory

it is required to provide the low voltage (0) on both PSEN and EA pins.

5.1.3 Pin Configuration:

Figure 5.a Pin Diagram of Microcontroller P89V51RD2

Page 14: Online monitor and control system

14 | P a g e

5.1.4 Ports:

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

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,

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 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 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.

5.1.5 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 12MHz clock) to 3.33MHz (for the

maximum 40MHz clock). The oscillator circuit that generates the clock pulses so that all

internal operations are synchronized.

Page 15: Online monitor and control system

15 | P a g e

5.2 Microcontroller ATmega16:

ATmega16 is an 8-bit high performance microcontroller of Atmel‟s Mega AVR family

with low power consumption. Atmega16 is based on enhanced RISC (Reduced

Instruction Set Computing) architecture with 131 powerful instructions. Most of the

instructions execute in one machine cycle. Atmega16 can work on a maximum frequency

of 16MHz.

ATmega16 has 16 KB programmable flash memory, static RAM of 1 KB and EEPROM

of 512 Bytes. The endurance cycle of flash memory and EEPROM is 10,000 and 100,000,

respectively. ATmega16 is a 40 pin microcontroller. There are 32 I/O (input/output) lines

which are divided into four 8-bit ports designated as PORTA, PORTB, PORTC and

PORTD. ATmega16 has various in-built peripherals like USART, ADC, Analog

Comparator, SPI, JTAG etc. Each I/O pin has an alternative task related to in-built

peripherals. The following table shows the pin description of ATmega16.

Figure 5.b pin Diagram of ATmega16

Page 16: Online monitor and control system

16 | P a g e

5.2.1 Pin Descriptions

VCC Digital supply voltage.

GND Ground.

Port A (PA7..PA0) Port A serves as the analog inputs to the A/D Converter.

Port A also serves as an 8-bit bi-directional I/O port, if the A/D Converter is not used.

Port pins can provide internal pull-up resistors (selected for each bit). The Port A output

buffers have symmetrical drive characteristics with both high sink and source capability.

When pins PA0 to PA7 are used as inputs and are externally pulled low, they will source

current if the internal pull-up resistors are activated. The Port A pins are tri-stated when a

reset condition becomes active, even if the clock is not running.

Port B (PB7..PB0) Port B is an 8-bit bi-directional I/O port with internal pull-up resistors

(selected for each bit). The Port B output buffers have symmetrical drive characteristics

with both high sink and source capability. As inputs, Port B pins that are externally pulled

low will source current if the pull-up resistors are activated. The Port B pins are tri-stated

when a reset condition becomes active, even if the clock is not running.

Port C (PC7..PC0) Port C is an 8-bit bi-directional I/O port with internal pull-up resistors

(selected for each bit). The Port C output buffers have symmetrical drive characteristics

with both high sink and source capability. As inputs, Port C pins that are externally pulled

low will source current if the pull-up resistors are activated. The Port C pins are tri-stated

when a reset condition becomes active, even if the clock is not running. If the JTAG

interface is enabled, the pull-up resistors on pins PC5(TDI), PC3(TMS) and PC2(TCK)

will be activated even if a reset occurs. Port C also serves the functions of the JTAG

interface.

Port D (PD7..PD0) Port D is an 8-bit bi-directional I/O port with internal pull-up resistors

(selected for each bit). The Port D output buffers have symmetrical drive characteristics

with both high sink and source capability. As inputs, Port D pins that are externally pulled

low will source current if the pull-up resistors are activated. The Port D pins are tri-stated

when a reset condition becomes active, even if the clock is not running.

Page 17: Online monitor and control system

17 | P a g e

RESET Reset Input. A low level on this pin for longer than the minimum pulse length

will generate a reset, even if the clock is not running. Shorter pulses are not guaranteed to

generate a reset.

XTAL1 Input to the inverting Oscillator amplifier and input to the internal clock

operating circuit. XTAL2 Output from the inverting Oscillator amplifier.

AVCC AVCC is the supply voltage pin for Port A and the A/D Converter. It should be

externally connected to VCC, even if the ADC is not used. If the ADC is used, it should

be connected to VCC through a low-pass filter.

AREF AREF is the analog reference pin for the A/D Converter.

5.2.2 ADC0804

ADC0804 is a single channel analog to digital convertor i.e., it can take only one analog

signal. An ADC has n bit resolution (binary form) where n can be 8,10,12,16 or even 24

bits. ADC 0804 has 8 bit resolution. The higher resolution ADC gives smaller step size.

Step size is smallest change that can be measured by an ADC. For an ADC with

resolution of 8 bits, the step size is 19.53mV (5V/255).

The time taken by the ADC to convert analog data into digital form is dependent on the

frequency of clock source. ADC0804 can be given clock from external source. It also has

an internal clock. However the conversion time cannot be more than110us. To use the

internal clock a capacitor and resistor is connected to pin 19 and 4 as shown in the circuit

diagram. The frequency is given by the relation f= 1/ (1.1RC). The circuit uses a

resistance of 10k and a capacitor of 150pF to generate clock for ADC0804. Vin, which is

the input pin, is connected to a preset to provide analog input.

Page 18: Online monitor and control system

18 | P a g e

Figure. 5.c ADC0804 pin Diagram

5.2.3 Pin Description :

1. CS, Chip Select: This is an active low pin and used to activate the ADC0804.

2. RD, Read: This is an input pin and active low. After converting the analog data,

the ADC stores the result in an internal register. This pin is used to get the data out of

the ADC 0804 chip. When CS=0 & high to low pulse is given to this pin, the digital

output is shown on the pins D0-D7.

3. WR, Write: This is an input pin and active low. This is used to instruct the ADC

to start the conversion process. If CS=0 and WR makes a low to high transition, the

ADC starts the conversion process.

4. CLK IN, Clock IN: This is an input pin connected to an external clock source.

5. INTR, Interrupt: This is an active low output pin. This pin goes low when the

conversion is over.

6. Vin+ : Analog Input .

7. Vin- : Analog Input. Connected to ground.

8. AGND: Analog Ground.

Page 19: Online monitor and control system

19 | P a g e

9. Vref/2: This pin is used to set the reference voltage. If this is not connected the

default reference voltage is 5V. In some application it is required to reduce the step

size. This can be done by using this pin.

10. DGND: Digital Ground.

11-18. Output Data Bits (D7-D0).

19. CLKR: Clock Reset.

20. Vcc: Positive Supply

5.3 RS-232 :

Communication as defined in the RS232 standard is an asynchronous serial

communication method. The word serial means, that the information is sent one bit at a

time. Asynchronous tells us that the information is not sent in predefined time slots. Data

transfer can start at any given time and it is the task of the receiver to detect when a

message starts and ends.

Figure 5.d Pin diagram of RS232

Page 20: Online monitor and control system

20 | P a g e

RS232 is now a days the most widely used serial I/O interface standard, RS232

input/output voltage is not TTL compatible Bit 1 is –3V to –25V Bit 0 +3V to +25V.To

connect RS232 to a TTL-level chip requires voltage converters to convert the TTL logic

levels to the RS232 voltage level, and vice versa. MAX232/233 IC chips use commonly,

MAX232/233 is called line drivers.

As given in fig RS232 port have 9 pin for that its name is D9 connecter here tow pin 2&3

for receiving and transmitting data and 2 pin 5&9 for ground and ring indicator remaining

is a ATM pin for handshaking.

In RS232 framing is done for sending data 0 as a start bit, and 1 as a stop bit in between 8

bit data is framed and also if needed then parity bit is add for redundancy. Framing is

shown in figure 1.

Figure 5.e Bit framing of UART Transmission and receiving

Now we need to select proper baud rate or BPS (bit per second) for communicate

between PC and microcontroller baud rate must be constant throughout the

communication, in our project we are use constant baud rate 9600 throughout the project.

5.4 MAX232

We are developed microcontroller AT89c51RD2 board for serial communication with

RS232 port. Hear MAX232 is used for convert the RS232 levels down to lower levels,

typically 3.3 or 5.0 Volts, because Serial RS-232 communication works with voltages -

15V to +15V for high and low. On the other hand, TTL logic operates between 0V and

Page 21: Online monitor and control system

21 | P a g e

+5V, Modern low power consumption logic operates in the range of 0V and +3.3V or

even lower.

RS232 and MAX232 connection diagram with pc is given below here in that four

carpenter is used and 3(Tx) and 2(Rx) pin of the pc port is given at 13(R1in) & 14(T1out)

pin of MAX232, and 11(T1in) & 12(R1out) pin of MAX232 is given to the

microcontroller pin P3.1 (Tx) & P3.0(Rx) respectively and also need to make common

ground of all three devices.

Figure 5.f Pin diagram of MAX232 and Connection with RS232

5.5 ULN2003

ULN2003 is a high voltage and high current Darlington array IC. It contains seven open

Collector Darlington pairs with Common Emitters. A Darlington pair is an arrangement

of two bipolar transistors.

ULN2003 belongs to the family of ULN200X series of ICs. Different versions of this

family interface to different logic families. ULN2003 is for 5V TTL, CMOS logic

devices. These ICs are used when driving a wide range of loads and are used as relay

drivers, display drivers, line drivers etc. ULN2003 is also commonly used while driving

Stepper Motors. Refer Stepper Motor interfacing using ULN2003.

Page 22: Online monitor and control system

22 | P a g e

Each channel or Darlington pair in ULN2003 is rated at 500mA and can withstand peak

current of 600mA. The inputs and outputs are provided opposite to each other in the pin

layout. Each driver also contains a suppression diode to dissipate voltage spikes while

driving inductive loads.

Fig 5.g pin diagram of ULN2003

5.6 Microsoft comm. control 6.0(MSComm.)

The MSComm. control provides serial communications for your application by allowing

the transmission and reception of data through a serial port. The MSComm. control

provides the following two ways for handling communications.

Interrupt communication:

Interrupt process is check device signal if the devices has already in sending code to

comport of computer. We are programming in Comm. Event and On Comm. Event that

these event will be active when coming signal from device.

Polling Communication:

In PC system, the polling has some transferring between terminal and CPU in case data is

byte type that keyboard send coming. The polling will be through checking signal from

device such as keyboard polling as user press button. For CPU polling to check signal, we

Page 23: Online monitor and control system

23 | P a g e

call " Wet Poll" that will be loss time 90% , We can avoid the cycle time lose with using

polling technique that call is "Round Robin" About in VB programming ,we use Timer

Control for Checking data from Serial port .

MSComm Element.

Properties Description

Comport Set and returns the communications port number.

Settings Sets and returns the baud rate, parity, data bits, and stop bits as string.

Portopen Sets and returns the state of a communications port. Also opens and closes a port.

Output Writes a string of characters to the transmit buffer.

Table 1 (MSComm Element Properties and its Description)

5.7 Microsoft ADO control 6.0(ADODC)

The ADO Data control uses Microsoft ActiveX Data Objects (ADO) to quickly create

connections between data-bound controls and data providers. Data-bound controls are any

controls that feature a Data Source property. Data providers can be any source written to

the OLE DB specification. You can also easily create your own data provider using

Visual Basic's class module.

Although you can use the ActiveX Data Objects directly in your applications, the ADO

Data control has the advantage of being a graphic control (with Back and Forward

buttons) and an easy-to-use interface that allows you to create database applications with

a minimum of code.

Open Database Connectivity (ODBC) is Microsoft's strategic interface for accessing data

in a heterogeneous environment of relational and non- relational database management

systems. Based on the Call Level Interface specification of the SQL Access Group,

ODBC provides an open, vendor- neutral way of accessing data stored in a variety of

proprietary personal computer, minicomputer, and mainframe databases.

Page 24: Online monitor and control system

24 | P a g e

ODBC alleviates the need for independent software vendors and corporate developers to

learn multiple application programming interfaces. ODBC now provides a universal data

access interface. With ODBC, application developers can allow an application to

concurrently access, view, and modify data from multiple, diverse databases.

ODBC is a core component of Microsoft Windows Open Services Architecture. Apple

has endorsed ODBC as a key enabling technology by announcing support into System 7

in the future. With growing industry support, ODBC is quickly emerging as an important

industry standard for data access for both Windows and Macintosh applications.

5.8 MY-SQL ODBC 5.1 driver

The MySQL Connector/ODBC is the name for the family of MySQL ODBC drivers

(previously called MYODBC drivers) that provide access to a MySQL database using the

industry standard Open Database Connectivity (ODBC) API. This reference covers

Connector/ODBC 3.51 and Connector/ODBC 5.1. Both releases provide an ODBC

compliant interface to MySQL Server.

MySQL Connector/ODBC provides both driver-managers based and native interfaces to

the MySQL database, with full support for MySQL functionality, including stored

procedures, transactions and, with Connector/ODBC 5.1, full Unicode compliance.

Figure 5.h (MY-SQL ODBC driver 5.1)

Page 25: Online monitor and control system

25 | P a g e

6.1 ADC0804 interfacing with p89c51rd2

The easiest way to do analog to digital conversion is to use an IC such as the ADC0804

that does the work for you. The analog voltage is applied to pin 6 and the result is

available at pins 11 through 18. We will connect pin 1 and 2 (Chip Select and Read) to

ground so that the chip is always enabled. (If you wanted to use more than one ADC you

could use this pin to control which chip is currently enabled).Connect pin 7 (Vin) to

ground. The ADC0804 includes an internal oscillator which requires an external capacitor

and resistor to operate. Connect the 150 pF capacitor from pin 4 (CLOCK IN) to ground

and the 10k ohm resistor from pin 4 to pin 19 (CLOCK R).

Figure.6.a (adc0804 interfacing with p89v51rd2)

IMPLEMENT CIRCUITS AND FLOW

CHART

Chapter – 6

Page 26: Online monitor and control system

26 | P a g e

ADC0804 is a very commonly used 8-bit analog to digital convertor. It is a single channel

IC, i.e., it can take only one analog signal as input. The digital outputs vary from 0 to a

maximum of 255. The step size can be adjusted by setting the reference voltage at pin9.

When this pin is not connected, the default reference voltage is the operating voltage, i.e.,

Vcc. The step size at 5V is 19.53mV (5V/255), i.e., for every 19.53mV rise in the analog

input, the output varies by 1 unit. To set a particular voltage level as the reference value,

this pin is connected to half the voltage. For example, to set a reference of 4V (Vref), pin9

is connected to 2V (Vref/2), thereby reducing the step size to 15.62mV (4V/255).

6.1.2 Flow chart:

Figure.6.b (Flowchart of adc0804 Interfacing)

Page 27: Online monitor and control system

27 | P a g e

6.2 RS232 interface with microcontroller

For interface RS232 with microcontroller P89V51RD2 we need to use MAX232, and

connection like seen in fig.

Figurer.6.c (RS232 interfacing with P89V51RD2 simulation)

For that also we need to load program in microcontroller for UART (universal

asynchronous receiving transmission), microcontroller need to continually read port and

also send data port at regular time interval, we send data to SBUF of microcontroller and

then as per requirement we need to send to port of microcontroller. And also UART we

need to constant BPS for that we need to use timer hear we are using timer 1 in mode 2

with sat TMOD 20 mode 2 is an 8-bit timer therefore it allows only values of 00 to FFH

to be loaded into the timer‟s register TH, After TH is loaded with the 8-bit value 0xFD,

The SCON register is loaded with the value 50H, indicating serial mode 1, where an 8-bit

data is framed with start and stop bits. TR1 is set to 1 to start timer 1 then TI is cleared

and the character byte to be transferred serially is written into SBUF register, same as for

resaving data same RI is sat by 1 and read data form SBUF after that RI is cleared.

We are making C code which resave data from PC and according to them send it to port

P1.

Page 28: Online monitor and control system

28 | P a g e

6.2.1Flow chart of data Receiving C code:

Figure 6.d (Flowchart of data Receiving by Microcontroller)

Page 29: Online monitor and control system

29 | P a g e

6.3 VB Application Interface with COM Port :

For interface COM port with VB we need to use Microsoft Comm. control 6.0 component

and then add it in our form. Then assign property as our requirement, as per shown in fig.

Figure.6.e (MSComm. components with properties)

And then we will send and receive data with VB, with writing simple code for starting or

loading time of every form we will open the comport because before the use of comport

we need to open it.

Now after that we will send data receive data by just writing simple code like this.

MSComm1.PortOpen = True \\ for open port.

MSComm1.Output = "a" \\ for send output char „a‟.

Label1.Caption = MSComm1.Input \\ for take input from COM port and display to

lable1.

MSComm1.PortOpen = False \\ for close port.

Page 30: Online monitor and control system

30 | P a g e

6.4 Framing of Microcontroller and PC data Communication.

Here we are synchronize all data sending and receiving data from microcontroller to VB

application hear we are send acknowledge to receive data for synchronize data of timer

event.

Fig. 6.f ( Data Flow and Synchronization)

Page 31: Online monitor and control system

31 | P a g e

6.5 Make MY-SQL Database :

The MySQL database has become the world's most popular open source database because

of its high performance, high reliability and ease of use. It is also the database of choice

for a new generation of applications built on the LAMP stack (Linux, Apache, MySQL,

PHP / Perl / Python.) Many of the world's largest and fastest-growing organizations

including Facebook, Google, Adobe, Alcatel Lucent and Zappos rely on MySQL to save

time and money powering their high-volume Web sites, business-critical systems and

packaged software.

MySQL runs on more than 20 platforms including Linux, Windows, Mac OS, Solaris,

IBM AIX, giving you the kind of flexibility that puts you in control. Whether you're new

to database technology or an experienced developer or DBA, MySQL offers a

comprehensive range of database tools, support, training and consulting services to make

you successful.

For save data in data base we are use My-SQL database it is communicate with VB

application and also with PHP web application. For make motor control section we will

make database name as a motor and under this database name 2 table moter1 and moter2

this two table have same field Mval and all table have only one row with information

about states of this motor.

Motor (database name)

Table name Motor1 Motor2 Temp1 Temp2 Online

Feld name Mval Mval Val Val En

Data On On As integer As integer Boolean

Table 2 (Database of System for Motor Control)

Page 32: Online monitor and control system

32 | P a g e

Login (data base name)

Table name Login data

Field name Username Password

Data type varchar(36) varchar(36)

Table 3 (Login Page Database)

It can be updated by static VB application or PHP web application for given bidirectional

information transfer. Database is saved in PC where microcontroller hardware is

connected with that and also this is served for client who can use web application for

Monitoring and Control industrial Application.

Page 33: Online monitor and control system

33 | P a g e

6.7 VB application interact with database

As given above in MY-SQL ODBC driver we need to first make ODBC connection with

MY-SQL data base, now we need to use another component from VB component list it is

Microsoft ADO data control 6.0 (OLEDB). And add this component from component list

and drag to form that.

Figure 6.g (Microsoft ADO Control and its Properties)

Now this is proses for connect database with VB application after that we need to update

data on data and also take data from data base, we are here direct sate filed to the separate

label and assign property to the label as shown in finger. Coad which use for database

connection:

Page 34: Online monitor and control system

34 | P a g e

Adodc1.RecordSource = "SELECT Author FROM book" „Set database sours and filter.

Adodc1.Refresh ' Refresh database

Adodc1.RecordSet.MoveFirst ' Move to the first record

Adodc1.RecordSet.MoveLast ' Move to the last record

Adodc1.RecordSet.MoveNext ' Move to the next record

Adodc1.RecordSet.Previous ' Move to the previous record

Adodc1.RecordSet.AddNew ' Adds a new record

Adodc1.RecordSet.Update ' Updates and saves the new record

Adodc1.RecordSet.Delete ' Deletes a current record

Adodc1.Caption = Adodc1.RecordSource ' Set caption of database

Adodc1.Recordset.Fields ("field1") = text1.Text ' Add text1 to the field1 of database

Adodc1.Recordset.Fields ("field1").Value = text1.Text ' Add value of text1 to the field1

of database

We need to first set the data in text box or label with use of record set and then after it

gives the data to data base and then we can use it and also update it if we won‟t move

database first, last, privies, next than it will done with above codes.

6.8 VB form GUI:

Page 35: Online monitor and control system

35 | P a g e

Main Form: Static Control Form:

Online Control:

Figure.6.h ( GUI designing of VB6.0 Application)

6.8.1 Flow Chart of VB application:

Page 36: Online monitor and control system

36 | P a g e

Figure 6.i (Flow Chart of VB Application)

6.9 HTML Web Site Designing:

Page 37: Online monitor and control system

37 | P a g e

6.9.1 Home Page:

Figure.6.j. (Home Page of Website)

6.9.2 Login Page:

Figure 6.k (Login Page of System)

Page 38: Online monitor and control system

38 | P a g e

Login page is used for authentication of user which won‟t to use online web application

for monitoring and controlling industrial application he/she must have its on user name

and password for access web application

Here we need to tack information from user one is username and another is password for

that we need two text box and after that one button for submit this information this all

information is under one frame.

We are use POST method to take data in place of GET method because of security risen,

in GET method user information is printed on URL of browser it easily stolen by any

hackers for that we are use POST method for send data to web server.

We can send data to the data processing page by both the GET and POST methods of a

form. Both methods are used in form data handling where each one has some difference

on the way they work. We will discuss some of the differences.

As you have seen there is a character restriction of 255 in the URL. This is mostly the old

browsers restriction and new ones can handle more than that. But we can't be sure that all

our visitors are using new browsers. So when we show a text area or a text box asking

users to enter some data, then there will be a problem if more data is entered. This

restriction is not there in POST method.

In GET method data gets transferred to the processing page in name value pairs through

URL, so it is exposed and can be easily traced by visiting history pages of the browser. So

any login details with password should never be posted by using GET method.

As the data transfers through address bar ( URL ) there are some restrictions in using

space, some characters like ampersand ( & ) etc. in the GET method of posting data. We

have to take special care for encoding (while sending) and decoding (while receiving)

data if such special characters are present.

There are some special cases where advantage of using GET method is, one can store the

name value pairs as bookmark and directly use them by bypassing the form.

Page 39: Online monitor and control system

39 | P a g e

6.9.3 Flow chart:

Figure 6.l (Flow Chart of Login Page)

Page 40: Online monitor and control system

40 | P a g e

6.9.4 Registration Form

Figure.6.m (Registration Page of Website)

6.9.5 Two step Verification with SMS:

Figure.6.n (Two Step Verification)

Page 41: Online monitor and control system

41 | P a g e

6.9.6 Flow Chart:

Figure.6.o (Flow Chart of Mobile Verification)

Page 42: Online monitor and control system

42 | P a g e

6.9.7 Motor Control Page:

Motor control page is use to monitor motor states and also change motor states like from

ON to OFF and vice versa hear four butane for two motor for first motor 1 two switches

one is for ON motor and another is for OFF motor and below that text is show the states

of motor.

Figure.6.p (Motor Control and Monitor Page for System)

First check which switch is pressed and then as per switch call PHP file, every PHP file is

contained database coding which update database of MY-SQL and go back to the main

page in main page PHP script is use for sown states of motor from database, this proses is

continues and it will give also message to user if static controlling process is started.

Page 43: Online monitor and control system

43 | P a g e

6.9.8 Flow chat for motor control:

Figure.6.q (Flow Chart of Motor Control and Monitoring Page)

Page 44: Online monitor and control system

44 | P a g e

Work/time Jun

e

Jul

y

Au

g

Sep Oct No

v

De

c

Jan Feb Ma

r

Apr

il

Literature

survey

Pc to

microcontrolle

r

communicatio

n

Adc0804 and

Motor drive

Learn PHP

and html

designing

My-SQL.

connectivity to

PHP

Data base

connectivity to

VB

application

Insert Security

verification

Project with

ATmega16

Testing and

Troubleshooti

ng

Table 3 (Project Management)

PROJECT MANAGEMENT Chapter – 7

Page 45: Online monitor and control system

45 | P a g e

Conclusion

In this report the Internet based process control has been examined. Internet-based control

is only an extra control level added into the existing process control hierarchy. When

designing architecture the requirement specifications, user interface, universally platform-

independent programming languages and security measures are important issues.

Internet technologies can provide web clients a platform, not only for remotely

monitoring the behavior of process plants, but also for remotely controlling the plants as

well. One of the key problems in the Internet based process control is the Internet time

delay. If the Internet is heavily loaded, the responses may be delayed and the operator

corrections may take too long time for correcting the system. More advanced

technologies should be implemented to properly deal with the Internet transmission delay.

It looks that in the near future the attention will first go to develop web based monitoring

systems. When the problem of time delay is resolved the way for Internet based control is

widely open.

Page 46: Online monitor and control system

46 | P a g e

References

Reference books and papers:

The 8051 Microcontroller and Embedded Systems Using Assembly and C, 2/e

by Muhammad Ali Mazidi.

PHP Tutorial From beginner to master by W3 schools.

Professional PHP Programming by: Jesus Castagnetto,Harish Rawat,Sascha

Schumann,Chris Scollo,Deepak Veliath,Wrox Press.

PHP & MySQL Web Development All-in-One Desk Reference For Dummies by Janet

Valade with Tricia Ballad and Bill Ballad Published by Wiley Publishing Inc.

Learn Visual Basic 6.0 by KIDware (206) 721-2556.

AYALA - The 8051 Microcontroller Architecture, Programming and Applications 1991

Reference webs pages:

http://myphpform.com/php-form-tutorial.php

http://www.w3schools.com/html/default.asp

http://www.w3schools.com/php/default.asp

http://www.vbtutor.net/vb6/vbtutor.html

http://www.profsr.com/vb/vbintro.htm

http://www.profsr.com/sql/sqlintro.htm

http://www.profsr.com/webprogramming/index.html

http://mytutorialcafe.com/Microcontroller%20Serial%20Send%20Data%20ADC.htm