63
CONTENTS Chapter No. TITLE Page no. List of Abbreviations i List of Figures ii List of Tables iii 1 INTRODUCTION 1 1.1 Introduction 1 1.2 Problem Definition 2 1.3 Market Survey 3 2 BLOCK DIAGRAM 4 2.1 Block Diagram 5 2.2 Block Diagram Description 6 3 HARDWARE DESIGN 7 3.1 Circuit Diagram 7 3.2 Circuit Description 8 3.3 Selection of components 8

Generic Program Interface Device System for Industrial Automation

Embed Size (px)

DESCRIPTION

PROGRAM INTERFACE DEVICE

Citation preview

Page 1: Generic Program Interface Device System for Industrial Automation

CONTENTS

Chapter No. TITLE Page no.

List of Abbreviations i

List of Figures ii

List of Tables iii

1 INTRODUCTION 1

1.1 Introduction 1

1.2 Problem Definition 2

1.3 Market Survey 3

2 BLOCK DIAGRAM 4

2.1 Block Diagram 5

2.2 Block Diagram Description 6

3 HARDWARE DESIGN 7

3.1 Circuit Diagram 7

3.2 Circuit Description 8

3.3 Selection of components 8

4 SOFTWARE 9

4.1 Algorithm 9

4.2 Flow Chart 10

4.3 Code 11

5 SIMULATION 12

6 PCB DESIGN 14

6.1 PCB Design Steps 15

6.2 PCB Layout 16

7 TESTING 17

8 APPLICATION & FUTURE SCOPE 18

9 BILL OF MATERIAL 19

BIBILOGRAPHY 20

Page 2: Generic Program Interface Device System for Industrial Automation

CHAPTER 1

1.1 INTRODUCTION:

Specific objectives of the process control is to increased product throughput,

Increase yield of higher valued products, Decrease energy consumption, Decrease pollution,

Decrease off-spec product, Increase Safety, Extend life of equipment, Improve Operability,

Decrease production labor.

First task in the implementation of modern control is to obtain a model of the process to

be controlled. However, given that there are constraints on process operations; that all models

will contain some degree of error and that all models may not be invertible, perfect control is

very difficult to realize. These are the issues that modern control techniques aim to address,

either directly or indirectly.

In era of automation and control, we expect many things to be done automatically. For

this purpose there is desperate need of something that can store the data, process it and give the

output accordingly, as well as ease of handling, whatever environmental conditions of the

industry. It not only saves money but also time by reducing human errors.

It is also well known that any improvement in the performance of control strategies will

result in more consistent production, facilitating process optimization, hence less re-processing

of products and less waste.

Page 3: Generic Program Interface Device System for Industrial Automation

1.2 Problem Definition

AIM

The main theme of the project is to build a generic interface device that can be used in

industries for a vast array of applications.

DOMAIN

Process Control

Industrial Automation

CONCEPT

Page 4: Generic Program Interface Device System for Industrial Automation

• Build a Visual c based software program that can interface with the GPID board no mat-

ter what the environment (e.g. Chemical Plant, Paper Pulp Industries, Motor Control, Ro-

botics etc.)

CHAPTER 2

BLOCK DIAGRAM:

Page 5: Generic Program Interface Device System for Industrial Automation

Fig. 2.1 Block Diagram

Computer Micro Controller 89V51

Power Supply Unit

DC MOTOR

Stepper Motor

CFL TUBE RS 232

FAN

MAX 232

Page 6: Generic Program Interface Device System for Industrial Automation

2.1 Block Diagram Description:

The system consists of three sections. The first PCB contains power supply, The secondThe system consists of three sections. The first PCB contains power supply, The second

PCB contains RS 232 protocol. The third PCB contains microcontroller. The, fourth PCBPCB contains RS 232 protocol. The third PCB contains microcontroller. The, fourth PCB

consists of Relay circuitry.consists of Relay circuitry.

When the power is ON initially, all IC’s & relays get resets. When the power is ON initially, all IC’s & relays get resets.

Once any Button is pressed by user through pcc control device window(GUI), PC will send

command to Microcontroller with the help of standard serial communication protocol(RS 232).

And through microcontroller relay operation take place & according that home appliance works.

1) Computer: We have used computer in order to give commands to the system with

the help of RS 232 protocol commands will be given through special GUI (Graphical

User Interface)

2) RS 232 Protocol: It has been used in order to do serial communication with for

this we have used MAX 232 as level converter

3) MICRO-CONTROLLER (8051): This is the most important segment of the

project. The controller is responsible for detection and polling of the peripherals sta-

tus. It is responsible for making. It is responsible for prioritizing all the devices at-

tached to it.

WE have used the P89V51RD2 microcontroller. The P89V51RD2 is a low-power,

high-performance CMOS 4-bit microcontroller with 64K bytes of in-system pro-

grammable Flash memory. It has got 32 I/O lines two data pointers, two 16-bit

timer/counters, six-vector two-level interrupt architecture, a full duplex serial port,

on-chip oscillator, and a clock circuitry

5) Light: We have used LED s in order to represent lamp in the normal day to day

life.

Page 7: Generic Program Interface Device System for Industrial Automation

6) RELAY: We have used relay. It will perform the function of switch; it can be used

in various applications.

7) Power Supply: There are many types of power supply. Most are designed to con-

vert high voltage AC mains electricity to a suitable DC voltage supply for electronics

circuits and other devices. We have used 5 Volt power supply in this system.

CHAPTER 3

HARDARE DESIGN

3.1 SELECTION OF COMPONENTS:

Specification of Components used:

Microcontroller P89V51RD2:

Features

64 KB of on-chip flash program memory with ISP (In-System Programming) &

IAP (In-Application Programming).

5V operating voltage from 0 to 40 MHz

SPI (Serial Peripheral interface) & Enhanced UART

1 KB RAM

32 I/O lines

Programmable counter array

Eight interrupt sources with four priority levels

Four 8-bit I/O ports

Low EMI mode (ALE inhibit)

In System Application Three 16-bit Timer/Counter Accumulator

ARCHITECTURE OF 89V51:

Page 8: Generic Program Interface Device System for Industrial Automation

Accumulator:

ACC is the accumulator register. It is an 8 bit register. It is most versatile and holds sources

operand and receives the result of arithmetic operations including addition, subtraction, integer

multiplication, division and Boolean bit manipulations.

It is also used for data transfer between 8051 and any external memory. Several functions like

rotate, test etc. apply specifically on the accumulator.

B Register:

The B register is used with the A register for multiplication and division operations. For other

instructions it is treated as a scratch pad register (i.e. it is has no other function other than as a

location where data can be stored.)

Arithmetic and Logic Unit (ALU):

The ALU can perform arithmetic and logic operations on eight bit data. It can perform

arithmetic operations like addition, subtraction, multiplication, division and logical

operations like AND, OR, EX – OR, complement, rotate etc.

Program Status Word (PSW) and Flags:

Many instructions affect the status of flags. In order to address these flags conveniently they are

grouped to from the program status word.

PSW contain Carry flag ( CY) , Auxiliary carry flag ( AC ), User defined Flag 0 (F0 ) , register

bank selections flag (RS0,RS1) Overflow flag( OV ) Parity flag (p) .

Flags are 1 bit registers provided to store the results of some instructions. A Flag is a flip flop

that indicates some condition produced by the execution of an instruction.

Clock and Oscillator:

The oscillator circuit that generates the clock pulses so that all the internal operations are

synchronized is the heart of the microcontroller.

Page 9: Generic Program Interface Device System for Industrial Automation

The pins XTAL 1 and XTAL 2 are provided to connect a resonating network comprising of a

crystal and capacitors to from an oscillator. Normally quartz crystal is used. The

capacitors are used in order to stabilize the network.4

RST:

Reset input. A high on his pin two machine cycles while the oscillator is running resets the

device. This pin drives high for 98 oscillator periods after the Watchdog times out. The

DISRTO bit in SFR AUXR (address 8 EH) can be used to disable this feature. In the default

state of bit DISRTO, the RESET HIGH out feature is enabled.

ALE / PROG:

Address Latch Enable ( ALE ) is an output Pulse for latching the low byte of the address during

Accesses to external memory. This pin is also the Program pulse input (PROG) during Flash

Programming.

PSEN:

Program Store Enable (PSEN) is the read strobe to external Program memory.

Program Counter ( PC ):

It is a 16 bit register. It is used to hold the address of a byte in the memory.It keeps the track of

the execution of the program. The program instruction bytes are fetched from locations in

memory that are addressed by the Program counter.

Data Pointer ( DPTR ):

The data Pointer is a bit register. It is used to hold the address of a byte in the memory.

The DPTR register can be accessed separately as lower eight bits ( DPL ) and higher eight bits

( DPH ) . It can be used as a 16 bit data register or two independent 8 – bit registers.

Page 10: Generic Program Interface Device System for Industrial Automation

The Stack and Stack Pointer:

The stack is a reserved area of the memory in RAM where temporary information may be stored.

An 8 – bit stack Pointer is used to hold the address of the most recent stack entry. This location

which has the most recent entry is called as the top of the stack.

Special Function Registers:

A map of the on-chip memory area called the Special Function Register (SFR) space is shown in

Table 5-1. Note that not all of the addresses are occupied, and unoccupied addresses may not be

implemented on the chip. Read accesses to these addresses will in general return random data,

and write accesses will have an indeterminate effect. User software should not write 1s to these

unlisted locations, since they may be used in future products to invoke new features. In that case,

the reset or inactive values of the new bits will always be 0.

Timer 2 Registers: Control and status bits are contained in registers T2CON (shown in Table 5-

2) and T2MOD (shown in Table 10-2) for Timer 2. The register pair (RCAP2H, RCAP2L) is the

Capture/Reload registers for Timer 2 in 16-bit capture mode or 16-bit auto-reload mode.

Interrupt Registers: The individual interrupt enable bits are in the IE register. Two priorities can

be set for each of the six interrupt sources in the IP register.

Input and output Ports:

The i/o circuit of microcontroller is totally versatile. It connects the microcontroller to external

world. The microcontroller 89V51 has four i/o Ports i.e. 24 lines out of 32 Port lines are for one

of the two entirely different function so, although microcontroller is 40 pin chip, it appears to

have 64 pins.

As two functions are multiplexed, in order to decide which function is supported we need to see

how the circuit is connected and what software commands are used to program the pin.

The microcontroller has four Ports named as p0, p1, p2, p3. All these Ports are bi-directional.

Page 11: Generic Program Interface Device System for Industrial Automation

RELAYS:

Function:

A relay is an electrically operated switch. Many relays use an electromagnet to operate a

switching mechanism mechanically, but other operating principles are also used. Relays are used

where it is necessary to control a circuit by a low-power signal (with complete electrical isolation

between control and controlled circuits), or where several circuits must be controlled by one

signal. The first relays were used in long distance telegraph circuits, repeating the signal coming

in from one circuit and re-transmitting it to another. Relays were used extensively in telephone

exchanges and early computers to perform logical operations.

Relay is an electromagnetic device which is used to isolate two circuits electrically and connect

them magnetically. They are very useful devices and allow one circuit to switch another one

while they are completely separate. They are often used to interface an electronic circuit

(working at a low voltage) to an electrical circuit which works at very high voltage. For example,

a relay can make a 5V DC battery circuit to switch a 230V AC mains circuit.

RELAYS

Relays are used throughout the automobile. Relays which come in assorted sizes, ratings, and

applications, are used as remote control switches. A typical vehicle can have 20 relays or more.

RELAY APPLICATIONS

Relays are remote control electrical switches that are controlled by another switch, such as a horn

Page 12: Generic Program Interface Device System for Industrial Automation

switch or a computer as in a power train control module. Relays allow a small current flow

circuit to control a higher current circuit. Several designs of relays are in use today, 3-pin, 4-pin,

5-pin, and 6-pin, single switch or dual switches.

RELAY OPERATION

All relays operate using the same basic principle. Our example will use a commonly used 4 - pin

relay. Relays have two circuits: A control circuit (shown in GREEN) and a load circuit (shown in

RED). The control circuit has a small control coil while the load circuit has a switch. The coil

controls the operation of the switch.

Page 13: Generic Program Interface Device System for Industrial Automation

RELAY ENERGIZED (ON)

Current flowing through the control circuit coil (pins 1 and 3) creates a small magnetic field

which causes the switch to close, pins 2 and 4. The switch, which is part of the load circuit, is

used to control an electrical circuit that may connect to it. Current now flows through pins 2 and

4 shown in RED, when the relay is energized.

RELAY DE-ENERGIZED (OFF)

When current stops flowing through the control circuit, pins 1 and 3, the relay becomes de-

energized. Without the magnetic field, the switch opens and current is prevented from flowing

through pins 2 and 4. The relay is now OFF.

Page 14: Generic Program Interface Device System for Industrial Automation

RELAY OPERATION

When no voltage is applied to pin 1, there is no current flow through the coil. No current means

no magnetic field is developed, and the switch is open. When voltage is supplied to pin 1, current

flow though the coil creates the magnetic field needed to close the switch allowing continuity

between pins 2 and 4.

 

Page 15: Generic Program Interface Device System for Industrial Automation

NORMALLY DESIGN ID

Relays are either Normally Open or Normally Closed. Notice the position of the switches in the

two relays shown below. Normally open relays have a switch that remains open until energized

(ON) while normally closed relays are closed until energized. Relays are always shown in the de-

energized position (no current flowing through the control circuit - OFF). Normally open relays

are the most common in vehicles; however either can be use in automotive applications.

Normally Open (NO)

 

Normally Closed (NC)

NORMALLY CLOSED RELAYS

The operation of a Normally Closed relay is the same to that of a Normally Open relay, except

backwards. In other words, when the relay control coil is NOT energized, the relay switch

contacts are closed, completing the circuit through pins 2 and 4. When the control coil is

energized, the relay switch contacts opens, which breaks the circuit open and no continuity exists

between pins 2 and 4.

Page 16: Generic Program Interface Device System for Industrial Automation

DE - ENERGIZED (OFF)

 

ENERGIZED (ON)

 

ACTUAL RELAY DESIGN

Current flows through the control coil, which is wrapped around an iron core. The iron core

intensifies the magnetic field. The magnetic field attracts the upper contact arm and pulls it

down, closing the contacts and allowing power from the power source to go to the load.

 

Page 17: Generic Program Interface Device System for Industrial Automation

Interfacing the Serial / RS232 Port:

The Serial Port is harder to interface than the Parallel Port. In most cases, any device you connect to the serial port

will need the serial transmission converted back to parallel so that it can be used. This can be done using a UART.

      RS232 is the most known serial port used in transmitting the data in communication and interface. Even though serial port is harder to program than the parallel port, this is the most effective method in which the data transmission

requires less wires that yields to the less cost. The RS232 is the communication line which enables the data transmission by only using three wire links. The three links provides ‘transmit’, ‘receive’ and common ground...

Advantages of using serial data transfer rather over parallel

1. Serial Cables can be longer than Parallel cables.

2. You don't need as many wires than parallel transmission.

3. Infra Red devices have proven quite popular recently.

4. Serial Communication reduces the pin count of these MPU's. Only two pins are commonly used, Transmit Data

(TXD) and Receive Data (RXD) compared with at least 8 pins if you use a 8 bit Parallel method (You may also

require a Strobe).

Hardware Properties:

Devices which use serial cables for their communication are split into two categories. These are DCE (Data

Communications Equipment) and DTE (Data Terminal Equipment.) Data Communications Equipment are devices

such as your modem, TA adapter, plotter etc while Data Terminal Equipment is your Computer or Terminal.

The electrical specifications of the serial port is contained in the EIA (Electronics Industry Association) RS232C

standard. It states many parameters such as -

1. A "Space" (logic 0) will be between +3 and +25 Volts.

2. A "Mark" (Logic 1) will be between -3 and -25 Volts.

3. The region between +3 and -3 volts is undefined.

4. An open circuit voltage should never exceed 25 volts. (In Reference to GND)

Serial Ports come in two "sizes"

Page 18: Generic Program Interface Device System for Industrial Automation

1. D-Type 25 pin connector

2. D-Type 9 pin connector

Below is a table of pin connections for the 9 pin and 25 pin D-Type connectors.

Page 19: Generic Program Interface Device System for Industrial Automation
Page 20: Generic Program Interface Device System for Industrial Automation

Serial Pinouts (D25 and D9 Connectors)

D-Type-25 Pin No. D-Type-9 Pin No. Abbreviation Full Name

Pin 2 Pin 3 TD Transmit Data

Pin 3 Pin 2 RD Receive Data

Pin 4 Pin 7 RTS Request To Send

Pin 5 Pin 8 CTS Clear To Send

Pin 6 Pin 6 DSR Data Set Ready

Pin 7 Pin 5 SG Signal Ground

Pin 8 Pin 1 CD Carrier Detect

Pin 20 Pin 4 DTR Data Terminal Ready

Pin 22 Pin 9 RI Ring Indicator

Table 1 : D Type 9 Pin and D Type 25 Pin Connectors

Page 21: Generic Program Interface Device System for Industrial Automation

Figure 1: Null Modem Wiring Diagram

Port Addresses & IRQ's

Name Address IRQ

COM 1 3F8 4

COM 2 2F8 3

COM 3 3E8 4

COM 4 2E8 3

Table 3: Standard Port Addresses

    

Introduction to RS-232:

          RS232 is the most known serial port used in transmitting the data in communication and interface. Even though serial port is harder to program than the parallel port, this is the most effective method in which the data transmission requires less wires that yields to the less cost. The RS232 is the communication line which enables the data transmission by only using three wire links. The three links provides ‘transmit’, ‘receive’ and common

ground...

 

           The ‘transmit’ and ‘receive’ line on this connecter send and receive data between the computers. As the name indicates, the data is transmitted serially. The two pins are TXD & RXD. There are other lines on this port as RTS, CTS, DSR, DTR, and RTS, RI. The ‘1’ and ‘0’ are the data which defines a voltage level of 3V to 25V and -3V to -25V respectively.

Page 22: Generic Program Interface Device System for Industrial Automation

       

The electrical characteristics of the serial port as per the EIA (Electronics Industry Association) RS232C Standard specifies a maximum baud rate of 20,000bps, which is slow compared to today’s standard speed. For this reason, we have chosen the new RS-232D Standard, which was recently released.

             The RS-232D has existed in two types. i.e., D-TYPE 25 pin connector and D-TYPE 9 pin connector, which are male connectors on the back of the PC. You need a female connector on your communication from Host to Guest computer. The pin outs of both D-9 & D-25 are show below.

D-Type-9 pin no.

D-Type-25 pin no.

Pin outs Function

3 2 RD Receive Data (Serial data input)

2 3 TD Transmit Data (Serial data output)

7 4 RTS Request to send (acknowledge to modem that UART is ready to exchange data

8 5 CTS Clear to send (i.e.; modem is ready to exchange data)

6 6 DSR Data ready state (UART establishes a link)

5 7 SG Signal ground

1 8 DCD Data Carrier detect (This line is active when modem detects a carrier

4 20 DTR Data Terminal Ready.

9 22 RI Ring Indicator (Becomes active when modem detects ringing signal from PSTN

 

About DTE   &   DCE :

         Devices, which use serial cables for their communication, are split into two categories. These are DCE (Data Communications Equipment) and DTE (Data Terminal Equipment.) Data Communications Equipments are devices such as your modem, TA adapter, plotter etc while Data Terminal Equipment is your Computer or Terminal. A typical Data Terminal Device is a computer and a typical Data Communications Device is a Modem. Often people will talk about DTE to DCE or DCE to DCE speeds. DTE to DCE is the speed between your modem and computer, sometimes referred to as your terminal speed. This should run at faster speeds than the DCE to DCE speed. DCE to DCE is the link between modems, sometimes called the line speed.

Page 23: Generic Program Interface Device System for Industrial Automation

           Most people today will have 28.8K or 33.6K modems. Therefore, we should expect the DCE to DCE speed to be either 28.8K or 33.6K. Considering the high speed of the modem we should expect the DTE to DCE speed to be about 115,200 BPS. (Maximum Speed of the 16550a UART) . The communications program, which we use, has settings for DCE to DTE speeds. However, the speed is 9.6 KBPS, 144 KBPS etc and the modem speed.

           If we were transferring that text file at 28.8K (DCE- DCE), then when the modem compresses it you are actually transferring 115.2 KBPS between computers and thus have a DCE- DTE speed of 115.2 KBPS. Thus, this is why the DCE- DTE should be much higher than the modem's connection speed. Therefore, if our DTE to DCE speed is several times faster than our DCE to DCE speed the PC can send data to your modem at 115,200 BPS. 

Page 24: Generic Program Interface Device System for Industrial Automation

active. At this point, the computer thinks the Virtual Modem to which it is connected is ready and has detected the carrier of the other modem.

                All left to worry about now is the Request to Send and Clear To Send. As both computers communicate together at the same speed, flow control is not needed thus these two lines are also linked together on each computer. When the computer wishes to send data, it asserts the Request to Send high and as it is hooked together with the Clear to Send, It immediately gets a reply that it is ok to send and does so.

                The Ring indicator line is only used to tell the computer that there is a ringing signal on the phone line. As we do not have, a modem connected to the phone line this is left disconnected

         To know about the RS232 ports available in your computer, Right click on "My Computer", Goto 'Properties', Select tab 'Device Manager', go to Ports( COM & LPT ), In that you will find 'Communication Port(Com1)' etc. If you right click on that and go to properties, you will get device status. Make sure that you have enabled the port( Use this port is selected).

 

          To check the port, If you have a single computer, you can use loop-back connection as follows. This is most commonly used method for developing communication programs. Here, data is transmitted to that port itself. Loop-back plug connection is as follows. 

Page 25: Generic Program Interface Device System for Industrial Automation

Fig 2. Loop-back plug connection

          If you run the above program with the connection as in this diagram, the character entered in the keyboard should be displayed on the screen. This method is helpful in writing serial port program with single computer. Also you can make changes in the port id if your computer has 2 rs232ports. You can connect the com1 port to com2 of the same computer and change the port id in the program. The data sent to the port com1 should come to port com2. then also whatever you type in the keyboard should appear on the screen.

          The program given below is an example source code for serial communication programmers. It is a PC to PC communication using RS232. Download the code, unzip and run to chat in dos mode between two computers. Use the program to get more idea about serial port programming.

MAX232:

Description:

The Max 232 is a dual driver/receiver that includes a capacitive voltage generator to supply TIA/EIA-232-F voltage

levels from a single 5V supply. Each receiver converts TIA/EIA-232-F to 5V TTL/CMOS levels. These receivers

have a typical threshold of 1.3V, a typical hysteresis of 0.5V and can accept ±30V inputs. Each driver converts

TTL/CMOS to TIA/EIA-232-F levels. The 89C52 has a built in serial port that makes it very easy to communicate

with the PC's serial port but the 89C52 outputs are 0 and 5 volts and we need +10 and -10 volts to meet the RS232

serial port standard. The easiest way to get these values is to use the MAX232. The MAX232 acts as a buffer driver

for the processor. It accepts the standard digital logic values of 0 and 5 volts and converts them to the RS232

standard of +10 and -10 volts. It also helps protect the processor from possible damage from static that may come

from people handling the serial port connectors. The MAX232 requires 5 external 1uF capacitors. These are used by

the internal charge pump to create +10 volts and -10 volts. It includes 2 receivers and 2 transmitters so two serial

ports can be used with a single chip.

Page 26: Generic Program Interface Device System for Industrial Automation

RS-232 TTL Logic

-15V …  -3V +2V … +5V High

+3V … +15V 0V … +0.8V  Low

Features:

? Meets or exceeds TIA/EIA-232-F and ITU recommendation V.28.

? Operates with a single 5V power supply with 1µF Charge pump capacitors.

? Operates up to 120 kbits/s.

? Two drivers and two receivers.

? ±30V input levels.

? Low supply current. Typically 8mA.

? ESD protection exceeds JESD 22 – 2000 V Human body model

? Upgrade with improved ESD (15-kV HBM) and 0.1µF Charge pump capacitors are available.

Page 27: Generic Program Interface Device System for Industrial Automation

3.2 CIRCUIT DIAGRAM :

A] Power Supply Section:

Fig 3.1.1

Fig 3.2.1 Power Supply

Page 28: Generic Program Interface Device System for Industrial Automation

B] Microcontroller Section:

+5 V

0

+5 V

0

S W 5

S W P U S H B U TTO N -D P S T

OSC

_1

C 2 30 . 1 U F

OSC

_2

M C _ A L E

MC

_RST

R 4 9

8 K 2

M C _ P S E N+5 V

0

C 2 20 . 1 U F

M C _ R S T

C 2 51 0 u F / 3 5 V

P 8 9 V 5 1 R D 2

R S T9

XTA L 21 8 XTA L 11 9

P S E N2 9A L E / P R O G3 0

E A / V P P3 1

P 1 . 01

P 1 . 12

P 1 . 23

P 1 . 34

P 1 . 45

P 1 . 56

P 1 . 67

P 1 . 78

P 2 . 0 / A 82 1

P 2 . 1 / A 92 2

P 2 . 2 / A 1 02 3

P 2 . 3 / A 1 12 4

P 2 . 4 / A 1 22 5

P 2 . 5 / A 1 32 6

P 2 . 6 / A 1 42 7

P 2 . 7 / A 1 52 8

P 3 . 0 / R XD1 0

P 3 . 1 / TXD1 1

P 3 . 2 / I N T01 2

P 3 . 3 / I N T11 3

P 3 . 4 / T01 4

P 3 . 5 / T11 5

P 3 . 6 / W R1 6

P 3 . 7 / R D1 7

P 0 . 0 / A D 03 9

P 0 . 1 / A D 13 8

P 0 . 2 / A D 23 7

P 0 . 3 / A D 33 6

P 0 . 4 / A D 43 5

P 0 . 5 / A D 53 4

P 0 . 6 / A D 63 3

P 0 . 7 / A D 73 2

V C C4 0

G N D2 0

OSC

_2

0

Fan

Y 1W XTA L / 1 1 . 0 5 9 M H Z / TH

C 2 4

2 2 P F

C 2 6

2 2 P F

BulbTube

TV

TxRx

Page 29: Generic Program Interface Device System for Industrial Automation

Microcontroller

C] Relay Section:

Page 30: Generic Program Interface Device System for Industrial Automation

U 1 0

R e la y 1

C O M5

A1

B2

N C4

N O3

D 1 21 N 4 1 4 8

Q 7B C 5 4 7 / TO 9 2

2

31

R 2 6 3 3 0 EM C _ F a n

0

+1 2 V

J 6

C O N 4

123

U 9

R e la y 1

C O M5

A1

B2

N C4

N O3

D 1 11 N 4 1 4 8

Q 6B C 5 4 7 / TO 9 2

2

31

R 2 5 3 3 0 EM C _ L ig h t

0

+1 2 V

J 5

C O N 3

123

Fig 3.2.3 Relay

3.3 CIRCUIT DIAGRAM DESCRIPTION:

The working of this project is divided in the following two modes

Page 31: Generic Program Interface Device System for Industrial Automation

1. PC control section

2. Microcontroller section

1. PC control section:

In this section we have designed a special GUI (Graphical User Interface) on PC, For

this we have used Visual C language this GUI contains various Tabs for various

instruments connected in the system, for example the Button No 1 can be used to

control the device which is connected in the system at position 1. Once any Button

is pressed by user PC will send command to Microcontroller with the help of

standard serial communication protocol

The RS 232 standard is used in order to perform serial communication with

Microcontroller standard 9600 baud rate is used in order to perform the serial

communication

2. Microcontroller section:

Microcontroller will receive various commands form PC via serial communication

IC MAX 232 will act as level converter and will make the signals compatible with

Microcontroller. Once the data received flag is raised the controller will load the

command in to his memory decode it and accordingly Turn ON / OFF the peripherals

connected to its ports

In this way by using serial ammunition protocol any device can be turned ON / OFF

by simply instructing Microcontroller to change its port pins status and for this a pre

defined codes are stored in his memory in order to decode the various device

operation commands from PC

Page 32: Generic Program Interface Device System for Industrial Automation

CHAPTER 4

SOFTWARE

1. Proteus 7 for simulation

2. Orcad 16.2 for Layout

3. Visual C

4.1 ALGORITHM:

1. START

2. Initialize Microcontroller for serial communication

3. If no button is pressed then it wait for command from user.

4. If any button press from user pc sends commands to 8051 by serial

communication.

5. 8051 receives command & according to it device get turn on or off.

6. STOP

4.2 FLOWCHART:

Page 33: Generic Program Interface Device System for Industrial Automation

CHAPTER 5

START

Initialize Microcontroller for Serial Communication mode

Any Tab pressed from PC (GUI)

Send Commands to 8051 bySerial Communication

mode

8051 receive commandsDevice turned ON / OFF

STOP

Page 34: Generic Program Interface Device System for Industrial Automation

SIMULATION

5.1 SIMULATION OF POWER SUPPLY:

Fig.5.1simulation of power supply

Page 35: Generic Program Interface Device System for Industrial Automation

SIMULATION OF MICROCONTROLLER:

Fig 5.2 Simulation of Microcontroller

Page 36: Generic Program Interface Device System for Industrial Automation

5.3 BURNING PROGRAM INTO MICROCONTROLLER:

Page 37: Generic Program Interface Device System for Industrial Automation

Fig5.3 Burning program into microcontroller

CHAPTER 6

PCB DESIGN

6.1 PCB DESIGN STEPS:

Page 38: Generic Program Interface Device System for Industrial Automation

In the PCB design of electronics circuit, it is important that one plan and has a

checklist of the do's and don'ts before proceeding to do the printed circuit board

layout. The understanding of the circuit is critical to the design, for example one

needs to understand the maximum current and voltage that are carried by each

conductor in order to determine the track width of the conductor and the type of PCB

that will be used.

The voltage difference between each track will determine the clearance between each

conductor. If the clearance is not enough, chances are that the electrical potential

between each track will cause spark over and short circuit the PCB. This will cause

functional failure to the product and the safety of the users that are using the product

will be compromised. It is therefore critical for one to understand some of these

basics requirements before one proceed to design the PCB.

Conductor Thickness and Width:

The PCB conductor thickness and width will determine the current carrying capacity

of the track. The IPC standard for the conductor thickness and width of the common

1 oz/square-feet PCB is as shown below. However, it is always advisable to use a

bigger value due to the tolerance and variation of the PCB processes. If higher

current carrying capacity is required, a 2 oz/square-feet or 3 oz/square-feet type of

PCB is preferred. Many electronics hobbyist prefer to solder a thick cooper

conductor on the PCB track to increase the current carrying capacity of the track.

LAYERS OF PCB:

*.BOT - bottom copper

*.SMB - Solder mask bottom

Page 39: Generic Program Interface Device System for Industrial Automation

*.SST - Silk screen top

*.ASY - Assembly top, contains the board outline

*.DS - drill sizes

Tracks Restricted Area

Tracks should not be located on the areas that can cause them to be peeled off easily.

One of the restricted areas is holes on the PCB which are used to mount screws or

PCB spacers. These holes are usually used to secure the PCB to a casing or to secure

it in a fixed place.

The edges of the PCB should not have any tracks as these areas are usually used to

transport the PCB from one process to another process by using a conveyor belt.

These edges are places where the possibility of scratches and cracking of the PCB

happens. The recommended areas that should not have any track is as shown in the

diagram below assuming a hole diameter of 4 mm which is used to mount a PCB

spacer.

Soldering:

How to Solder:

First a few safety precautions:

Never touch the element or tip of the soldering iron.

They are very hot (about 400°C) and will give you a nasty burn.

Take great care to avoid touching the mains flex with the tip of the iron.

The iron should have a heatproof flex for extra protection. An ordinary plastic flex

will melt immediately if touched by a hot iron and there is a serious risk of burns and

electric shock.

Page 40: Generic Program Interface Device System for Industrial Automation

Always return the soldering iron to its stand when not in use.

Never put it down on your workbench, even for a moment!

Work in a well-ventilated area.

The smoke formed as you melt solder is mostly from the flux and quite irritating.

Avoid breathing it by keeping you head to the side of, not above, your work.

Wash your hands after using solder.

Solder contains lead which is a poisonous metal.

Preparing the soldering iron:

Place the soldering iron in its stand and plug in.

The iron will take a few minutes to reach its operating temperature of about

400°C.

Dampen the sponge in the stand.

The best way to do this is to lift it out the stand and hold it under a cold tap for a mo-

ment, then squeeze to remove excess water. It should be damp, not dripping wet.

Wait a few minutes for the soldering iron to warm up.

You can check if it is ready by trying to melt a little solder on the tip.

Wipe the tip of the iron on the damp sponge.

This will clean the tip.

Melt a little solder on the tip of the iron.

This is called 'tinning' and it will help the heat to flow from the iron's tip to the joint.

It only needs to be done when you plug in the iron, and occasionally while soldering

if you need to wipe the tip clean on the sponge.

6.2 PCB DESIGN LAYOUT :

Page 41: Generic Program Interface Device System for Industrial Automation

Fig 6.2.1 Power Supply Fig.6.2.2 Microcontroller

Fig 6.2.3 Ralay

Page 42: Generic Program Interface Device System for Industrial Automation

CHAPTER 7

TESTING

Page 43: Generic Program Interface Device System for Industrial Automation

Fig 7.1 Testing of Project

CHAPTER 8

APPLICATION & FUTURE SCOPE

ADVANTAGES:

Page 44: Generic Program Interface Device System for Industrial Automation

1. This project can be effectively and conveniently utilized for the control of different

appliances.

2. As this project could be extended to control about 4 devices, this could be used for

computerization of an office, home, or a firm. Though it is quiet costlier, the circuit is

simple and the working mechanism could be easily understood.

3. An added advantage of this project is that we are able to know the status of the device to

be controlled.

4. The program to control the appliances is written in C language which is more user

friendly and easy to understand than other programming languages

5. In today’s world their is high a demand for PC based control system because of its

various advantages over manual control system.

6. PC based control systems are highly reliable , accurate and time saving systems, they

provide number of features like quick data storage , data transfer and data security which

help industries to work in efficient manner.

DISADVANTAGES:

1. It is inconvenience to carry personal computer.

2.There may be problem occurred during serial communication.

APPLICATION:-

Applications for the GPID

Page 45: Generic Program Interface Device System for Industrial Automation

Industrial Automation: Robotic Arms, Conveyors, etc. can be controlled very well through GPID

rather than entire PC based systems.

Complex Machine Control

All complex machines like CNC, Lathe, etc. can be controlled easily through a single GPID

board rather than too many manual control panels.

Displaying Various Parameters in Industrial Environments

GPID can be used to display various parameters like

temperature, pressure, tank level, etc. in an industry.

Various Keypad Controls

Various types of reconfigurable keypads can be implemented using GPID

since function of each key can be displayed dynamically over the 7- Segment

displays.

Multipurpose Relay Board Control

A relay board that can be configured with GPID is provided. This

board can be configured to work with GPID as well as software logic.

Sample Prototype

Entertainment

GPID along with software can be used for wide range of entertainment based applications like

board games. e.g. Tic-Tac-Toe, Checkers, Chess, Merlin, etc.

Page 46: Generic Program Interface Device System for Industrial Automation

Display vital information

GPID can be used as a general purpose display board to display

parameters, messages, etc.

Graphically Display Current Status of a Process

GPID can be used to display animations, graphical patterns that can be used to display current

status of process, etc. E.g. a running grinder can be animated.

Display Digital Waveforms

GPID can be used to display digital waveforms. 64-bit data can be observed at a time over the

board.

FUTURE SCOPE:-

1. We can control appliances which are at home or at office using pc via Internet system.

Page 47: Generic Program Interface Device System for Industrial Automation

CHAPTER 9

BILL OF MATERIAL

Sr. No. Description Quantity Price

1 P89V51RD2 1 180

2 Transformer 18 V, 0.5A 1 120

3 LM7812 1 12

4 LM7805 1 8

5 Diode 1N4007 4 8

6 Capacitor 1000 µf 1 7

7 Disc Capacitor 10 5

8 IC Base 40 Pin 1 18

9 Relimate Base 10 40

10 Relimate Connector 10 88

11 Pull Up Resistance 10 K 4 8

12 PCB 1 700

13 Reset Switch 5 5

14 IC Base 8 Pin 3 16

16 12 V Relay 2 20

17 Fan 12 V 1 80

TOTAL 1327

Page 48: Generic Program Interface Device System for Industrial Automation

REFERENCE BOOKS:-

The 8051 microcontroller :- Kenneth Ayala

The 8051 microcontroller and Embedded systems :- Muhammad Ali Mazidi

WEB-SITES:-

www.datasheetarchieve.com

www.alldatasheet.com/

www.nxp.com/-Philips

www.seminarproject.com