Beruflich Dokumente
Kultur Dokumente
DIALER
CONTENTS
CHAPTER NO TITLE
1 LIST OF FIGURES
2 ABSTRACT
3 INTRODUCTION
4 BLOCK DIAGRAM
5.4 IR DESCRIPTION
5.8 KEYPAD
7 CIRCUIT DESCRIPTION
8 IR CIRCUIT
1
9 RELAY CIRCUIT
10 RS232 CIRCUIT
11 MICROCONTROLLER CIRCUIT
12 POWER SUPPLY
13 PCB DESIGN
14 SOFTWARE TOOLS
15 PROGRAM
16 CONCLUSION
17 BIBLIOGRAPHY
2
2. ABSTRACT
Objective:
The objective of this project is to improve the security performance in the
house.
Scope:
This project is used to in the house. It provides the total security to the
house.
Flame sensor is the one type of transducer which is used to sense the flame.
Gas sensor also one type transducer which is used to sense the gas leakage in
the house. Infrared transmitter and receiver are fixed in the entrance door.
Initially the infrared transmitter transmits the rays to the receiver.
Similarly the door breaking sensor is fixed in the entrance door. If any one person
breaks the door, the sensor will detect the vibration and send the signal to
microcontroller through signal conditioning unit.
Here the microcontroller may be Atmel or PIC both are flash type
reprogrammable microcontroller in which we have already programmed with
desired phone number.
The mobile phone is interfaced with microcontroller through data cable and RS
232. The RS 232 converts TTL logic to RS 232 logic. If any one transducer is
activated due to that corresponding reason microcontroller send the related
information to the mobile phone. The mobile phone sends this information as
SMS to desired phone as per the phone number stored in the microcontroller. So
this project provides total security to the house.
3
3. INTRODUCTION
This project is very useful to improve the security performance in the house.
Methodology
This project is designed by following blocks
Micro controller
Gas sensor
Flame sensor
IR transmitter
IR receiver
Door breaking sensor
LCD display
Data cable with Mobile
Rs-232
If any gas leakage in the house it will sense that leakage and send the signal to
microcontroller to signal and conditioning unit. If any fire happens in the house
the flame sensor will detect that one and send the signal to microcontroller
through signal conditioning unit.
Initially the infrared transmitter transmits the rays to the receiver. If any one
crosses the rays it sends the signal to microcontroller through the signal
conditioning unit. Similarly the door breaking sensor is fixed in the entrance door.
If any one person breaks the door, the sensor will detect the vibration and send
the signal to microcontroller through signal conditioning unit.
The mobile phone is interfaced with microcontroller through data cable and RS
232. Data cable is the special type of cable available with mobile phone. If any
4
one transducer is activated due to that corresponding reason microcontroller
send the related information to the mobile phone.
4. BLOCK DIAGRAM
5
In automatic fire detection it is desirable to know exactly how fire sensors
In their housing work. A fire sensor in its housing is the link between physical
quantities in the sensor housing environment and the usually electrical signals
generated by the sensor.
A combination fire detection and fire suppression system may include a fire
detection system configured to detect an undesirably high temperature
associated with an area. The fire detection system may include a temperature
sensor including a temperature sensor array and a fire alerting system
associated with the temperature sensor.
The fire alerting system may be configured to receive information from the
temperature sensor and generate a warning signal based on an undesirably high
temperature associated with the area. The fire detection system may include a
fire control panel configured to receive the warning signal.
Gas sensors interact with a gas to initiate the measurement of its concentration.
The gas sensor then provides output to a gas instrument to display the
measurements. Common gases measured by gas sensors include ammonia,
aerosols, arsine, bromine, carbon dioxide, carbon monoxide, chlorine, chlorine
dioxide, Diborane, dust, fluorine, germane, halocarbons or refrigerants,
hydrocarbons, hydrogen, hydrogen chloride, hydrogen cyanide, hydrogen
fluoride, hydrogen selenide, hydrogen sulfide, mercury vapor, nitrogen dioxide,
nitrogen oxides, nitric oxide, organic solvents, oxygen, ozone, phosphine, silane,
sulfur dioxide, and water vapor.
6
include the response time, the distance, and the flow rate. The response time is
the amount of time required from the initial contact with the gas to the sensors
processing of the signal. Distance is the maximum distance from the leak or gas
source that the sensor can detect gases. The flow rate is the necessary flow rate
of air or gas across the gas sensor to produce a signal.
5.3 RS232-SETUP
Interfacing the hard ware with the PC has the following advantages:
Storing and retrieval of data becomes easier.
Networking can be done and hence the entire system
can be monitored online.
Access can be user friendly.
Interfacing the hard ware with the PC is done using MAX232 (rs232)
These parts are especially useful in battery-powered systems, since their low-
power shutdown mode reduces power dissipation to less than 5μW. The
MAX225, MAX233, MAX235, and MAX245/MAX246/MAX247 use no external
components and are recommended for applications where printed circuit board
space is critical.
Features:
7
Low-Power Receive Mode in Shutdown (MAX223/MAX242)
Meet All EIA/TIA-232E and V.28 Specifications
Multiple Drivers and Receivers
3-State Driver and Receiver Outputs
Open-Line Detection (MAX243)
Infrared transmitter is one type of LED which emits infrared rays generally called
as IR Transmitter. Similarly IR Receiver is used to receive the IR rays transmitted
by the IR transmitter. One important point is both IR transmitter and receiver
should be placed straight line to each other.
The transmitted signal is given to IR transmitter whenever the signal is high, the
IR transmitter LED is conducting it passes the IR rays to the receiver. The IR
receiver is connected with comparator. The comparator is constructed with LM
741 operational amplifier. In the comparator circuit the reference voltage is given
to inverting input terminal. The non inverting input terminal is connected IR
receiver.
Abbreviation of liquid crystal display, a type of display used in digital watches and
many portable computers. LCD displays utilize two sheets of polarizing material
with a liquid crystal solution between them. an electric current passed through
the liquid causes the crystals to align so that light cannot pass through them..
8
By controlling the voltage applied across the liquid crystal layer in each
pixel, light can be allowed to pass through in varying amounts thus constituting
different levels of gray.
The optical effect of a twisted pneumatic device in the voltage-on state is far less
dependent on variations in the device thickness than that in the voltage-off state.
Because of this, these devices are usually operated between crossed polarizer’s
such that they appear bright with no voltage (the eye is much more sensitive to
variations in the dark state than the bright state).
These devices can also be operated between parallel polarizer’s, in which case
the bright and dark states are reversed. The voltage-off dark state in this
configuration appears blotchy, however, because of small thickness variations
across the device.
Both the liquid crystal material and the alignment layer material contain ionic
compounds. If an electric field of one particular polarity is applied for a long
period of time, this ionic material is attracted to the surfaces and degrades the
device performance. This is avoided either by applying an alternating current or
by reversing the polarity of the electric field as the device is addressed (the
response of the liquid crystal layer is identical, regardless of the polarity of the
applied field).
9
The groups are designed so each pixel has a unique, unshared combination of
source and sink. The electronics or the software driving the electronics then turns
on sinks in sequence, and drives sources for the pixels of each sink.
More recently the technology has moved to detecting the acoustic sounds of
breaking glass. This provides the advantage of one detector being able to cover
a number of panes of glass. The simpler designs of acoustic detectors sense the
high frequency tinkle of shattered glass. These simple designs tend to cause
false alarms by confusing the breaking of glass such as tableware, or the sound
of bells, with the sound of breaking windows.
This page describes how to wire and cable telephone sockets in the UK only. As
with all electrical work, if you are not trained or experienced in such matters, then
the advice is to seek the expertise of a professional.
10
Sockets can only be installed on the new plug and socket system. If your phones
are connected to a connector as shown in the picture below then you must
contact your exchange service provider to have a Master socket installed. You
may wire off the Master Socket.
Before you start plan the cable route. The sockets wire from the Master and then
follow from socket to socket. If you cable to the 1st floor then consider going
external - usually via the front window - up the wall - and in the bedroom window.
This is because running the cable up the stairs is normally a pain and involves
cabling over numerous doors.
Do not go under carpets and do not run cables behind doors. The top of the
skirting board is a good place to start.
Remember - telephones normally have 3 metre cords. If the sockets are fitted
after the house is built, then surface mounted are the best option. These should
be fixed to the wall or skirting board with the appropriate fixings. Always wear eye
shields when drilling.
5.7 MICROCONTROLLER
CONCEPTS OF MICROCONTROLLER:
11
Microcontrollers will combine other devices such as:
Microcontrollers are:
Smaller in size
Consumes less power
Inexpensive
Micro controller is a stand alone unit, which can perform functions on its
own without any requirement for additional hardware like I/O ports and external
memory.
The heart of the microcontroller is the CPU core. In the past, this has traditionally
been based on a 8-bit microprocessor unit. For example Motorola uses a basic
6800 microprocessor core in their 6805/6808 microcontroller devices.
In the recent years, microcontrollers have been developed around
specifically designed CPU cores, for example the microchip PIC range of
microcontrollers.
12
each has 8 bit bin .Port 0 contain 8 data line(D0-D7) as well as low order address
line(AO-A7).
Port 2 contain higher order address line (A8-A15). Port 3 contains special
purpose register such as serial input receiver register SBUF, interrupt INT0,INT1
and timers T0 , T1 many of the pins have multi functions which can be used as
general purpose I/O pins (or) Special purpose function can be decided by the
programmer itself.
13
versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a
powerful microcomputer which provides a highly flexible and cost effective
solution to many embedded control applications
5.8 KEYPAD
KEYPAD
very far right. The numeric keypad features digits 0 to 9, addition (+),
point (.) and Num Lock and Enter keys. Laptop keyboards often do
standard keyboard.
or larger) may have space for a real numpad, and many companies
connection.
14
Numeric keypads usually operate in two modes: when Num
Lock is off, keys 8, 6, 2, 4 act like an arrow keys and 7, 9, 3, 1 act like
Home, PgUp, PgDn and End; when Num Lock is on, digits keys
numeric keys at the top of the keyboard in that, when combined with
the Alt key on a PC, they are used to enter characters which may not
Lock key, the numeric keypad always produces only numbers. The
Lock is off, keys 8, 6, 2, 4 act like an arrow keys and 7, 9, 3, 1 act like
Home, PgUp, PgDn and End; when Num Lock is on, digits keys
15
numeric keys at the top of the keyboard in that, when combined with
the Alt key on a PC, they are used to enter characters which may not
16
7. CIRCUIT DIAGRAM DESCRIPTION
Infrared transmitter is one type of LED which emits infrared rays generally called
as IR Transmitter. Similarly IR Receiver is used to receive the IR rays transmitted
by the IR transmitter. One important point is both IR transmitter and receiver
should be placed straight line to each other.
17
The transmitted signal is given to IR transmitter whenever the signal is high, the
IR transmitter LED is conducting it passes the IR rays to the receiver. The IR
receiver is connected with comparator. The comparator is constructed with LM
741 operational amplifier. In the comparator circuit the reference voltage is given
to inverting input terminal.
Relay circuit is designed to control the load. The load may be motor or any other
load. The load is turned ON and OFF through relay. The relay ON and OFF is
controlled by the pair of switching transistors (BC 547). The relay is connected in
the Q2 transistor collector terminal. A Relay is nothing but electromagnetic
switching device which consists of three pins. They are Common, Normally close
(NC) and normally open (NO).
The relay common pin is connected to supply voltage. The normally open (NO)
pin connected to load. In this circuit the MAX 232 IC used as level logic
converter. The MAX232 is a dual driver/receiver that includes a capacive voltage
generator to supply EIA 232 voltage levels from a single 5v supply. Each receiver
converts EIA-232 to 5v TTL/CMOS levels. Each driver converts TLL/CMOS input
levels into EIA-232 levels.
In this circuit the microcontroller transmitter pin is connected in the MAX232 T2IN
pin which converts input 5v TTL/CMOS level to RS232 level. Then T2OUT pin is
connected to reviver pin of 9 pin D type serial connector which is directly
connected to PC.
In PC the transmitting data is given to R2IN of MAX232 through
transmitting pin of 9 pin D type connector which converts the RS232 level to 5v
TTL/CMOS level. The R2OUT pin is connected to receiver pin of the
microcontroller. Likewise the data is transmitted and received between the
microcontroller and PC or other device vice versa.
18
Here we use five types of switches to keep the maximum and minimum values
these are given to pin 1-5 of port 1 present in the microcontroller. And the values
which are incremented and decremented are shown in the LCD display
When high pulse signal is given to base of the Q1 transistors, the transistor is
conducting and shorts the collector and emitter terminal and zero signals is given
to base of the Q2 transistor. So the relay is turned OFF state.
All the interfacing with Microcontroller is done through its I/O lines The
Microcontroller used here is AT89C51.
The Values entered can be monitored in the Display with the display driver circuit
which is connected to the Microcontroller the Stepper Motor Is for driving the
Winding Machine .The stepper motor is put up by its Driver circuit.
19
Infrared transmitter is one type of LED which emits infrared rays generally
called as IR Transmitter. Similarly IR Receiver is used to receive the IR rays
transmitted by the IR transmitter. One important point is both IR transmitter and
receiver should be placed straight line to each other.
The transmitted signal is given to IR transmitter whenever the signal is high, the
IR transmitter LED is conducting it passes the IR rays to the receiver. The IR
receiver is connected with comparator. The comparator is constructed with LM
741 operational amplifier. In the comparator circuit the reference voltage is given
to inverting input terminal.
The non inverting input terminal is connected IR receiver. When interrupt the IR
rays between the IR transmitter and receiver, the IR receiver is not conducting.
So the comparator non inverting input terminal voltage is higher then inverting
input. Now the comparator output is in the range of +12V. This voltage is given to
base of the transistor Q1. Hence the transistor is conducting. Here the transistor
20
is act as switch so the collector and emitter will be closed. The output is taken
from collector terminal. Now the output is zero.
9. RELAY CIRCUIT
CIRCUIT DESCRIPTION
21
This circuit is designed to control the load. The load may be motor or
any other load. The load is turned ON and OFF through relay. The relay ON and
OFF is controlled by the pair of switching transistors (BC 547). The relay is
connected in the Q2 transistor collector terminal. A Relay is nothing but
electromagnetic switching device which consists of three pins. They are
Common, Normally close (NC) and Normally open (NO).
The relay common pin is connected to supply voltage. The normally open (NO)
pin connected to load. When high pulse signal is given to base of the Q1
transistors, the transistor is conducting and shorts the collector and emitter
terminal and zero signals is given to base of the Q2 transistor. So the relay is
turned OFF state.
1 on off off
0 off on on
22
RS232 COMMUNICATION
23
Functions of each circuit in the interface connector
Standard subsets of interface circuits for selected telecom applications
The standard does not define such elements as character encoding (for example,
ASCII, Baudot or EBCDIC), or the framing of characters in the data stream (bits
per character, start/stop bits, parity). The standard does not define protocols for
error detection or algorithms for data compression.
The standard does not define bit rates for transmission, although the standard
says it is intended for bit rates lower than 20,000 bits per second. Many modern
devices can exceed this speed (38,400 and 57,600 bit/s being common, and
115,200 and 230,400 bit/s making occasional appearances) while still using RS-
232 compatible signal levels.
Details of character format and transmission bit rate are controlled by the serial
port hardware, often a single integrated circuit called a UART that converts data
from parallel to serial form. A typical serial port includes specialized driver and
receiver integrated circuits to convert between internal logic levels and RS-232
compatible signal levels.
In this circuit the MAX 232 IC used as level logic converter. The MAX232 is a
dual driver/receiver that includes a capacive voltage generator to supply EIA 232
voltage levels from a single 5v supply. Each receiver converts EIA-232 to 5v
TTL/CMOS levels. Each driver converts TLL/CMOS input levels into EIA-232
levels.
24
In this circuit the microcontroller transmitter pin is connected in the MAX232 T2IN
pin which converts input 5v TTL/CMOS level to RS232 level. Then T2OUT pin is
connected to reviver pin of 9 pin D type serial connector which is directly
connected to PC.
25
MICROCONTROLLER
26
microprocessor based system, such as one using a Z80 and 8085 is expensive.
Both 8085 and Z80 system need some additional circuits to make a
microprocessor system. Each part carries costs of money. Even though a product
design may requires only very simple system, the parts needed to make this
system as a low cost product.
Markets for microcontrollers can run into millions of units per application.
At these volumes of the microcontrollers is a commodity items and must be
27
optimized so that cost is at a minimum. .Semiconductor manufacturers have
produced a mind-numbing array of designs that would seem to meet almost any
need. Some of the chips listed in this section are no longer regular production,
most are current, and a few are best termed as "smoke ware": the dreams of an
aggressive marketing department.
28
5 Port,
ADC,
5. Zilog Z8 - 40 32 128 2K External
Memory
128K,
16 Bit MC
1. Intel 80C196 - 68 40 232 8K External
Memory
64K,
Serial
Port,
ADC,
WDT,
PWM
2. Hitachi H8/532 - 84 65 1K 32K External
Memory
1M,
Serial
Port,
ADC,
PWM
3. National HPC16164 - 68 52 512 16K External
Memory
64K,
ADC,
WDT,
PWM
32 Bit MC
1. Intel 80960 - 132 20 MHz clock, 32 bit bus,
512 byte instruction cache
29
12.2 APPLICATION
Heating up some food in the microwave oven and making a call on a cell phone
also involve operating microcontrollers. That's just the beginning. Here are a few
more examples: Turning on the Television with a handheld remote, playing a
hand held game, Using a calculator, and Checking your digital wrist watch.
All those devices have microcontrollers inside them, that interact with you.
Consumer appliances aren't the only things that contain microcontrollers. Robots,
machinery, aerospace designs and other high-tech devices are also built with
microcontrollers.
30
31
12.4 PIN DIAGRAM
PIN DESCRIPTION
VCC
Supply voltage.
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. When 1s are written to port 0 pins, the pins can be
used as highimpedance inputs. Port 0 may also be configured to be the
multiplexed loworder address/data bus during accesses to external program and
data memory. In this mode P0 has internal pullups. Port 0 also receives the code
bytes during Flash programming, and outputs the code bytes during program
verification. External pullups are required during program verification.
32
Port 1
Port 1 is an 8-bit bidirectional I/O port with internal pullups. 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 pullups 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 pullups. Port 1 also receives the low-order address bytes during
Flash programming and verification.
Port 2
Port 2 is an 8-bit bidirectional I/O port with internal pullups. 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 pullups 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 pullups. Port 2 emits the high-order address byte during fetches
from external program memory and during accesses to external data memory
that use 16-bit addresses (MOVX @ DPTR). In this application it uses strong
internal pull-ups when emitting 1s. During accesses to external data memory
that use 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2
Special Function Register. Port 2 also receives the high-order address bits and
some control signals during Flash programming and verification.
Port 3
Port 3 is an 8-bit bidirectional I/O port with internal pullups. 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 pullups and can be used as inputs. As inputs,
Port 3 pins that are externally being pulled low will source current (IIL) because
of the pullups. Port 3 also serves the functions of various special features of the
AT89C51 as listed below:
33
Port 3 also receives some control signals for Flash programming and verification.
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.
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.
34
EA/VPP
External Access Enable. EA must be strapped to GND in order to enable
the device to fetch code from external program memory locations starting at
0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be
internally latched on reset. EA should be strapped to VCC for internal program
executions.
This pin also receives the 12-volt programming enable voltage (VPP)
during Flash programming, for parts that require 12-volt VPP.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
XTAL2
Output from the inverting oscillator amplifier. It should be noted that when
idle is terminated by a hard ware reset, the device normally resumes program
execution, from where it left off, up to two machine cycles before the internal
reset algorithm takes control. On-chip hardware inhibits access to internal RAM
in this event, but access to the port pins is not inhibited.
35
12.5 ARCHITECTURE OF 89C51
36
12.6 ADVANTAGES OF MICROCONTROLLERS
On - Chip EEPROM
37
12.7 POWER MODES OF ATMEL 89C51 ICROCONTROLLER:
IDLE MODE:
The CPU is turned off while the RAM and other on - chip peripherals
continue operating. Inn this mode current draw is reduced to about 15 percent of
the current drawn when the device is fully active.
All on-chip activities are suspended while the on – chip RAM continues to
hold its data. In this mode, the device typically draws less than 15 Micro Amps
and can be as low as 0.6 Micro Amps
POWER ON RESET:
When power is turned on, the circuit holds the RST pin high for an amount
of time that depends on the capacitor value and the rate at which it charges.
To ensure a valid reset, the RST pin must be held high long enough to
allow the oscillator to start up plus two machine cycles. On power up, Vcc should
rise within approximately 10ms. The oscillator start-up time depends on the
oscillator frequency. For a 10 Mhz crystal, the start-up time is typically 1ms.With
the given circuit, reducing Vcc quickly to 0 causes the RST pin voltage to
momentarily fall below 0V. How ever, this voltage is internally l limited and will not
harm the device.
All Atmel Flash micro controllers have separate address spaces for
porgram and data memory as shown in Fig 1.The logical separation of program
38
and data memory allows the data memory to be accessed by 8 bit addresses.
Which can be more quickly stored and manipulated by an 8 bit CPU
Nevertheless 16 Bit data memory addresses can also be generated through the
DPTR register?
The CPU generates read and write signals, RD and WR, during external data
memory accesses. External program memory and external data memory can be
combined by an applying the RD and PSEN signals to the inputs of AND gate
and using the output of the fate as the read strobe to the external program/data
memory.
PROGRAM MEMORY
The map of the lower part of the program memory, after reset, the CPU
begins execution from location 0000h. Each interrupt is assigned a fixed location
in program memory. The interrupt causes the CPU to jump to that location,
where it executes the service routine. External Interrupt 0 for example, is
assigned to location 0003h. If external Interrupt 0 is used, its service routine must
begin at location 0003h. If the I interrupt in not used its service location is
available as general-purpose program memory.
]
The interrupt service locations are spaced at 8 byte intervals 0003h for External
interrupt 0, 000Bh for Timer 0, 0013h for External interrupt 1,001Bh for Timer1,
and so on. If an Interrupt service routine is short enough (as is often the case in
control applications) it can reside entirely within that 8-byte interval. Longer
service routines can use a jump instruction to skip over subsequent interrupt
locations. If other interrupts are in use. The lowest addresses of program
39
memory can be either in the on-chip Flash or in an external memory. To make
this selection, strap the External Access (EA) pin to either Vcc or GND. For
example, in the AT89C51 with 4K bytes of on-chip Flash, if the EA pin is strapped
to Vcc, program fetches to addresses 0000h through 0FFFh are directed to
internal Flash. Program fetches to addresses 1000h through FFFFh are directed
to external memory.
DATA MEMORY:
The Internal Data memory is dived into three blocks namely, Refer Fig
The lower 128 Bytes of Internal RAM.
The Upper 128 Bytes of Internal RAM.
Special Function Register
Internal Data memory Addresses are always 1 byte wide, which implies an
address space of only 256 bytes. However, the addressing modes for internal
RAM can in fact accommodate 384 bytes. Direct addresses higher than 7Fh
access one memory space, and indirect addresses higher than 7Fh access a
different Memory Space.
The next 16-bytes above the register banks form a block of bit
addressable memory space. The micro controller instruction set includes a wide
selection of single - bit instructions and this instruction can directly address the
128 bytes in this area. These bit addresses are 00h through 7Fh. either direct or
indirect addressing can access all of the bytes in lower 128 bytes. Indirect
40
addressing can only access the upper 128. The upper 128 bytes of RAM are only
in the devices with 256 bytes of RAM.
DIRECT ADDRESSING:
In direct addressing, the operand specified by an 8-bit address field in the
instruction. Only internal data RAM and SFR’s can be directly addressed.
INDIRECT ADDRESSING:
In Indirect addressing, the instruction specifies a register that contains the
address of the operand. Both internal and external RAM can indirectly address.
The address register for 8-bit addresses can be either the Stack Pointer or
R0 or R1 of the selected register Bank. The address register for 16-bit addresses
can be only the 16-bit data pointer register, DPTR.
INDEXED ADDRESSING:
Program memory can only be accessed via indexed addressing this
addressing mode is intended for reading look-up tables in program memory. A 16
bit base register (Either DPTR or the Program Counter) points to the base of the
table, and the accumulator is set up with the table entry number. Adding the
Accumulator data to the base pointer forms the address of the table entry in
program memory.
41
Another type of indexed addressing is used in the“ case jump ”
instructions. In this case the destination address of a jump instruction is
computed as the sum of the base pointer and the Accumulator data.
REGISTER INSTRUCTION:
The register banks, which contains registers R0 through R7, can be
accessed by instructions whose opcodes carry a 3-bit register specification.
Instructions that access the registers this way make efficient use of code, since
this mode eliminates an address byte. When the instruction is executed, one of
four banks is selected at execution time by the row select bits in PSW.
IMMEDIATE CONSTANTS:
The value of a constant can follow the opcode in program memory For
example. MOV A, #100 loads the Accumulator with the decimal number 100.
The same number could be specified in hex digit as 64h.
PROGRAM STATUS WORD:
Program Status Word Register in Atmel Flash Micro controller:
PSW 7 PSW 0
PSW 6 PSW 1
PSW 5 PSW 2
PSW 4 PSW 3
42
PSW 0:
Parity of Accumulator Set By Hardware To 1 if it contains an Odd number
of 1s, Otherwise it is reset to 0.
PSW1:
User Definable Flag
PSW2:
Overflow Flag Set By Arithmetic Operations
PSW3:
Register Select
PSW4:
Register Select
PSW5:
PSW6:
Auxiliary Carry Flag Receives Carry Out from
Bit 1 of Addition Operands
PSW7:
Carry Flag Receives Carry Out From Bit 1 of ALU Operands.
The Program Status Word contains Status bits that refklect the current
stae of the CPU. The PSW shown if Fig resides in SFR space. The PSW
conrains the Carry Bit, The auxillary Carry (For BCD Operations) the two -
register select bits, the Overflow flag, a Parity bit and two user Definable status
Flags.
The Carry Bit, in addition to serving as a Carry bit in arithmetic operations
also serves the as the “Accumulator” for a number of Boolean Operations .The
bits RS0 and RS1 select one of the four register banks. A number of instructions
43
register to these RAM locations as R0 through R7.The status of the RS0 and
RS1 bits at execution time determines which of the four banks is selected.
The Parity bit reflect the Number of 1s in the Accumulator .P=1 if the
Accumulator contains an even number of 1s, and P=0 if the Accumulator
contains an even number of 1s. Thus, the number of 1s in the Accumulator plus
P is always even. Two bits in the PSW are uncommitted and can be used as
general-purpose status flags.
12.10 INTERRUPTS
When the service routine is vectored to hardware clears the flag that generated
an external interrupt only if the interrupt WA transition - activated. If the interrupt
was level - activated, then the external requesting source (rather than the on-chip
hardware) controls the requested flag. Tf0 and Tf1 generate the Timer 0 and
Timer 1 Interrupts, which are set by a rollover in their respective Timer/Counter
Register (except for Timer 0 in Mode 3).
When a timer interrupt is generated, the on-chip hardware clears the flag that
generated it when the service routine is vectored to. The logical OR of RI and TI
generate the Serial Port Interrupt. Neither of these flag is cleared by hardware
when the service routine is vectored to. In fact, the service routine normally must
determine whether RI or TI generated the interrupt an the bit must be cleared in
software.
In the Serial Port Interrupt is generated by the logical OR of RI and TI.
Neither of these flag is cleared by hardware when the service routine vectoredto.
44
In fact, the service routine normally must determine whether RI to TI generated
the interrupt and the bit must be cleared in software.
IE: INTERRUPT ENABLE REGISTER
EA - ET2 ES ET1 EX1 ET0 EX0
45
12.11 OSCILLATOR AND CLOCK CIRCUIT:
XTAL1 and XTAL2 are the input and output respectively of an inverting
amplifier which is intended for use as a crystal oscillator in the pioerce
configuration, in the frequency range of 1.2 Mhz to 12 Mhz. XTAL2 also the input
to the internal clock generator.
To drive the chip with an internal oscillator, one would ground XTAL1 and
XTAL2. Since the input to the clock generator is divide by two filip flop there are
no requirements on the duty cycle of the external oscillator signal. However,
minimum high and low times must be observed.
CPU TIMING:
46
The micro controller is the most essential IC for continuous process- based
applications in industries like chemical, refinery, pharmaceutical automobile,
steel, and electrical, employing programmable logic systems (DCS). PLC and
DCS thrive on the programmability of an MCU.
Micro controller devices have many similarities. When you look at the
differences, they are not so great either. Most common and popular MCUs
are considered to be mature and well-established products, which have their
individual adherents and devotees. There are a number of variants within
each family to satisfy most memory, I/O, data conversion, and timing needs of
enduser applications.
47
12.12 APPLICATIONS OF MICROCONTROLLERS
1. Industrial Control
2. Instrumentation and
Motor
Robotics
In medical instrumentation
Oscilloscopes
Telecommunication
Automobiles
Driving an LCD
Period Measurements
Block diagram
48
The ac voltage, typically 220V rms, is connected to a transformer, which
steps that ac voltage down to the level of the desired dc output. A diode rectifier
then provides a full-wave rectified voltage that is initially filtered by a simple
capacitor filter to produce a dc voltage. This resulting dc voltage usually has
some ripple or ac voltage variation.
A regulator circuit removes the ripples and also remains the same dc
value even if the input dc voltage varies, or the load connected to the output dc
voltage changes. This voltage regulation is usually obtained using one of the
popular voltage regulator IC units.
Working principle
Transformer
The transformer will step down the power supply voltage (0-230V) to (0-6V) level.
Then the secondary of the potential transformer will be connected to the
precision rectifier, which is constructed with the help of op–amp. The advantages
of using precision rectifier are it will give peak voltage output as DC; rest of the
circuits will give only RMS output.
Bridge rectifier
49
When four diodes are connected as shown in figure, the circuit is called as
bridge rectifier. The input to the circuit is applied to the diagonally opposite
corners of the network, and the output is taken from the remaining two corners.
The negative potential at point B will forward bias D1 and reverse D2. At
this time D3 and D1 are forward biased and will allow current flow to pass
through them; D4 and D2 are reverse biased and will block current flow.
The path for current flow is from point B through D1, up through RL,
through D3, through the secondary of the transformer back to point B. this path is
indicated by the solid arrows. Waveforms (1) and (2) can be observed across D1
and D3.
One-half cycle later the polarity across the secondary of the transformer
reverse, forward biasing D2 and D4 and reverse biasing D1 and D3. Current flow
will now be from point A through D4, up through RL, through D2, through the
secondary of T1, and back to point A. This path is indicated by the broken
arrows. Waveforms (3) and (4) can be observed across D2 and D4. The current
flow through RL is always in the same direction. In flowing through RL this
current develops a voltage corresponding to that shown waveform (5). Since
current flows through the load (RL) during both half cycles of the applied voltage,
this bridge rectifier is a full-wave rectifier.
50
This may be shown by assigning values to some of the components
shown in views A and B. assume that the same transformer is used in both
circuits. The peak voltage developed between points X and y is 1000 volts in
both circuits.
The maximum voltage that appears across the load resistor is nearly-but never
exceeds-500 v0lts, as result of the small voltage drop across the diode. In the
bridge rectifier shown in view B, the maximum voltage that can be rectified is the
full secondary voltage, which is 1000 volts.
Therefore, the peak output voltage across the load resistor is nearly 1000 volts.
With both circuits using the same transformer, the bridge rectifier circuit produces
a higher output voltage than the conventional full-wave rectifier circuit.
IC voltage regulators
51
either a fixed positive voltage, a fixed negative voltage, or an adjustably set
voltage.
The regulators can be selected for operation with load currents from hundreds of
milli amperes to tens of amperes, corresponding to power ratings from milli watts
to tens of watts.
52
The series 78 regulators provide fixed positive regulated voltages from 5 to
24 volts. Similarly, the series 79 regulators provide fixed negative regulated
voltages from 5 to 24 volts.
INTRODUCTION:
MANUFATCURING:
The manufacturing process consists of two methods; print and etch, and
print, plate and etch. The single sided PCBs are usually made using the print and
etch method. The double sided plate through – hole (PTH) boards are made by
the print plate and etch method.
The production of multi layer boards uses both the methods. The inner
layers are printed and etch while the outer layers are produced by print, plate and
etch after pressing the inner layers.
53
SOFTWARE:
The software used in our project to obtain the schematic layout is
MICROSIM.
PANELISATION:
DRILLING:
PCB drilling is a state of the art operation. Very small holes are drilled with
high speed CNC drilling machines, giving a wall finish with less or no smear or
epoxy, required for void free through hole plating.
PLATING:
The heart of the PCB manufacturing process. The holes drilled in the
board are treated both mechanically and chemically before depositing the copper
by the electro less copper platting process.
ETCHING:
Once a multiplayer board is drilled and electro less copper deposited, the
image available in the form of a film is transferred on to the out side by photo
printing using a dry film printing process. The boards are then electrolytic plated
54
on to the circuit pattern with copper and tin. The tin-plated deposit serves an etch
resist when copper in the unwanted area is removed by the conveyor’s spray
etching machines with chemical etch ants. The etching machines are attached to
automatic dosing equipment, which analyses and controls etch ants
concentrations
SOLDERMASK:
Since a PCB design may call for very close spacing between conductors,
a solder mask has to be applied on the both sides of the circuitry to avoid the
bridging of conductors. The solder mask ink is applied by screening. The ink is
dried, exposed to UV, developed in a mild alkaline solution and finally cured by
both UV and thermal energy.
After applying the solder mask, the circuit pads are soldered using the hot
air leveling process. The bare bodies fluxed and dipped in to a molten solder
bath. While removing the board from the solder bath, hot air is blown on both
sides of the board through air knives in the machines, leaving the board soldered
and leveled. This is one of the common finishes given to the boards. Thus the
double sided plated through whole printed circuit board is manufactured and is
now ready for the components to be soldered.
Keil c compiler:
55
Keil development tools for the 8051 Microcontroller Architecture support every
level of software developer from the professional applications engineer to the
student just learning about embedded software development.
The Keil 8051 Development Tools are designed to solve the complex problems
facing embedded software developers.
When starting a new project, simply select the microcontroller you use
from the Device Database and the µVision IDE sets all compiler, assembler,
linker, and memory options for you.
Numerous example programs are included to help you get started with the
most popular embedded 8051 devices.
When you are ready to begin testing your software application with target
hardware, use the MON51, MON390, MONADI, or FlashMON51 Target
56
Monitors, the ISD51 In-System Debugger, or the ULINK USB-JTAG Adapter
to download and test program code on your target system.
It's been suggested that there are now as many embedded systems in everyday
use as there are people on planet Earth. Domestic appliances from washing
machines to TVs, video recorders and mobile phones, now include at least one
embedded processor. They are also vital components in a huge variety of
automotive, medical, aerospace and military systems. As a result, there is strong
demand for programmers with 'embedded' skills, and many desktop developers
are moving into this area.
Simulator:
The Keil hardware simulator for the popular 8051 microcontroller is on the CD-
ROM so that readers can try out examples from the book - and create new ones -
without requiring additional hardware.
Key techniques required in all embedded systems are covered in detail, including
57
the control of port pins and the reading of switches.
A complete embedded operating system is presented, with full source code on
the CD-ROM.
58
16. PROGRAM
#include<AT89X52.h>
#include"smcl_lcd8.h"
#include"AT_i2c.h"
#include"AT_serial.h"
sbit IR=P1^0;
sbit F1=P1^1;
sbit D1=P1^2;
sbit G1=P1^3;
sbit Buzz=P3^2;
sbit set=P3^3;
sbit mov=P3^4;
sbit inc=P3^5;
sbit dec=P3^6;
sbit ent=P3^7;
void keypad(char);
void Gsm_send();
void Gsm_send2(); void check();
void gsm_Init();void enter();
59
bit a1,a2,a3,a4,c1,c2,c3,c4;
void main()
{
Buzz=0;
Lcd8_Init(); I2C_Init();Serial_Init(9600);
for(i=0;i<=9;i++){b[i]=read(i); Delay(5000);
Lcd8_Write(0x80+i,b[i]+0x30);}
for(i=0;i<=9;i++){c[i]=read(20+i);Delay(5000);
Lcd8_Write(0xc0+i,c[i]+0x30);}
Lcd8_Command(0x01);Delay(65000);
while(1)
{
if(!set){while(t<2){keypad(t);t++;}t=0;}
if(IR) {Lcd8_Display(0x84,"AB",2);a1=1;}
// Lcd8_Display(0x80," OBJECT DETECTED",16);
60
if(!IR){Lcd8_Display(0x84,"NM",2);a1=c1=0;}
//Lcd8_Display(0x84,"NM
",2);Lcd8_Display(0x84,"AB",2);
if(F1) {Lcd8_Display(0x8D,"AB",2);a2=1;}
//Lcd8_Display(0x80," FIRE DETECTED ",16);
if(!F1){Lcd8_Display(0x8D,"NM",2);a2=c2=0;}
//Lcd8_Display(0x8D,"NM",2);Lcd8_Display(0x8D,"AB",2);
if(!G1){Lcd8_Display(0xC4,"AB",2);a3=1;}
///Lcd8_Display(0x80," LPG GAS DETECT ",16);
if(G1) {Lcd8_Display(0xC4,"NM",2);a3=c3=0;}
////Lcd8_Display(0
xC4,"NM",2);Lcd8_Display(0xC4,"AB",2);
if(!D1){Lcd8_Display(0xCD,"AB",2);a4=1;}
if(D1) {Lcd8_Display(0xCD,"NM",2);a4=c4=0;}
//Lcd8_Display(0x80,"DOOR IS
BROKENED",16); ////
61
if(a3 && !c3){Gsm_send();Gsm_send2();}
if(a4 && !c4){Gsm_send();Gsm_send2();}
}
}
void keypad(char t)
{
k=p=0; Lcd8_Command(0x01);
if(t==0){Lcd8_Display(0x80," MOBILE NO.1
",16);Lcd8_Display(0xC0," ",16);}
if(t==1){Lcd8_Display(0x80," MOBILE NO.2
",16);Lcd8_Display(0xC0," ",16);}
Lcd8_Command(0x0f);
while(ent)
{
Lcd8_Command(0XC0+k);
if(!mov){while(!mov);Delay(5000);k++;if(k>9){k=0;}}
if(!inc){while(!inc);Delay(6500);p++;if(p>9)
{p=0;}a[k]=p;Lcd8_Write(0xc0+k,p+0x30);}
if(!dec){while(!dec);Delay(6500);p--;if(p>9)
{p=9;}a[k]=p;Lcd8_Write(0xc0+k,p+0x30);}
}
Lcd8_Command(0x0c);
62
if(t==0)
{
for(i=0;i<=9;i++)
{
write(i,a[i]); Delay(5000);
b[i]=read(i);Delay(5000);
Lcd8_Write(0xc0+i,b[i]+0x30);
}
if(t==1)
{
for(i=0;i<=9;i++)
{
write(20+i,a[i]); Delay(5000);
c[i]=read(20+i); Delay(5000);
Lcd8_Write(0xc0+i,c[i]+0x30);
}
void Gsm_send()
{
Lcd8_Command(0x01);
63
Lcd8_Display(0x80,"GSM ESTABLISHED",16);
gsm_Init();
Lcd8_Display(0x80,"MSG SENDING 1..",16);
Serial_Conout("AT+CMGS=",8);Delay(65000);
Serial_Out('"');
for(i=0;i<10;i++){Serial_Out(b[i]
+0x30);Delay(5000);Lcd8_Write(0xc0+i,b[i]+0x30);}
Serial_Out('"'); enter();
check(); enter();
Serial_Out(0x1a);
Delay(65000); Delay(65000);Delay(65000);
gsm_Init();
Lcd8_Display(0x80,"MSG SENDING 2..",16);
Serial_Conout("AT+CMGS=",8);Delay(65000);
Serial_Out('"');
for(i=0;i<10;i++){Serial_Out(c[i]
+0x30);Delay(5000);Lcd8_Write(0xc0+i,c[i]+0x30);}
Serial_Out('"'); enter();
check(); enter();
Serial_Out(0x1a);
Lcd8_Display(0x80,"MSG SENDED.....",16);
Lcd8_Command(0x01);
void Gsm_send2()
{
Lcd8_Display(0x80,"CALL ESTABLISHED",16);
gsm_Init();
64
Lcd8_Display(0x80,"CALL CONNECTED..",16);
Serial_Conout("ATD",3);
for(i=0;i<10;i++){Serial_Out(c[i]
+0x30);Delay(5000);Lcd8_Write(0xc0+i,c[i]+0x30);}
Serial_Out(';'); enter();
Delay(65000);Delay(65000);Delay(65000);Delay(65000);Delay(65000);
Delay(65000);Delay(65000);Delay(65000);Delay(65000);Delay(65000);
Delay(65000);Delay(65000);Delay(65000);Delay(65000);Delay(65000);
Lcd8_Display(0x80,"CALL ENDED......",16);
Lcd8_Command(0x01);
void gsm_Init()
{
Serial_Conout("AT",2); enter();
Serial_Conout("AT+CMGF=1",9); enter();
Serial_Conout("AT+CNMI=2,2,0,0,0",17); enter();
}
65
void check()
{
if(a1){Serial_Conout("OBJECT DETECTED",15); enter();}
if(a2){Serial_Conout("FIRE DETECTED",13); enter();}
if(a3){Serial_Conout("GAS LEAKAGE DETECTED",20); enter();}
if(a4){Serial_Conout("DOOR BROKENED",13); enter();}
ADVANTAGES
66
APPLICATION
This project is used for improve the security performance in the house
17. CONCLUSION
This project is very useful in today’s life. Because now d ays Bank security is very
important to avoid the thief in the home. Now a day’s every person having cell
phone. If any gas leakage or fire in the house it will sense that leakage and send
the signal to microcontroller to signal and conditioning unit. The mobile phone is
interfaced with microcontroller through data cable and RS 232.
67
If any one transducer is activated due to that corresponding reason
microcontroller send the related information to the mobile phone. The mobile
phone sends this information as SMS to desired phone as per the phone number
stored in the microcontroller. So this project provides total security to the house.
18. BIBLIOGRAPHY
68
2 Roy Choudhury D, Shail Jain, “ Linear Integrated Circuit”, New
Age International Publishers, New Delhi,2000
69