You are on page 1of 64

CHAPTER 1

INTRODUCTION

1
1.1 Aim of the project:
The main objective of this project is to develop an Automatic
Door opening system using IR sensors which will reduce the
need of manual labor.

1.2 Methodology:
According to our project requirements, the following modules
are essential.
• Power supply
• Microcontroller
• Stepper Motor
• IR sensors

1.3 Significance and applications:


Automatic door opening systems using IR sensors plays a very
important role in domestic applications. The elimination of
manual supervision adds up as an additional advantage for its
usage. Its significance can be proved by considering the
following specialties of kit designed by us

• Reliability: Reliability is one such factor that every


electrical system should have in order to render its
services without malfunctioning over along period of
time. We have designed our kit using AT89C52 micro
controller which is itself very reliable and also operates
very efficiently under normal condition
• Cost: The design is implemented at an economical
price.
• Hassle-free maintenance: Automatic door opening
systems using IR sensors offers a round the clock

2
service which reduces the requirement of shifting
watchmen.
• Simple Technology: This project uses a relatively
simple technology, thus reducing the strain to a good
extent.

1.4 Organization of the report:


The report totally consists of seven chapters - Chapter 1 gives the
introduction to the project, Chapter 2 provides an overview of the project
with the help of a block diagram, Chapter 3 gives a note of embedded
systems usage, Chapter 4 explains about the circuitry and the
interconnections of the project, Chapter 5 explains in detail about the
components used in our project, chapter 6 provides a compact project
description, chapter 7 makes use of a flowchart , and then followed by the
conclusion.

3
CHAPTER 2
OVERVIEW

4
2.1 OVERVIEW OF THE PROJECT

2.1.1 Block Diagram of an IR door opening system

2.1.2 Block diagram description

The block diagram of the embedded security system consists of


the following modules.

• 555 timer : The 555 timer has been employed to generate a


square wave of 56KHz frequency. The output signal for this
module is used to drive the Infrared Emitting Diode.
• IR Receiver: This project makes use of an infrared sensor
module, which consists of an Infrared emitting IR receiver
TSOP 1356. The output of IR receiver is connected to pin 1 of
the microcontroller 8952.

5
• Microcontroller: This project employs the 8-bit
microcontroller from ATMEL (AT89S52). The microcontroller
in our security system is used for sending signals to the auto
dialer and buzzer alarm.
• Stepper motor: The stepper motor used here is for the
movement of the door connected to it, through a particular
specified angle in steps in precise positions.
• Power supply: Supply of 230V, 50Hz ac signal from main
supply board is given to a step down transformer. The
transformer is selected such that its output ranges from 10V to
12V, used for the various components in the project, as per
their needs.
• ULN 2803: As the microcontrollers maximum voltage is 5V,
this component is used for supplying the 12V to run the stepper
motor. It provides the 12V to the motor to run it, as it receives
the signal from the microcontroller.

6
CHAPTER 3
EMBEDDED SYSTEMS

7
3.1 INTRODUCTION TO EMBEDDED SYSTEM

An Embedded system is a special-purpose computer system


designed to perform one or a few dedicated functions, sometimes with
real time computing constraints. it is usually embedded as a part of a
complete device including hardware and mechanical parts. Since the
embedded system is dedicated to few specific tasks, design engineers
can optimize it, reducing the size and the cost of the product or
increasing the reliability and performance.

For example, handheld computers share some elements with


embedded system= such as the operating systems and microprocessors
which power them –but are not truly embedded system, because they
allow different applications to be loaded and peripherals to be
connected. The program is written to the system memory in this case
rather than being loaded into the RAM, as programs on a personal
computer are.

The main purpose of the microprocessors are simplify the


system design and improve flexibility. In the embedded systems, the
software is often stored in a read only memory (RAM) chip.Embedded
systems provide several major functions including monitoring of the
analog environment by reading data from sensors and controlling
actuators.

Embedded

Inputs (sensor) System Outputs


(actuator)

Fig 3.1 A real time system interacts with environment

8
3.1.1 Examples of embedded systems

Embedded systems are found in wide range of application


areas. Originally they were used only for expensive industrial control
applications, but as technology brought down the cost of dedicated
processors, they began to appear in moderately expensive applications
such as automobiles, communication and office equipments and
television Today's embedded systems are so inexpensive that they are
used in almost every electronic product in our life. Embedded systems
are often designed for mass production.

Some examples of embedded systems:

• Automatic Teller Machines


• Engine controllers and antilock break controllers for
automobiles
• Measurement equipment
• Multifunction printers
• Mobile phones with additional capabilities
• Programmable Logic Controllers

3.2MICROPROCESSOR AND MICROCONTROLLER


Microprocessors and microcontrollers are used in embedded
system products. An embedded product uses a microprocessor (or
microcontroller) to do one task and one task only.

Microprocessor as the term come to be known is a general


purpose digital computer central processing unit. Although popularly
known as a "computer on chip", the microprocessor is in no sense a
complete digital computer.

9
Microprocessor CPU contains Arithmetic Logical Unit, a
program counter, a stack pointer, some working registers, a clock
timing circuits and interrupt circuit.

To make complete microcomputer memory must add, usually


Read Only Memory, Random Access Memory, memory decoders and
an Input/ Output devices. In addition special purpose devices such as
interrupts, counters may be added to relieve the CPU from time
consuming counting or timing chores.

The hardware design of microprocessor CPU is arranged so


that a small or very large system can be configured around the CPU as
the application demands. The internal CPU architecture as well as the
resultant machine level code that operates that architecture is
comprehensive but as flexible as possible.The prime use of
microprocessor is to read data perform extensive calculations on that
data and store those calculations in mass storage devices or display the
results for user use. The program is used by microprocessor are stored
in the mass storage devices and loaded into RAM as the user directs.

A microcontrollers is a computer on a single chip .Micro


suggest that the device is small and controller tells that the device is
used to control objects, process or events

Microcontroller is a highly integrated chip that contains all the


devices comprising a computer. Typically this includes a CPU, RAM,
Input/ Output ports, timers, interrupts. So microcontroller is also called
as "true computer on a chip". Unlike a general purpose computer
which also includes all of these devices. A microcontroller is designed
for a very specific task to control a particular system.

10
A microcontroller is a general purpose device but one that is
meant to read data, perform limited calculations on that data and
control its environment based on those calculations.The prime use of
microcontroller is to control the operation of machine using a fixed
program that is stored in ROM that does not change over the life time
of the system.

The advantages of microcontroller over microprocessor are

• cost is less
• speed is more
• power consumption is less
• compact device

11
3.3 Criterion for choosing a microcontroller

The first criterion for choosing a microcontroller is that it must


meet the tasks at hand efficiently and cost effectively. In analyzing the
needs of a microcontroller based project we must see whether it’s a
8bit,16bit or a 32bit microcontroller and how best it can handle the
computing needs of the task most effectively.

The other considerations in this category are:

(a) speed : the highest speed that the microcontroller can support
(b) Packaging: is it a 40-pin DIP, QPF or some other packaging
format? This is important in terms of space, assembling and
prototyping the end-product.
(c) Power consumption: this is especially critical for battery
powered products.
(d) The amount of RAM and ROM space on chip.
(e) The number of I/O pins and timers on the chip.
(f) How easy it is to upgrade to higher performance or lower
power consumption versions.
(g) Cost per unit: this is important in terms of final product in
which a microcontroller is used.
The second criterion depends on how easy it is to develop
products around it.

The third criterion is regarding the availability of the tools in


needed quantities both now and in future.

12
3.4 8051 MICROCONTROLLER

3.4.1 8051 Architecture

The generic 8051 architecture contains two separate buses for


both program and data. So, it has two distinctive memory spaces of
64× 8 size for both programmed and data. It is based on an 8-bit CPU
with an 8-bit accumulator and another 8-bit B register as main
processing blocks. Other portions of the architecture include few 8 bit
registers and 8 bit memory locations.

Each 8051 device has some amount of data Ram built in the
device for internal processing. This area is used for stack operations
and temporary storage of data. This bus architecture is supported with
on-chip peripheral functions like I/O ports, timers/counters, versatile
serial communication port.

FEATURES OF 8051 ARCHITECTURE

 Optimised 8 bit CPU for control applications.


 64K program Memory address space.
 64K program Data address space.
 128 bytes of on chip Data memory.
 32 bi-directional and individually addressable
I/O lines.
 Two 16 bit timer/counters.
 Full Duplex UART.
 6-source/5-vector interrupts structure with
priority levels.
 On chip clock oscillator.

13
Cou
nte
Rxd
r

CHAPTER 4
CIRCUIT DIAGRAM

14
4.1 CIRCUIT DESCRIPTION

Fig 4.1 Circuit Diagram of IR door opening system

4.1.1 MICROCONTROLLER:

The microcontroller used in this project is AT89S52, which is a


40 pin IC

• Pin 40 is connected to +5v power supply


• Reset circuit is connected to pin 9 of 8952 to provide reset
condition when the microcontroller is powered off. The reset

15
circuitry comprises of 10 micro farads (C6) and a resistor (R5)
of 8.2k ohms.
• Pin 31 (EA\VPP) is tied to VCC for internal program
execution.
• The crystal oscillator (11.0592MHz) is connected across pin 18
and pin19.
• Pin 1 (port 1.0) is connected to the output (pin 3) of the IR
receiver (TSOP 1356).
• Pin 3 (port 1.2) is connected to the Chip Enable input (pin 2) of
the DTMF generator (UM95089).
• Port 2 of the microcontroller is used to drive the stepper motor
using ULN 2803.

4.1.2 555TIMER:

NE 555 is a highly stable controller capability of producing


accurate timing pulses. In this circuit, 555timer has been connected in
astable mode to accurately generate a square wave of frequency 56
KHz. For the astable mode, we connect two external resistors (R1,
R2) and one capacitor (C1).

• Pin 8 is connected to +5V power supply.


• Pin 1 is grounded.
• Pin 4 is tied to +5V power supply.
• A 220 ohm (Ra) is connected between pin 8 and pin 7.
• A 10.2K pot is connected between pin 7 and pin 6
• A capacitor (C1) of 0.05uf is connected between pin 2 and pin1
• Pin 5 is connected to the ground through a capacitor (C2) of .
01uf.

16
• The output of 555timer at pin 3 which is connected to the
Infrared emitting diode (TSAL 6200).
4.1.3 INFRARED EMITTING DIODE (TSAL 6200):

TSAL 6200 is a high efficiency infrared emitting diode


modeled in clear gray tinted plastic packages. The pulse current
through the LED can vary from 100mA to well over 1A. In order to
get an acceptable control distance, the LED currents have to be as high
as possible. A trade-off should be made between LED parameters and
maximum control distance. Average power dissipation of the LED
should not exceed the maximum value though.

We adopt modulation technique to ensure that our IR message


gets across to the receiver without errors. With modulation, we make
the IR light source blink in a particular frequency. The IR receiver will
be tuned to that frequency, so it can ignore everything else.

In our IR sensor module, we have chosen a carrier frequency of


56 kHz. Hence the current pulses are at a frequency of 56 kHz. There
are several manufacturers of IR receivers in the market. Siemens,
Vishay and Telefunken are main suppliers. Vishay has its TSOP
product series (TSOP 13xx, TSOP 48xx, TSOP 62xx where xx
indicates the modulation frequency of 30, 33,36,38,40 or 56 kHz)The
anode of LED is connected to pin 3 of 555 timer and the cathode of the
LED is grounded through a resistor (R3) of 500 ohms.

4.1.4 IR RECEIVER (TSOP 1356):

TSOP 13xx series are miniaturized receivers for infrared


remote control systems. PIN diode and preamplifier are assembled on
lead frame, the epoxy package is designed as IR filter. The

17
demodulated output signal can directly be decoded by a
microprocessor.

TSOP 13xx is the standard IR remote control receiver series,


supporting all major transmission codes.

• Pin 1 is grounded.
• A capacitor (C3) of 4.7 micro farads connected between pin
1 and pin 2.
• Pin 2 is connected to a supply of +5V through a resistor
(R4) of 1k ohms.
• When there is a proper transmission and reception between
the LED and IR receiver, the output of TSOP 1356 is logic high.
• The carrier frequency should be close to 56 kHz. Whenever
there is no link between IR transmitter and receiver, the output pin
3 of TSOP 1356 will be logic low.

4.1.5 POWER SUPPLY

Supply of 230V, 50Hz ac signal from main supply board is


given to a step down transformer. The transformer is selected such that
its output ranges from 10V to 12V, which is supplied to the power
supply block for making the output compatible with the TTL logic
supply. This TTL logic supply acts as the power supply for the
microcontroller, IR sensor, auto dialer, timer circuit and buzzer. Thus
the main function of the power supply is to give the voltage supply
required for the logic families, which is an output of +5V.

18
Fig 4.2 power supply block diagram

19
CHAPTER 5
COMPONENTS USED IN THE PROJECT
AND THEIR DESCRIPTION

20
5.1 MICROCONTROLLER
5.1.1 Description of AT89S52

The AT89S52 is a low power, high performance CMOS 8bit


microcontroller with 8K bytes of in-system programmable flash
memory, manufactured using Atmel’s high density non-volatile
memory technology and is compatible wih the industry-standard
80C51 instruction set. The on chip flash allows the program
memory to be reprogrammed in-system or by a conventional non-
volatile memory programmer. By combining a versatile 8bit CPU
with in-system programmable flash on a monolithic chip, the
Atmel’s AT89S52 is a powerful microcontroller providing high-
flexibility to embedded control applications.

The AT89S52 provides the following standard features:

• Compatible with MCS-51 Products


• 8 Kbytes of In-System Reprogrammable Flash Memory
• Endurance: 1,000 Write/Erase Cycles
• 4.0 to 5.5V Operating range
• Fully Static Operation: 0 Hz to 33 MHz
• Three-Level Program Memory Lock
• 256 x 8-Bit Internal RAM
• 32 Programmable I/O Lines
• Three 16-Bit Timer/Counters
• Eight vector two level Interrupt Sources
• Full Duplex UART Serial Channel
• Interrupt Recovery from Power-down Modes
• Programmable Serial Channel

21
• Low Power Idle and Power Down Modes
• Watchdog Timer
• Dual Data Pointer
• Power-Off Flag
• Fast Programming Time
• Flexible ISP programming(Byte and Page mode)
In addition, the AT89C52 is designed with static logic for operation
down to zero frequency and supports two software selectable power
saving modes.
The Idle Mode stops the CPU while allowing the RAM,
timer/counters, serial port and interrupt system to continue
functioning. The Power down Mode saves the RAM contents but
freezes the oscillator disabling all other chip functions until the next
hardware reset.

22
Fig 5.1.2 Pin diagram of 8052

23
24
Fig 5.1.3 Block diagram of 8052

5.1.2 Pin Description

• VCC
Pin 40 provides Supply voltage to the chip. The voltage source
is +5v.

• GND.
Pin 20 is the grounded

• Port 0
Port 0 is an 8-bit open drain bidirectional I/O port from pin 32
to 39. 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 high-impedance
inputs. Port 0 may also be configured to be the multiplexed low-order

25
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 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
from pin 1 to 8. 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. In addition, P1.0 and P1.1 can be configured to be
the timer/counter 2 external count input(P1.0/T2) and the
timer/counter 2 trigger input (P1.1/T2EX), respectively as shown
below

Fig 5.1 Alternate function of the ports

• Port 2
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups
from pin 21 to 28. 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.

26
Port 2 emits the high-order address byte and 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 pull-ups
from pin 10 to 17. 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:

Table 5.2 Special Features of 89C5

• RST
Pin 9 is the Reset input. It is active high. Upon applying a high
pulse to this pin, the microcontroller will reset and terminate all

27
activities. 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. 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 AT89C52 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
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

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

 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 5.3. 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 5.4.

Fig 5.1.4 crystal connections

29
Figure 5.1.5 External Clock Drive Configuration

There are no requirements on the duty cycle of the external


clock signal, since the input to the internal clocking circuitry is
through a divide-by two flip-flop, but minimum and maximum voltage
high and low time specifications must be observed.

 TIMERS
o Timer 0 and 1
Timer 0 and Timer 1 in the AT89S52 operate the same way as
Timer 0 and Timer 1 in the AT89S51.

o Timer 2
Timer 2 is a 16-bit Timer/Counter that can operate as either a
timer or an event counter. The type of operation is selected by bit C/T2
in the SFR T2CON. Timer 2 has three operating modes: capture, auto-
reload (up or down counting), and baud rate generator. The modes are
selected by bits in T2CON, as shown in Table 5.2. Timer 2 consists of
two 8-bit registers, TH2 and TL2. In the Timer function, the TL2

30
register is incremented every machine cycle. Since a machine cycle
consists of 12 oscillator periods, the count rate is 1/12 of the oscillator
frequency.

Table 5.1.3. Timer 2 Operating Modes

In the Counter function, the register is incremented in response


to a 1-to-0 transition at its corresponding external input pin, T2. In this
function, the external input is sampled during S5P2 of every machine
cycle. When the samples show a high in one cycle and a low in the
next cycle, the count is incremented. The new count value appears in
the register during S3P1 of the cycle following the one in which the
transition was detected. Since two machine cycles (24 oscillator
periods) are required to recognize a 1-to-0 transition, the maximum
count rate is 1/24 of the oscillator frequency. To ensure that a given
level is sampled at least once before it changes, the level should be
held for at least one full machine cycle.

There are no restrictions on the duty cycle of external input


signal, but it should for at least one full machine to ensure that a given
level is sampled at least once before it changes

 Interrupts
The AT89S52 has a total of six interrupt vectors: two external
interrupts (INT0 and INT1), three timer interrupts (Timers 0, 1, and 2),

31
and the serial port interrupt. These interrupts are all shown in Figure
5.5

Fig 5.1.6 Interrupts source

Each of these interrupt sources can be individually enabled or


disabled by setting or clearing a bit in Special Function Register IE. IE
also contains a global disable bit, EA, which disables all interrupts at
once. Note that Table 5.3 shows that bit position IE.6 is
unimplemented. In the AT89C51, bit position IE.5 is also
unimplemented. User software should not write 1s to these bit
positions, since they may be used in future AT89 products.

32
Table 5.4 Interrupts Enable Register

Timer 2 interrupt is generated by the logical OR of bits TF2


and EXF2 in register T2CON. Neither of these flags is cleared by
hardware when the service routine is vectored. In fact, the service
routine may have to determine whether it was TF2 or EXF2 that
generated the interrupt, and that bit will have to be cleared in software.

The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2
of the cycle in which the timers overflow. The values are then polled
by the circuitry in the next cycle. However, the Timer 2 flag, TF2, is
set at S2P2 and is polled in the same cycle in which the timer
overflows.

 Idle Mode

33
In idle mode, the CPU puts itself to sleep while all the on-chip
peripherals remain active. The mode is invoked by software. The
content of the on-chip RAM and all the special functions registers
remain unchanged during this mode. The idle mode can be terminated
by any enabled interrupt or by a hardware reset. It should be noted that
when idle is terminated by a hardware reset, the device normally
resumes program execution, from where it left off, up to two machine
cycles before the internal reset algorithm takes control.

 Power down Mode


In the power down mode the oscillator is stopped, and the
instruction that invokes power down is the last instruction executed.
The on-chip RAM and Special Function Registers retain their values
until the power down mode is terminated. The only exit from power
down is a hardware reset. Reset redefines the SFRs but does not
change the on-chip RAM.

Table 5.5 Status Of External Pins During Idle and Power Down Mode

 Program Memory Lock Bits


The AT89S52 has three lock bits which can be left
unprogrammed(U) or can be programmed (P) to obtain the additional
features listed in the following table. When lock bit 1 is programmed,
the logic level at the EA pin is sampled and latched during reset. If the

34
device is powered up without a reset, the latch initializes to a random
value, and holds that value until reset is activated. The latched value
must agree with the current logic level at that pin in order for the
device to function properly.

Table 5.6 Lock Bit Protection Modes

5.2 INFRARED SENSOR

5.2.1 INFRARED EMITTING DIODE

TSAL 6200 is a high efficiency infrared emitting diode in Ga


Al As on Ga As technology modeled in clear, blue-grey tinted plastic
packages.

In comparison with standard Ga As on Ga As technology, these


emitters achieve more than 100% radiant power improvement at a
similar wavelength.The forward voltages at low current and at high
pulse current correspond to the values of the standard technology.

35
Therefore these emitters are ideally suitable as high performance
replacements of standard emitters. The transmitter usually is a battery
powered handset. It should consume as little power as possible, and
should be strong as possible to achieve an acceptable control distance.

Many chips are designed to be as IR transmitters. The older


chips were dedicated to only one of many protocols that were
invented. Nowadays very low power microcontrollers are used in IR
transmitters for the simple reason that they are more flexible in their
use.

 FEATURES:
• Extra high radiant power and radiant intensity and high
reliability
• Low forward voltage
• Suitable for high pulse current operation
• Peak wavelength = 940nm
• Good spectral matching to Si photo detectors

 APPLICATIONS:
• IR remote control units with high power requirements
• Free air transmission systems
• Infrared source for optical counters and readers
• IR source for smoke detector

5.2.2 IR RECEIVER

36
Many different receiver circuits exists on the market. The most
important selection criteria are the modulation frequency used and the
availability in you region.

TSOP 1356 series are miniaturized receivers for IR remote


control systems. The demodulated output signal can directly be
decoded by a microcontroller. It is standard IR remote control receiver
series, supporting all major transmission codes.

Amplifie Limiter B.P.F


r

Comparator Integrat Demodulat


or or

Fig5.5.2.1 Block Diagram of an IR receiver

In the picture above you can see a typical block diagram of an


IR receiver. The received IR signal is picked up by the IR detection
diode on the left side of the diagram.

This signal is amplified and limited by the first two stages. The limiter
acts as an AGC circuits to get a constant pulse level, regardless of the
distance to the hand set.

As you can see only the AC signal is sent to the Band Pass
Filter. The B.P.F is tuned to the modulation of the handset unit.
Common frequencies range from 30 kHz to 60 kHz in consumer
electronics. The next stages are a detector, integrator and comparator.
The purpose of these three blokes is to detect the presence of the

37
modulation frequency. If the modulation frequency is present, the
output of the comparator will be pulled low.

All these blokes are integrated into a single electronic


component. There are many different manufactures of these
components on the market. And most devices are available in several
versions each of which are tuned to a particular modulation frequency.

The amplifier is set to a very high gain. Therefore the system


tends to start oscillating very easily. Placing a large capacitor of al
least 22 microfarads close to the receiver’s power connections is
mandatory to decouple of 330 ohms in series with the power supply to
further decouple the power supply from the rest of the circuit.

Fig5.2.2 IR Receiver (TSOP 1356)

 BLOCK DIAGRAM OF TSOP 1356

38
Figure 5.2.3 Block diagram of TSOP 1356

 FEATURES:
• Phone detector and preamplifier in one package
• Internal filter for PCM frequency
• TTL and CMOS compatibility
• Output active is low
• High immunity against ambient light
• Continuous data transmission possible

39
5.3 555 TIMER
A 555 timer IC is most versatile and highly reliable linear IC. It
is used for generating accurate time delay or oscillations. SIGNETICS
corporation first introduce the device SE\NE 555. This device is
available as 8 pin metal can, 8 pin mini DIP. The SE 555 is
designed for the operating temperature range from -55 degree
centigrade to +125 degree centigrade while the NE 555 operates on a
range from 0 degree centigrade to 70 degree centigrade. The NE
555 timer operates on +5v to +18v power supply. It has adjustable
duty cycle from micro seconds to hours. It has highly current output. It
can source or sink 200mA. It is compatible with both TTL and CMOS
logic circuits.

5.3.1 FUNCTIONAL BLOCK DIAGRAM OF 555 TIMER

The block diagram of 555 timer is shown in figure5.7 It


consists of two comparators resistive divider network flip-flop and a
discharge transistor. The upper comparator has a threshold input and a
control input. The control voltage is 2\3 VCC. When ever the
threshold voltage exceeds the control the high output from the
comparator will set the flip-flop. The collector of the discharge
transistor is goes to pin number 7. When this pin is connected to an
external timing capacitor, high Q output from the flip-flop will saturate
the transistor and discharge the capacitor. When Q is low transistor
opens and the capacitor will charge.

40
The complementary signal of the flip-flop is taken as output of
the 555 (pin no 3). The reset pin prevents the flip-flop from working.
Hence in most applications reset pin is connected to supply voltage.

The lower comparator is connected trigger input and a fixed


voltage 1\3 VCC. When the trigger voltage is slightly less than 1\3
VCC the comparator output goes high and reset the flip-flop. Pin no1
is known as ground the supply pin 8.

Fig5.3.1 Block Diagram of 555 Timer

41
5.3.2 PIN DIAGRAM OF 555 TIMER

Fig 5.3.2 Pin Diagram of 555

5.3.3 PIN DIAGRAM DESCRIPTION

• Ground (Pin 1)

Not surprising this pin is connected directly to ground.

• Trigger (Pin 2)

This pin is the input to the lower comparator and is used to set
the latch, which in turn causes the output to go high.

• Output (Pin 3)

Output high is about 1.7V less than supply. Output high is


capable of Isource up to 200mA while output low is capable of
Isink up to 200mA.

• Reset (Pin 4)

This is used to reset the latch and return the output to a low
state. The reset is an overriding function. When not used connect to
V+.

42
• Control (Pin 5)

Allows access to the 2/3V+ voltage divider point when the 555
timer is used in voltage control mode. When not used it is connected to
ground through a 0.01 uF capacitor.

• Threshold (Pin 6)

This is an input to the upper comparator. See data sheet for


comprehensive explanation.

• Discharge (Pin 7)

This is the open collector to Q14 in figure 4 below. See data


sheet for comprehensive explanation.

• V+ (Pin 8)

This connects to VCC and the Philips data book states the
ICM7555 CMOS version operates 3V - 16V DC while the NE555
version is 3V - 16V DC. Note comments about effective supply
filtering and bypassing this pin below under "General considerations
with using a 555 timer" The 555 can be connected as monostable
multivibrator and astable multivibrator mode.

5.3.4 ASTABLE MULTIVIBRATOR USING 555 TIMERS

The 555 timer is connected is astable mode is shown in figure.


The astable multivibrator has two quasi stable states. Initially when the
output is high i.e. Q is low Q' is high, the capacitor C starts charging
towards VCC through R1 and R2 with time constant (R1+R2) C.
However as soon as voltage across the capacitor equals to 2\3 VCC,
comparator1 triggers the flip-flop and the output switches to low i.e. Q
is high and Q' is low. Because of this transistor acts as short circuit,

43
which results the capacitor starts discharging through R2 and
discharge transistor Q1. When the voltage across equal’s 1\3Vcc
comparator2 output resets the flip-flop and output goes high, again the
above cycle repeats.The time during which the capacitor charges from
1\3Vcc to 2\3Vcc is equal to the time the output is high and is given by

TC = 0.69 (RA+RB) C

Similarly, the time period during the capacitor discharges from


2\3Vcc to 1\3Vcc is equal to the time output is low and is given by

Td = 0.69RB*C

Thus the total time period is given by

T = TC +Td = 0.69(RA+2RB) C

Thus the astable multivibrator generates the asymmetric square


wave with frequency of oscillations and is given by

f = 1\T = 1.49\ (RA+2RB) C

And the duty cycle is given by

D = (RA+RB)\(R1+2RB)

Fig 5.3.4 555 as Astable operation

44
5.4 STEPPER MOTOR

A stepper motor is an electromechanical device which


converts electrical pulses into discrete mechanical movements. The
stepper motor is used for position control in applications like disk
drives and robotics. The name stepper is used because this motor
rotates through a fixed angular step in response to each input current
pulse received by its controller. In recent years, there has been a wide-
spread demand of stepper motors because of the explosive growth of
computer industry.

Their popularity is due to the fact that they can be controlled


directly by computers, microprocessors and programmable controllers.
Stepper motors are ideally suited for situations where precise position
and speed control are required without the use of a closed-loop
feedback. When a definite number of pulses are supplied, the shaft
turns through a definite known angle. This fact makes the motor well
suited for open-loop position control because no feedback is to be
taken from the output shaft.Every stepper motor has a permanent
magnet rotor also known as shaft surrounded by a stator poles. The
most common stepper motors have four stator windings that are paired
with a center-tapped.

This type of stepper motor is commonly referred to as a four-


phase stepper motor. The center tap allows a change of current
direction in each of two coils when a winding is grounded, there by
resulting in a polarity change of the stator.

45
Fig 5.4.1 Rotor diagram

The shaft or spindle of a stepper motor rotates in discrete step


increments when electrical command pulses are applied to it in the
proper sequence. The direction of the rotation is determined by the
stator poles. The stator poles are determined by the current sent
through the wire coils. As the polarity of the current is changed, the
polarity is also changed causing a reverse motion of the motor .The
sequence of the applied pulses is directly related to the direction of
motor shafts rotation. The speed of the motor shafts rotation is directly
related to the frequency of the input pulses and the length of rotation is
related to the number of input pulses applied.

While a conventional motor shaft moves freely, stepper motor


shaft moves in a fixed repeatable increment which helps in precise
positioning. This repeatable fixed movement is possible as a result of
basic magnetic theory where poles of the same polarity repel and
opposite poles attract.

The stepper motor converts digital signals into fixed


mechanical increment of motion. It thereby provides a natural interface
with the digital computer. It is a synchronous motor such that the rotor
rotates a specific incremental number of degrees for each pulse input
given to the motor system. These motors can provide accurate

46
positioning without the need of position feedback sensors when
compared to other motors.

The position is known simply by keeping track of the input


step pulses. Usually, position information can be obtained simply by
keeping count of the pulses sent to the motor thereby eliminating the
need of expensive position sensors and feedback controls Stepper
motors are rated by the torque they produce ,step angle ,steps per
second and the number of teeth on rotor.

The minimum degree of rotation with which the stepper motor


turns for a single pulse if supply to one wire or a pair is called step
angle. The minimum step angle is always a function of the number of
teeth on rotor i.e., the smaller the step angle the more teeth the rotor
possesses.

Steps per complete revolution = Number of phases (coils) x

Number of teeth on rotor

Smaller the step angle, greater the number of steps per revolution and
higher the resolution or the accuracy of positioning obtained. The step
angles can be as small as 0.72˚ or as large as 90˚. The motor speed is
measured in steps per second.

Steps per second = (Revolution per minute x steps per


Revolution)/ 60

Stepping motors have the extraordinary ability to operate at very high


speeds (up to 20,000 steps per second ) and yet to remain fully in

47
synchronism with the command pulses, when the pulse rate is high ,the
shaft rotation seems continuous.

If the stepping rate is increased too quickly, the motor loses


synchronism and stops. Stepper motors are designed to operate for
long periods with the rotor held in a fixed position and with rated
current flowing in the stator windings whereas for most of the other
motors, this results in collapse of back emf and a very high current
which can lead to a quick burn out.

A stepper motor is a special kind of motor that moves in individual


steps which are usually 0.9 degrees each. Each step is controlled by
energizing coils inside the motor causing the shaft to move to the next
position. Turning these coils on and off in sequence will cause the
motor to rotate forward or reverse. The time delay between each step
determines the motor's speed. Steppers can be moved to any desired
position reliably by sending them the proper number of step pulses.

Fig 5.4.2 Stepper mo

48
A stepper motor's shaft has permanent magnets attached to it.
Around the body of the motor is a series of coils that create a magnetic
field that interacts with the permanent magnets. When these coils are
turned on and off, the magnetic field causes the rotor to move. As the
coils are turned on and off in sequence the motor will rotate forward or
reverse.

49
CHAPTER 6
PROJECT DESCRIPTION

50
PROJECT DESCRIPTION

Our aim is to design flexible and economical system. In this


system whenever the infrared sensor senses the obstacle and the signal
is sent to the microcontroller. Then the microcontroller sent the signal
to the stepper motor as in which the door is opened

In this particular application "EMBEDDED SYSTEM FOR


AUTO DOOR OPENING". When there is no obstacle, the TSOP
receive no signal and their output is high which is connected to port 1.
When there is an obstacle the signal gets reflected and TSOP receives
that and its output goes low. If the door is intact, there will be proper
transmission and reception between the IR transmitter and IR receiver
and the output of the IR receiver will be logic high.

Whenever the door is opened, the link between the IR


transmitter and IR receiver is obstructed and the IR sensor detects the
obstacle. The output of the IR receiver will go to logic low now. The
output of the IR receiver is connected to the P1.0 of the
microcontroller. Thus the microcontroller will be constantly
monitoring the output of the receiver.

FEATURES OF THE SECURITY SYSTEM

Built-in motion sensors can trigger alarms.

• The IR transmitter and receiver have an automated generation


of the 38 kHz carrier signal.
• 8 bit microcontroller called the AT89C51 from Atmel
corporation, has on chip ROM in the of flash memory.
• This system when senses the signal it turns the buzzer on and
dials the number directly

51
• Your local phone can be used for normal use by using a DPDT
switch. So you need not use a separate telephone line for this
device controlling.
• There is no risk of false switching.

52
CHAPTER 7
FLOWCHART

53
FLOWCHART

#include<reg51.h>

sbit ir=P2^0;

sbit buzzer=P0^7;

stepper();

delay(unsigned int);

unsigned char i;

unsigned int z,s;

main()

buzzer=0;

while(1)

if(ir==0)

buzzer=1;

stepper();

buzzer=0;

54
else

buzzer=0;

stepper()

for(s=0;s<14;s++)

for(z=0x01;z<0x0a;z=z*2)

P3=z;

delay(5);

for(s=0;s<14;s++)

55
for(z=0x08;z>0x00;z=z/2)

P3=z;

delay(5);

delay(unsigned int time)

unsigned int i,j;

for(i=0;i<time;i++)

for(j=0;j<1275;j++);

56
CHAPTER 8
RESULTS AND CONCLUSION

57
RESULTS

Fig8.1 The project kit photo

The above picture is the photo of the project kit that we created for our
project. It displays a model of an automatic door opening system
using IR sensors. It picturizes the following parts namely: power
supply, sensors, microcontroller board, driving circuit and the stepper
motor.

58
CONCLUSION

As this world is readily growing up for Era of automation


and global communication this concept of providing security remotely
regardless of load at which the device operates and the function s they
perform, will surly fuel the scope of technology. This concept can
definitely serve as a platform for new innovations and help us get
better with time.

We have presented a method for constructing and


modifying complex autonomous security model while accomplishing
the following goals:

• Provide a means to interface security models with any other


model.
• Provide an intuitive facility to modify models.
The main aim of this project is to detect an intrusion in the
premises of a building door opens. This system finds applications
in industries, banks and homes.

ADVANTAGES

 The system is completely automatic and requires no human


supervision to carry out the necessary actions.
 The main advantage of this system is it is economical and
reliable.
 The system is best for guiding the perimeter of a house or a
business center the point s where an intruder would enter
the building

59
References:

1. Lee Reuben: “ Electronic Transformers and


circuits”,John Wiley & sons, Inc.,New York,1947

2. Glasoe,G.N,and J.V .Lebacqz:” Pulse Generators,”


Massachusetts Institute of technology radiation
Laboratory series ,vol 5, Mc Graw –hill Book
Company,New York,1948

3. Jacob Millman and Herbert Taub:”Pulse , digital and


switching waveforms” second edition, Mc Graw –hill
Book Company,New York,2000.

4. J.Millman and C.C Halkais ,”Integrated Electronics”,


Mc Graw –hill,first edition,1972.

5. Theodore F.Bogart jr.,J.s.Beasley and G.Rico,


“Electronic Devices and Circuits ”,Pearson
Education,sixth edition,2004

6. T.K.Nagasarkar and M.S.Sukhija,”Basic Electrical


Engineering”,Oxford University press,2006.

7. A.K.Ray and K.M.Bhurchandi,”Advanced


microprocessor and peripherials”,TMH,2000.

60
8. Raj Kamal,”Microcontrollers
Architecture,programming ,Interfacing and system
Design,pearson edition, 2005

9. www.knowledgebase.com

10. www.alldatasheets.com

11. www. Howsstuffworks.com

12.Datasheets of Microcontroller AT89C52

13.Datasheets of 555 timer

14.Datasheets of TSOP 1356

61
APPENDIX

62
SOURCE CODE

ORG 000H

MOV P1,#0FFH

HERE:JB P1.0,HERE

MOV P2,#11H

CALL DELAY

MOV P2,#22H

CALL DELAY

MOV P2,#44H

CALL DELAY

MOV P2,#88H

CALL DELAY

MOV P2,#00H

CALL DELAY

CALL DELAY

63
CALL DELAY

CALL DELAY

MOV P2,#88H

CALL DELAY

MOV P2,#44H

CALL DELAY

MOV P2,#22H

CALL DELAY

MOV P2,#11H

CALL DELAY

SJMP HERE

DELAY:

MOV R1,#255

HERE1: DJNZ R1, HERE1

RET

END

64