Professional Documents
Culture Documents
Embedded Industrial Security System With Auto Dialer Useing 89C51MC
Embedded Industrial Security System With Auto Dialer Useing 89C51MC
Industrial security system with auto-dialer, the aim of the project is to provide
high ended security system and control the process. In this project we are using various
sensors, control unit, display and tripping circuit.
However in this project work, the basic signal processing of various sensors
which are LDR, IR sensor and TEMPERATURE sensor are used for measuring various
parameter values, and the output of these sensors are converted to control the parameters.
The control circuit is designed using micro-controller. The output of all the sensors is fed
to micro-controller.
The aim of the project is to provide a security system that can monitor an Industry
with three different types of sensors, controlling unit and tripping circuit. The main
design principles used in designing the industrial security system with auto-dialer are
flexible and easily enhanced for future use. In industry the main problem is to protect the
machines from unauthorized access, from damages like during excessive temperature,
fire accident etc. In industries at evening times the lights may not switch on due to
manual mistakes. These problems can be overcome by using sensors.
1
BLOCK DIAGRAM
LCD DISPLAY
SENSOR
BOARD
DRIVER
CIRCUIT
ARM 89C51 MC
SWITCH
PANIC
SWITCH BUZZER
CRYSTAL
OSCILLATOR
RELAY
AUTO
RESET AUTO
CIRCUI RELAY DIALER
T DIAL
2
1.2 Block Diagram Description:
The Block Diagram consists of different sensors, a Micro controller, auto dialer and a
power supply. These things are discussed briefly as follows:
There are some of sensors like Temperature sensor, Light intensity sensor, IR sensor.
Any of these sensors are placing in the project to measure any of these parameters at different
locations in an industry. The output of these sensors is in the form of analog values. These analog
values cannot directly give to the micro controller. For this we are using ADC converter. The
micro controller will accepts the input and also gives the output in the form of digital only. That
is why, we are giving the sensor values to the ADC, which converts the analog values into the
digital values and thereby these are given to the micro controller. According to the input given to
the micro controller the controller will performs action at the output.
For example, if we use the temperature sensor some of the threshold value is kept. If the
temperature is exceeds the threshold value what we have kept in the software, according to that
condition there should be an alert in the buzzer and a cal should be done as programmed. For the
circuit operation, the maximum power it requires is a 5v DC power supply.
3
1.3 SCHEMATIC DIAGRAM:
4
1.4 Schematic Description:
Pins Connection
9TH RESET
20th GROUND
14th BUZZER
Sensors Connections
Light Intensity sensor this sensor is connected to pin P1.2 of the Microcontroller.
5
2 HARDWARE COMPONENTS
MICRO CONTROLLER
IR SENSOR
TEMPERATURE SENSOR
LDR
LCD SCREEN
BUZZER
RELAY
VOLTAGE REGULATOR
PANIC SWITCH
6
2.1 MICROCONTROLLER 89C51
2.1.1 INTRODUCTION
7
2.1.2 FEAUTRES
2.1.3 Description
8
2.1.4 ARCHITECTURE
9
2.1.5 MEMORY TYPES
FLASH Low cost, high density, high speed low power and
high reliability.
ROM
(Read only memory) Mature, high-density, reliable, low cost; time-
consuming mask required, suitable for high
production with stable code.
SRAM
(Static Random-Access Memory) Highest speed, high-power, low-density memory;
limited density drives up cost.
EPROM
(Electrically Programmable
Read-Only memory) High-density memory must be exposed to ultra-
violet light for erasure.
EEPROM
(Electrically Erasable P-ROM) Electrically byte-erasable; low reliability and
density, high cost.
DRAM
(Dynamic RAM) High-density, Speed, Power, Low-cost.
10
FIGURE 5: PIN DIAGRAM OF AT89C51
GND: Ground
Port 0:
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can
sink eight TTL inputs. Port 0 may also be configured to be the multiplexed low order
address/data bus during accesses to external program and data memory. In this mode P0
has internal pull-ups. Port 0 also receives the code bytes during Flash programming, and
11
outputs the code bytes during program verification. External pull-ups are required during
program verification.
Port 1:
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output
buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins they are
pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that
are externally being pulled low will source current (IIL) because of the internal pull-ups.
Port 1 also receives the low-order address bytes during Flash programming and program
verification.
Port 2:
Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output
buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins they are
pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that
are externally being pulled low will source current (IIL) because of the internal pull-ups.
Port 2 emits the high-order address byte during fetches from external program memory
and during accesses to external data memories that use 16-bit addresses (MOVX @
DPTR).
Port 3:
Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output
buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins they are
pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that
are externally being pulled low will source current (IIL) because of the pull-ups. Port 3
also serves the functions of various special features of the AT89C51 as listed below. Port
3 also receives some control signals for Flash programming and Programming
verification.
12
TABLE 1: PORT PINS
RST:
Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device.
ALE/PROG:
Address Latch Enable 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. In normal operation ALE is emitted at a constant rate of 1/6 the
oscillator frequency, and may be used for external timing or clocking purposes. Note,
however, that one ALE pulse is skipped during each access to external Data Memory. If
desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit
set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is
weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in
external execution mode.
13
PSEN:
Program Store Enable is the read strobe to external program memory. When the
AT89C51 is executing code from external program memory, PSEN is activated twice
each machine cycle, except that two PSEN activations are skipped during each access to
external data memory.
EA/ VPP:
The heart of the 89C51 circuitry that generates the clock pulses by which all the
internal operations are synchronized are Pins XTAL1 and XTAL2 is provided for
connecting a resonant network to form an oscillator. Typically a quartz crystal and
capacitors are employed. The crystal frequency is the basic internal clock frequency of
the microcontroller. The manufacturers make 89C51 designs that run at specific
minimum and maximum frequency typically 1 to 16 MHz
XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
XTAL2:
14
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output, respectively, of an inverting
amplifier which can be configured for use as an on-chip oscillator, as shown in Figure 1.
Either a quartz crystal or ceramic resonator may be used. To drive the device from an
external clock source, XTAL2 should be left unconnected while XTAL1 is driven as
shown in Figure 2.
15
2.2 IR SENSOR
IR sensor consists of two sensors. The first sensor presented is infrared based,
while the second one uses a red LED and a Cds photocell. The infrared based sensor
emits the infrared rays and the second sensor detects the rays which are reflected from the
obstacle. A line sensor in its simplest form is a sensor capable of detecting a contrast
between adjacent surfaces, such as difference in color, roughness, or magnetic properties,
for example. The simplest would be detecting a difference in color, for example black
and white surfaces. Using simple optoelectronics, such as infrared photo-transistors,
color contrast can easily be detected. Infrared emitter/detectors or photo-transistors are
inexpensive and are easy to interface to a microcontroller.
The theory of operation is simple and for brevity, only the basics will be
considered. When light shines on a white surface, most of the incoming light is reflected
away from the surface. In contrast, most of the incoming light is absorbed if the surface
is black. Therefore, by shining light on a surface and having a sensor to detect the
amount of light that is reflected, a contrast between black and white surfaces can be
detected. Below figure 1 shows an illustration of the basics just covered.
16
Using what we know about light and black and white surfaces, the objective of
tracking a line is simple can be achieved using the appropriate sensors. In this article, we
will consider the use of three pairs of emitter and detector as shown in figure below. The
drive configuration for the robot is assumed to be differential, i.e., like the tracks of an
army tank vehicle. From the figure, the three pairs of sensors are used to keep the robot
on the line as it moves. Each sensor output is monitored to determine the location of the
tape relative to the robot. The main objective of the robot is to position itself such that
the tape line falls between the two extreme sensors. If the tape line ever ventures past
these two extreme sensors, then the robot corrects by turning in the appropriate direction
to maintain tracking. Two different types of light sensors set up in the configuration
shown below will be used for line tracking.
The infrared emitter and detector sensors are shown below in Figure.
17
2.2.1 FEATURES:
High reliability
Light weight
Low cost
Long detection range
Small size
Wide spectral response
Low forward voltage
2.2.2 APPLICATIONS
18
2.3 TRMPERATURE SENSOR
In this project we are using LM35 series type of temperature sensor which is an
NTC type. These are precision integrated-circuit temperature sensors, whose output
voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus
has an advantage over linear temperature sensors calibrated in ° Kelvin. Low cost is
assured by trimming and calibration at the wafer level. The LM35‟s low output
impedance, linear output, and precise inherent calibration make interfacing to readout or
19
control circuitry especially easy. It can be used with single power supplies, or with plus
and minus supplies. The LM35 is rated to operate over a −55° to +150°C temperature
range, while the LM35C is rated for a −40° to +110°C range. The LM35 series is
available packaged in hermetic TO-46 transistor packages, while the LM35C, LM35CA,
and LM35D are also available in the plastic TO-92 transistor package. The LM35D is
also available in an 8-lead surface mount small outline package and a plastic TO-220
package.
20
START UP RESPONSE THERMAL RESISTANCE TO AIR
21
Specifications Values
Output Current 10 mA
Storage Temp.;
Lead Temp.:
(TMIN to T MAX)
22
2.3.3 FEAUTRES:
2.3.4 APPLICATIONS:
23
2.4 LIBHT DEPENDENT RESISTOR(LDR)
LDRs or Light Dependent Resistors are very useful especially in light/dark sensor
circuits. Normally the resistance of an LDR is very high, sometimes as high as 1000 000
ohms, but when they are illuminated with light resistance drops dramatically.LDR is
shown in the figure
Electronic opts sensors are the devices that alter their electrical characteristics, in
the presence of visible or invisible light. The best known devices of these types are the
light dependent resistor (LDR), the photo diode and the phototransistors.
Light dependent resistor as the name suggests depends on light for the variation
of resistance.
24
When light falls on the strip, the resistance decreases. In the absence of light the
resistance can be in the order of 10 K ohm to 15 K ohm and is called the dark
resistance.
Depending on the exposure of light the resistance can fall down to value of
500ohms.The power ratings are usually smaller and are in the range 50mw to 0.5w.
Though very sensitive to light, the switching time is very high and hence can not be
used for high frequency applications. They are used in chopper amplifiers. Light
dependent resistors are available as discs 0.5cm to 2.5cm. The resistance rises to
several mega ohms under dark conditions.
The Figure 6.2(b) shows that when the torch is turned on, the resistance of the LDR
falls, allowing current to pass through it is shown in figure
25
Figure 13: LDR Basic Structure and Symbol
The basic construction and symbol for LDR are shown in fig (a) and (b)
respectively. The device consists of a pair of metal film contacts separated by a snake-
like track of cadmium sulphide film, designed to provide the maximum possible contact
area with the two metal films. The structure is housed in a clear plastic or resin case, to
provide free access to external light. Practical LDrs are available in a variety of sizes and
packages styles, the most popular size having a face diameter of roughly 10mm.practical
LDR is shown in figure (c).
Figure c
26
2.4.1 EXAMPLE OF A LIGHT SENSOR CIRCUIT:
When the light level is low the resistance of the LDR is high. This prevents
current from flowing to the base of the transistors. Consequently the LED does not light.
However, when light shines onto the LDR its resistance falls and current flows into the
base of the first transistor and then the second transistor. The LED lights.
The preset resistor can be turned up or down to increase or decrease resistance, in this
way it can make the circuit more or less sensitive shown in fig.
2.4.2 FEATURES:
High reliability
Light weight
Low cost
Wide spectral response
Wide ambient temperature range
27
2.4.3 APPLICATIONS:
Smoke detection
Automatic lighting control
Burglar alarm systems
Camera (electronic shutter)
Strobe (color temperature reading)
28
2.5 LIQUID CRYSTAL DISPLAY(LCD)
The LCD or Liquid character display is a circuit which is used for displaying
characters at output side. In this project we are using a 16*2 Liquid crystal character
display which is shown in figure below. The 16*2 refers to the 16 characters with 2 lines
on the display. The figure is shown below which consists of 16 pins each having its own
function
29
2.5.1 PIN DESCRIPTION:
30
2.6 BUZZER
31
2.6.1 OSCILLATING SYSTEM:
32
2.7 RELAYS
A relay is an electrical switch that opens and closes under the control of
another electrical circuit. In the original form, the switch is operated by an electromagnet
to open or close one or many sets of contacts.
The first relay was invented by Joseph Henry in 1835. The name relay derives
from the French noun „relais‟ that indicates the horse exchange place of the postman.
Generally a relay is an electrical hardware device having an input and output gate. The
output gate consists in one or more electrical contacts that switch when the input gate is
electrically excited. It can implement a decouple, a router or breaker for the electrical
power, a negation, and, on the base of the wiring, complicated logical functions
containing and, or, and flip-flop. In the past relays had a wide use, for instance the
telephone switching or the railway routing and crossing systems. In spite of electronic
progresses (as programmable devices), relays are still used in applications where
ruggedness, simplicity, long life and high reliability are important factors (for instance in
safety applications).
33
2.7.1 OPERATION:
When a current flows through the coil, the resulting magnetic field attracts an
armature that is mechanically linked to a moving contact. The movement either makes or
breaks a connection with a fixed contact. When the current to the coil is switched off, the
armature is returned by a force approximately half as strong as the magnetic force to its
relaxed position. Usually this is a spring, but gravity is also used commonly in industrial
motor starters. Most relays are manufactured to operate quickly. In a low voltage
application, this is to reduce noise. In a high voltage or high current application, this is to
reduce arcing.
(e). When the feeding current of the coil is removed, the armature and the
feed contact return to their relaxed position by means of a spring. Since relays are
switches, the terminology applied to switches is also applied to relays. A relay will switch
one or more poles, each of whose contacts can be thrown by energizing the coil in one of
three ways:
34
Normally-open (NO) contacts connect the circuit when the relay is activated; the
circuit is disconnected when the relay is inactive. It is also called a Form A
contact or "make" contact.
Normally-closed (NC) contacts disconnect the circuit when the relay is
activated; the circuit is connected when the relay is inactive. It is also called a
Form B contact or "break" contact.
Change-over (CO) or double-throw (DT) contacts control two circuits: one
normally-open contact and one normally-closed contact with a common
terminal. It is also called a Form C contact or "transfer" contact ("break before
make"). If this type of contact utilizes “make before break” functionality, then it
is called a Form D contact.
35
2.8 REGULATOR POWER SUPPLY
2.8.2 TRANSFORMER:
36
Transformers convert AC electricity from one voltage to another with little loss of
power. Transformers work only with AC and this is one of the reasons why mains
electricity is AC. Step-up transformers increase in output voltage, step-down transformers
decrease in output voltage. Most power supplies use a step-down transformer to reduce
the dangerously high mains voltage to a safer low voltage. The input coil is called the
primary and the output coil is called the secondary. There is no electrical connection
between the two coils; instead they are linked by an alternating magnetic field created in
the soft-iron core of the transformer. The two lines in the middle of the circuit symbol
represent the core. Transformers waste very little power so the power out is (almost)
equal to the power in. Note that as voltage is stepped down current is stepped up. The
ratio of the number of turns on each coil, called the turn‟s ratio, determines the ratio of
the voltages. A step-down transformer has a large number of turns on its primary (input)
coil which is connected to the high voltage mains supply, and a small number of turns on
its secondary (output) coil to give a low output voltage.
VS X IS=VP X IP
Vp= primary (input) voltage
Np= number of turns on primary coil
Ip= primary (input) current
37
2.8.3 RECTIFIER:
TYPES OF RECTIFIERS:
From the above comparisons we came to know that full wave bridge rectifier as
more advantages than the other two rectifiers. So, in our project we are using full wave
bridge rectifier circuit.
38
FIGURE 21: BRIDGE RECTIFIER
2.8.4 FILTER:
A Filter is a device, which removes the A.C component of rectifier output but
allows the D.C component to reach the load
39
2.8.6 FEATURES:
40
2.9 SWITCHES AND PUSHBUTTONS:
There is nothing simpler than this! This is the simplest way of controlling
appearance of some voltage on microcontroller‟s input pin. There is also no need for
additional explanation of how these components operate.
41
The simplest solution is to connect simple RC circuit which will “suppress” each
quick voltage change. Since the bouncing time is not defined, the values of elements are
not strictly determined. In the most cases, the values shown on figure are sufficient. If
complete safety is needed, radical measures should be taken. The circuit shown on the
figure (RS flip-flop) changes logic state on its output with the first pulse triggered by
contact bounce. Even though this is more expensive solution (SPDT switch), the problem
is definitely resolved! Besides, since the condensate is not used, very short pulses can be
also registered in this way. In addition to these hardware solutions, a simple software
solution is commonly applied too: when a program tests the state of some input pin and
finds changes, the check should be done one more time after certain time delay. If the
change is confirmed it means that switch (or pushbutton) has changed its position. The
advantages of such solution are obvious: it is free of charge, effects of disturbances are
eliminated too and it can be adjusted to the worst-quality contacts.
42
2.10 AUTO-DIALER CIRCUIT
2.9.1 Introduction:
The very simplest working telephone would look like this inside.
As you can see, it only contains three parts and they are all simple:
A switch - to connect and disconnect the phone from the network - This switch is
generally called the hook switch. It connects when you lift the handset.
A speaker - This is generally a little 50-cent, 8-ohm speaker of some sort.
A microphone - In the past, telephone microphones have been as simple as
carbon granules compressed between two thin metal plates. Sound waves from
your voice compress and decompress the granules, changing the resistance of the
granules and modulating the current flowing through the microphone.
43
Most people find that annoying, so any "real" phone contains a device
called a duplex coil or something functionally equivalent to block the sound of
your own voice from reaching your ear. A modern telephone also includes a bell
so it can ring and a touch-tone keypad and frequency generator. A "real" phone
looks like this.
44
2.9.2 REDIAL:
The telephone stores in memory the last number you called. The number will
remain in the Redial memory until you dial another number.
To dial the same number again
45
3 SOFTWARE DESCRIPTION
46
5. Save the Project by typing suitable project name with no extension in your
own folder sited in either C:\ or D:\
47
9. Select AT89C51 as shown below
48
12. Then Click either YES or NO………mostly “NO”
13. Now your project is ready to USE
14. Now double click on the Target1, you would get another option “Source
group 1” as shown in next page.
15. Click on the file option from menu bar and select “new”
49
16. The next screen will be as shown in next page, and just maximize it by double
clicking on its blue boarder.
50
19. Now right click on Source group 1 and click on “Add files to Group Source”
20. Now you will get another window, on which by default “C” files will appear .
21. Now select as per your file extension given while saving the file
51
22. Click only one time on option “ADD”
23. Now Press function key F7 to compile. Any error will appear if so happen.
52
27. Now Click on the Peripherals from menu bar, and check your required port as
shown in fig below
28. Drag the port a side and click in the program file.
29. Now keep Pressing function key “F11” slowly and observe.
30. You are running your program successfully.
53
APPENDIX 1
SOURCE CODE
;*************************************************************
;*************************************************************
; SECURITY SYSTEM
; p2 LCD DISPLAY
ORG 00H
MOV P1,#3CH
54
SETB P3.6 ;ENTRY DELAY LCD OFF
; MOV P0,#0FFH
SENSOR1: JB P1.0,EXIT
JB P1.0,LCD ON
JNB P1.1,LCD ON
JNB P1.2,LCD ON
SJMP SENSOR1
55
EXIT: MOV R4,#50
CLR P0.0
ACALL DELAY
ACALL DELAY
DJNZ R4,BLINK1
; MOV P0,#0FEH
SETB P0.0
SENSOR2:JB P1.0,ENTRY
JB P1.0,LCD ON
JNB P1.1,LCD ON
JNB P1.2,LCD ON
SJMP SENSOR2
ACALL SIREN
ACALL SIREN
56
ACALL SIREN
CLR P0.0
ACALL DELAY
ACALL DELAY
DJNZ R5,BLINK2
SETB P0.0
JB P3.5,REPEATE
ACALL DELAY
ACALL DELAY
ACALL DELAY
ACALL DELAY
ACALL DELAY
ACALL DELAY
ACALL DELAY
ACALL DELAY
ACALL DELAY
ACALL DELAY
ACALL DELAY
; MOV P1,#0FFH
RET
END
58
CONCLUSION
Secondly, using highly advanced IC’s and with the help of growing technology the
project has been successfully implemented.
59
FUTURE ENHANCEMENT
In this project, we are monitoring an industry by providing security with the help
of the sensors and whenever there is an attempt to break the security in the industry then
buzzer will be alarmed and there will be a call made to the concerned number
programmed in the software In order to extend this project in the future, we can add some
more different sensors and simultaneously a cal is processed to security officials to
intimate them. We can also provide a secret cam so that it can be recorded.
60
BIBLIOGRAPHY
-Kenneth J. Ayala
Electronic Components
-D.V. Prasad
www.national.com
www.atmel.com
www.microsoftsearch.com
www.geocities.com
61