Professional Documents
Culture Documents
Chapter No.
TITLE
Page no.
List of Abbreviations
List of Figures
ii
List of Tables
1
INTRODUCTION
Introduction
1.2
Problem Definition
1.3
Market Survey
BLOCK DIAGRAM
Block Diagram
2.2
HARDWARE DESIGN
3.1
Circuit Diagram
3.2
Circuit Description
3.3
Selection of components
SOFTWARE
4.1
Algorithm
4.2
Flow Chart
10
4.3
Code
11
SIMULATION
PCB DESIGN
2.1
3
1.1
iii
12
14
6.1
15
6.2
PCB Layout
16
TESTING
APPLICATION & FUTURE SCOPE
17
18
BILL OF MATERIAL
19
BIBILOGRAPHY
20
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.
CHAPTER 2
BLOCK DIAGRAM:
Micro
Controller
89V51
Computer
RS 232
DC
MOTOR
Stepper
Motor
CFL
TUBE
MAX 232
FAN
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
status. It is responsible for making. It is responsible for prioritizing all the devices
attached 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
programmable 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.
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
convert 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
1 KB RAM
32 I/O lines
ARCHITECTURE OF 89V51:
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
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
arithmetic operations like addition, subtraction, multiplication,
division
perform
and
logical
(F0 ) , register
instruction.
The oscillator circuit that generates the clock pulses so that all the internal operations
are
quartz crystal
is
used.
The
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.
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 52) 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.
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
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.
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.
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 deenergized 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.
DE - ENERGIZED (OFF)
ENERGIZED (ON)
The Serial Port is harder to interface than the Parallel Port. In most cases, any device you connect to the serial po
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 thou
port is harder to program than the parallel port, this is the most effective method in which the data transmission
less wires that yields to the less cost. The RS232 is the communication line which enables the data transmission
using three wire links. The three links provides transmit, receive and common ground...
4. Serial Communication reduces the pin count of these MPU's. Only two pins are commonly used, Transmit D
(TXD) and Receive Data (RXD) compared with at least 8 pins if you use a 8 bit Parallel method (You may a
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 d
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) RS2
standard. It states many parameters such as 1.
2.
3.
4.
Below is a table of pin connections for the 9 pin and 25 pin D-Type connectors.
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
Pin 7
Pin 5
SG
Signal Ground
Pin 8
Pin 1
CD
Carrier Detect
Pin 20
Pin 4
DTR
Pin 22
Pin 9
RI
Ring Indicator
Table 1 : D Type 9 Pin and D Type 25 Pin Connectors
Name
Address
IRQ
COM 1
3F8
COM 2
2F8
COM 3
3E8
COM 4
2E8
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.
though serial port is harder to program than the parallel port, this is the most effective method in which th
transmission requires less wires that yields to the less cost. The RS232 is the communication line which e
the data transmission by only using three wire links. The three links provides transmit, receive and com
ground...
The transmit and receive line on this connecter send and receive data between the computers. As
indicates, the data is transmitted serially. The two pins are TXD & RXD. There are other lines on this port
CTS, DSR, DTR, and RTS, RI. The 1 and 0 are the data which defines a voltage level of 3V to 25V an
-25V respectively.
The electrical characteristics of the serial port as per the EIA (Electronics Industry Association) RS232C
specifies a maximum baud rate of 20,000bps, which is slow compared to todays standard speed. For this re
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 connecto
are male connectors on the back of the PC. You need a female connector on your communication from Host
Guest computer. The pin outs of both D-9 & D-25 are show below.
D-Type-9 pin D-Type-25 pin
no.
no.
Pin outs
Function
RD
TD
RTS
CTS
DSR
SG
Signal ground
DCD
20
DTR
22
RI
Devices, which use serial cables for their communication, are split into two categories. These are DCE
Communications Equipment) and DTE (Data Terminal Equipment.) Data Communications Equipments are
such as your modem, TA adapter, plotter etc while Data Terminal Equipment is your Computer or Terminal.
typical Data Terminal Device is a computer and a typical Data Communications Device is a Modem. Often
will talk about DTE to DCE or DCE to DCE speeds. DTE to DCE is the speed between your modem and co
sometimes referred to as your terminal speed. This should run at faster speeds than the DCE to DCE speed.
DCE is the link between modems, sometimes called the line speed.
Most people today will have 28.8K or 33.6K modems. Therefore, we should expect the DCE to DCE
to be either 28.8K or 33.6K. Considering the high speed of the modem we should expect the DTE to DCE s
be about 115,200 BPS. (Maximum Speed of the 16550a UART) . The communications program, which we
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
actually transferring 115.2 KBPS between computers and thus have a DCE- DTE speed of 115.2 KBPS. Thu
why the DCE- DTE should be much higher than the modem's connection speed. Therefore, if our DTE to D
speed is several times faster than our DCE to DCE speed the PC can send data to your modem at 115,200 B
active. At this point, the computer thinks the Virtual Modem to which it is connected is ready and has detect
carrier of the other modem.
All left to worry about now is the Request to Send and Clear To Send. As both computers commu
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 to
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
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 'Pro
Select tab 'Device Manager', go to Ports( COM & LPT ), In that you will find 'Communication Port(Com1)'
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 i
commonly used method for developing communication programs. Here, data is transmitted to that port itsel
back plug connection is as follows.
If you run the above program with the connection as in this diagram, the character entered in the keyb
should be displayed on the screen. This method is helpful in writing serial port program with single comput
you can make changes in the port id if your computer has 2 rs232ports. You can connect the com1 port to co
the same computer and change the port id in the program. The data sent to the port com1 should come to po
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 P
communication using RS232. Download the code, unzip and run to chat in dos mode between two compute
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
levels from a single 5V supply. Each receiver converts TIA/EIA-232-F to 5V TTL/CMOS levels. These rece
have a typical threshold of 1.3V, a typical hysteresis of 0.5V and can accept 30V inputs. Each driver conve
TTL/CMOS to TIA/EIA-232-F levels. The 89C52 has a built in serial port that makes it very easy to commu
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
serial port standard. The easiest way to get these values is to use the MAX232. The MAX232 acts as a buffe
for the processor. It accepts the standard digital logic values of 0 and 5 volts and converts them to the RS23
standard of +10 and -10 volts. It also helps protect the processor from possible damage from static that may
from people handling the serial port connectors. The MAX232 requires 5 external 1uF capacitors. These are
the internal charge pump to create +10 volts and -10 volts. It includes 2 receivers and 2 transmitters so two
ports can be used with a single chip.
RS-232
TTL
Logic
Features:
? Meets or exceeds TIA/EIA-232-F and ITU recommendation V.28.
? Operates with a single 5V power supply with 1F Charge pump capacitors.
? Operates up to 120 kbits/s.
? Two drivers and two receivers.
? 30V input levels.
? Low supply current. Typically 8mA.
Fig 3.1.1
B] Microcontroller Section:
Fan
Bulb
Tube
TV
39
38
37
36
35
34
33
32
1
2
3
4
5
6
7
8
19
18
0 .0 /A
0 .1 /A
0 .2 /A
0 .3 /A
0 .4 /A
0 .5 /A
0 .6 /A
0 .7 /A
P
P
P
P
P
P
P
P
1 .0
1 .1
1 .2
1 .3
1 .4
1 .5
1 .6
1 .7
P 3 .0 /R X D
P 3 .1 /T XD
P 3 .2 /IN T 0
P 3 .3 /IN T 1
P 3 .4 /T 0
P 3 .5 /T 1
P 3 .6 /W R
P 3 .7 /R D
XTA L1
XTA L2
A L E /P R O G
PSEN
0
1
2
3
4
5
6
7
P 2 .0 /A 8
P 2 .1 /A 9
P 2 .2 /A 1 0
P 2 .3 /A 1 1
P 2 .4 /A 1 2
P 2 .5 /A 1 3
P 2 .6 /A 1 4
P 2 .7 /A 1 5
VCC
GND
21
22
23
24
25
26
27
28
10
11
12
13
14
15
16
17
Tx
Rx
30
29
M C _ALE
M C _PSEN
M C _R ST
+5V
40
20
0 .1 U F
P89V51R D 2
C 22
+5V
0
+5V
SW 5
C 23
0 .1 U F
Y 1
W X T A L /1 1 .0 5 9 M H Z /T H
D
D
D
D
D
D
D
D
E A /V P P
RST
O SC _2
22 PF
O SC _1
C 26
O SC _2
31
9
P
P
P
P
P
P
P
P
C 24
S W P U S H B U T T O N -D P S T
C 25
1 0 u F /3 5 V
R 49
8K2
22 PF
Microcontroller
MC _R S
C] Relay Section:
+12 V
R 25 330E
Q 6
B C 547 / TO 92
U 9
N C
C O M
N O
M C _ L ig h t
J5
1
D 11
1N 4148
1
2
3
3
C O N 3
B
R e la y 1
+12 V
R 26 330E
Q 7
B C 547 / TO 92
U 10
5
M C _F an
J6
1
D 12
1N 4148
N C
C O M
N O
A
B
R e la y 1
1
2
3
3
C O N 4
defined codes are stored in his memory in order to decode the various device
operation commands from PC
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:
START
Initialize Microcontroller
for Serial Communication
mode
Any Tab
pressed
from PC
(GUI)
STOP
CHAPTER 5
SIMULATION
SIMULATION OF MICROCONTROLLER:
CHAPTER 6
PCB DESIGN
6.1 PCB DESIGN STEPS:
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
Soldering:
How to Solder:
First a few safety precautions:
Never touch the element or tip of the soldering iron.
They are very hot (about 400C) 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.
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
400C.
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
moment, 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.
Fig.6.2.2 Microcontroller
CHAPTER 7
TESTING
CHAPTER 8
APPLICATION & FUTURE SCOPE
ADVANTAGES:
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 todays 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.
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.
GPID
Segment
displays.
This
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.
display
FUTURE SCOPE:1. We can control appliances which are at home or at office using pc via Internet system.
CHAPTER 9
BILL OF MATERIAL
Sr. No.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
16
17
Description
P89V51RD2
Transformer 18 V, 0.5A
LM7812
LM7805
Diode 1N4007
Capacitor 1000 f
Disc Capacitor
IC Base 40 Pin
Relimate Base
Relimate Connector
Pull Up Resistance 10 K
PCB
Reset Switch
IC Base 8 Pin
12 V Relay
Fan 12 V
Quantity
Price
1
1
1
1
4
1
10
1
10
10
4
1
5
3
2
1
TOTAL
REFERENCE BOOKS:
180
120
12
8
8
7
5
18
40
88
8
700
5
16
20
80
1327
WEB-SITES:
www.datasheetarchieve.com
www.alldatasheet.com/
www.nxp.com/-Philips
www.seminarproject.com