PRACTICAL TRAINING REPORT
AUTOMATIC DOOR WITH
Amity School of Engineering &Technology
AMITY UNIVERSITY RAJASTHAN
This is to certify that Indira Kundu, student of B.Tech. in Electronics and
Communication Engineeringhas carried out the work presented in the project of the
Training entitled “AUTOMATIC DOOR WITH VISITOR COUNTER” as a part of
third year programme of Bachelor of Technology in of B.Tech. in Electronics and
Communication Engineering from Amity School of Engineering and Technology,
Amity University Rajasthan, under my supervision.
It has come out to be a sort of great pleasure and experience for me to work on the
project “Automatic Door with Visitor Counter”. I wish to express my indebtedness to
those who helped us i.e. the faculty of our Institute Mr. Achyut Sharmaduring the
preparation of the manual script of this text. This would not have been made successful
without his help and precious suggestions. Finally, I also warmly thank all my
colleagues who encouraged us to an extent, which made the project successful.
TABLE OF CONTENTS
1. INTRODUCTION TO EMBEDDED SYSTEMS ……………………………5
2. INTRODUCTION TO THE PROJECT-“AUTOMATIC DOOR WITH
3. HARDWARE DESCRIPTION ………………………………………………..8
4. WORKING OF THE PROJECT....…………………………………………...26
5. SOFTWARE DESCRIPTION…………………………………………………27
1.INTRODUCTION TO EMBEDDED SYSTEMS
A precise definition of embedded systems is not easy. Simply stated, all computing
systems other than general purpose computer (with monitor, keyboard, etc.) are
System is a way of working, organizing or performing one or many tasks according to
a fixed set of rules, program or plan. In other words, an arrangement in which all
units assemble and work together according to a program or plan. An embedded
system is a system that has software embedded into hardware, which makes a system
dedicated for an application (s) or specific part of an application or product or part of
a larger system. It processes a fixed set of pre-programmed instructions to control
electromechanical equipment which may be part of an even larger system.
A general-purpose definition of embedded systems is that they are devices used to
control, monitor or assist the operation of equipment, machinery or plant.
“Embedded” reflects the fact that they are an integral part of the system.
An embedded system is an engineering artefact involving computation that is subject
to physical constraints (reaction constraints and execution constraints) arising through
interactions of computational processes with the physical world. Reaction constraints
originate from the behavioural requirements & specify deadlines, throughput, and
jitter whereas execution constraints originate from the implementation requirements
& put bounds on available processor speeds, power, memory and hardware failure
rates. The key to embedded systems design is to obtain desired functionality under
both kinds of constraints.
1.1 CHARACTERISTICS OF EMBEDDED SYSTEMS:
a) Embedded systems are application specific & single functioned; application is
known apriori, the programs are executed repeatedly.
b) Efficiency is of paramount importance for embedded systems. They are optimized
for energy, code size, execution time, weight & dimensions, and cost.
c) Embedded systems are typically designed to meet real time constraints; a real time
system reacts to stimuli from the controlled object/ operator within the time interval
dictated by the environment. For real time systems, right answers arriving too late (or
even too early) are wrong.
d) Embedded systems often interact (sense, manipulate & communicate) with
external world through sensors and actuators and hence are typically reactive
systems; a reactive system is in continual interaction with the environment and
executes at a pace determined by that environment.
e) They generally have minimal or no user interface.
1.2 PROCESSORS IN EMBEDDED SYSTEMS:
Embedded systems contain processing cores. A processor is an important unit in the
embedded system hardware. It is the heart of the embedded system. Embedded
processors can be broken into two broad categories:
a) Ordinary microprocessors (μP) use separate integrated circuits for memory and
b) Microcontrollers (μC) have many more peripherals on chip, reducing power
consumption, size and cost.
In contrast to the personal computer market, many different basic CPU
architectures are used, since software is custom-developed for an application and is
not a commodity product installed by the end user.
2.INTRODUCTION TO THE PROJECT-“AUTOMATIC
DOOR WITH VISITOR COUNTER”
Automatic doors are doors which open automatically when approached by someone,
rather than needing to be opened manually with a door handle or bar.
Advantages of automatic door:
1. For people in wheelchairs and other disabled individuals, automatic doors are
an immense boon, since conventional doors can be very hard to work with. It
may be impossible to open a conventional door while seated in a wheelchair
or navigating with crutches.
2. In hospitals and scientific labs, automatic doors can be used to secure an area
by ensuring that the doors are shut at all times, while reducing the risk of
cross-contamination since people do not need to handle the doors to pass
3. Automatic doors can also be useful in warehouses and other facilities where
people frequently have their hands full, contributing to safety and efficiency
by making it easier for people to get around.
4. It reduces human labour and prevents the situation of inconvenience.
This project is a standalone “Automatic Door with Visitor Counter”. The main aim of
the project is to control the opening and closure of the door in a room, count the
number of persons inside the room, switch ON the light if anyone is present and
switch OFF the light if no one is there. Use of embedded technology makes this
closed loop feedback control system efficient and reliable.
The system comprises of an IR Transmitter-Receiver pair which is located in front
and at the back of the door and outside the room. Initially the light is switched off in
the room. Whenever a person tries to enter into the room, the receiver of IR pair identifies
the person. The microcontroller identifies this change and starts counting the people entering
into the room. The Seven segment displays the number of persons present in the room.
3. HARDWARE DESCRIPTION:
3.1 COMPONENTS LIST:
1. Transformer : Step down transformer (220/12)
2. Voltage Regulator : IC 7805
3. Op-amp : LM358
4. Crystal oscillator : 11.0592 MHz
6. Resistor : 470 ohm (for LED) , 8.2 K (for power on reset Circuit. ), 10 K (for
sensors) , potentiometer(100K)
7. Capacitor : 1000 u f (for Power supply),10 u f ( reset ckt.),33p F( for crystal
8. Infra-Red sensors
9. Seven Segment decoder
12. Simple D.C. Motor
13. Microcontroller: AT89C51
3.2 COMPONENT DESCRIPTION
STEP DOWN TRANSFORMER
Power supply is a reference to a source of electrical power. A device or system that
supplies electrical or other types of energy to an output load or group of loads is
called a powersupply unit or PSU. The term is most commonly applied to electrical
energy supplies, less often to mechanical ones, and rarely to others.
Here in our application we need a 5V and 12V DC power supply for allelectronics
involved in the project. This requires step down transformer, rectifier, voltage
regulator, and filter circuit for generation of 5V DC power.
VOLTAGE REGULATOR IC 7805
This is most common voltage regulator that is still used in embedded designs.
LM7805 voltage regulator is a linear regulator made by several manufacturers like
Fairchild, or ST Microelectronics.
The LM7805 monolithic 3-terminal positive voltage regulator employ internal currentlimiting, thermal shutdown and safe-area compensation, making them essentially
indestructible. If adequate heat sinking is provided, they can deliver over 1.0A output current.
They can come in several types of packages. For output current up to 1A there may be two
types of packages: TO-220 (vertical) and D-PAK (horizontal).
FIG-3.1 7805 PACKAGES
(courtesy: Google Images)
An operational amplifier("op-amp") is a DC-coupled high-gain electronic voltage
amplifier with a differential input and, usually, a single-ended output. An op-amp
produces an output voltage that is typically hundreds of thousands times larger than
the voltage difference between its input terminals.
Operational amplifiers are important building blocks for a wide range of electronic
circuits. They had their origins in analog computers where they were used in many
linear, non-linear and frequency-dependent circuits. Their popularity in circuit design
largely stems from the fact that characteristics of the final op-amp circuits with
negative feedback (such as their gain) are set by external components with little
dependence on temperature changes and manufacturing variations in the op-amp
Op-amps are among the most widely used electronic devices today, being used in a
vast array of consumer, industrial, and scientific devices. Many standard IC op-amps
cost only a few cents in moderate production volume; however some integrated or
hybrid operational amplifiers with special performance specifications may cost over
$100 US in small quantities. Op-amps may be packaged as components, or used as
elements of more complex integrated circuits.
The op-amp is one type of differential amplifier. Other types of differential amplifier
include the fully differential amplifier (similar to the op-amp, but with two outputs),
the instrumentation amplifier (usually built from three op-amps), the isolation
amplifier (similar to the instrumentation amplifier, but with tolerance to commonmode voltages that would destroy an ordinary op-amp), and negative feedback
amplifier (usually built from one or more op-amps and a resistive feedback network).
FIG-3.2 CIRCUIT NOTATION OF OP-AMP
In this project since we require to use two IR sensors hence we are using LM358 IC.
The LM358 consists of two independent, high gain, internally frequency compensated
operational amplifiers which were designed specifically to operate from a single
power supply over a wide range of voltages. Operation from split power supplies is
also possible and the low power supply current drain is independent of the magnitude
of the power supply voltage.
FIG 3.3 PIN DIAGRAM OF LM358
(Courtesy: Google Images)
A crystal oscillator is an electronic oscillator circuit that uses the mechanical
resonance of a vibrating crystal of piezoelectric material to create an electrical signal
with a very precise frequency. This frequency is commonly used to keep track of time
(as in quartz wristwatches), to provide a stable clock signal for digital integrated
circuits, and to stabilize frequencies for radio transmitters and receivers. The most
common type of piezoelectric resonator used is the quartz crystal, so oscillator
circuits designed around them became known as "crystal oscillators."
IMAGE OF CRYSTAL FIG 3.4(b) SYMBOL OF OSCILLATOR
OSCILLATOR(Courtesy: Google Images)
A light-emitting diode (LED) is a semiconductor device that emits visible light when
an electric current passes through it. The light is not particularly bright, but in most
LEDs it is monochromatic, occurring at a single wavelength. The output from an
LED can range from red (at a wavelength of approximately 700 nanometers) to blueviolet (about 400 nanometers). Some LEDs emit infrared (IR) energy (830
nanometers or longer); such a device is known as an infrared-emitting diode (IRED).
An LED or IRED consists of two elements of processed material called P-type
semiconductors and N-type semiconductors. These two elements are placed in direct
contact, forming a region called the P-N junction.
A resistor is an electrical component that limits or regulates the flow of electrical
current in an electronic circuit. Resistors can also be used to provide a specific
voltage for an active device such as a transistor. All other factors being equal, in a
direct-current (DC) circuit, the current through a resistor is inversely proportional to
its resistance, and directly proportional to the voltage across it. This is the wellknown
Ohm's Law. In alternating-current (AC) circuits, this rule also applies as long as the
resistor does not contain inductance or capacitance.
A capacitor is a tool consisting of two conductive plates, each of which hosts an
opposite charge. These plates are separated by a dielectric or other form of insulator,
which helps them maintain an electric charge.
FIG-3.5(a) ELECTROLYTIC CAPACITOR
An electrolytic capacitor is a capacitor that uses an electrolyte (an ionic conducting
liquid) as one of its plates to achieve a larger capacitance per unit volume than other
types. The large capacitance of electrolytic capacitors makes them particularly
suitable for passing or bypassing low-frequency signals and storing large amounts of
energy. They are widely used in power supplies and for decoupling unwanted AC
components from DC power connections.
FIG- 3.5(b) UNPOLARISED / CERAMIC CAPACITORS
A non-polarized capacitor is a type of capacitor that has no implicit polarity-it can be
connected either way in a circuit. Ceramic capacitors are non-polarized.
INFRA RED SENSORS
FIG- 3.6: RECEIVER AND TRANSMITTER OF IR SENSORS
An infrared sensor is an electronic device that emits and/or detects infrared radiation
in order to sense some aspect of its surroundings. IR sensors can measure the heat of
an object, as well as detect motion.By using an LED which produces light at the same
wavelength as what the sensor is looking for, one can look at the intensity of the
received light. When an object is close to the sensor, the light from the LED bounces
off the object and into the light sensor. This results in a large jump in the intensity,
which we already know can be detected using a threshold.
Since the sensor works by looking for reflected light, it is possible to have a sensor
that can return the value of the reflected light. This type of sensor can then be used to
measure how "bright" the object is. This is useful for tasks like line tracking.
SEVEN SEGMENT DISPLAY
A seven segment display is the most basic electronic display device that can display
digits from 0-9. They find wide application in devices that display numeric
information like digital clocks, radio, microwave ovens, electronic meters etc. The
most common configuration has an array of eight LEDs arranged in a special pattern
to display these digits. They are laid out as a squared-off figure „8‟. Every LED is
assigned a name from 'a' to 'h' and is identified by its name. Seven LEDs 'a' to 'g' are
used to display the numerals while eighth LED 'h' is used to display the dot/decimal.
FIG- 3.7 SEVEN SEGMENT DISPLAY
A seven segment is generally available in ten pin package. While eight pins
correspond to the eight LEDs, the remaining two pins (at middle) are common and
internally shorted. These segments come in two configurations, namely, Common
cathode (CC) and Common anode (CA). In CC configuration, the negative terminals
of all LEDs are connected to the common pins. The common is connected to ground
and a particular LED glows when its corresponding pin is given high. In CA
arrangement, the common pin is given a high logic and the LED pins are given low to
display a number.
The 4511 is a BCD to 7-segment decoder driver. Its function is to convert the logic
states at the outputs of a BCD into signals which will drive a 7-segment display. The
display shows the decimal numbers 0-9 and is easily understood. The 4511 is
designed to drive a common cathode display and won't work with a common anode
display. In normal operation, the lamp test and ripple blanking inputs are connected
HIGH, and the enable (store) input is connected LOW.
When the 4511 is set up correctly, the outputs follow this truth table:
FIG- 3.8 PIN DIAGRAM OF IC 7511
The Device is a monolithic integrated high voltage, high current four channel driver
designed to accept standard DTL or TTL logic levels and drive inductive loads (such
as relays solenoides, DC and stepper motors) and switching power transistors.
To simplify use as two bridges each pair of channels it is equipped with an enable
input. A separate supply input is provided for the logic, allowing operation at a lower
voltage and internal clamp diodes are included.This device is suitable for use in
switching applications at frequencies up to 5kHz.The L293D is assembled in a 16
lead plastic package which has 4 center pins connected together and used for heatsinking.
Main features of this IC are:
600mA output current capability per channel.
1.2A peak output current(non-repetitive) per channel
Logical “0” input voltage up to 1.5 V(high noise immunity)
Internal Clamp Diodes
FIG 3.9:PIN DIAGRAM OF L293D
(Courtesy: Google Images)
It works on the concept of H-bridge. H-bridge is a circuit which allows the voltage to
be flown in either direction. As you know voltage need to change its direction for
being able to rotate the motor in clockwise or anticlockwise direction, Hence Hbridge IC are ideal for driving a DC motor.
In a single l293d chip there two h-Bridge circuit inside the IC which can rotate two dc
motor independently. Due its size it is very much used in robotic application for
controlling DC motors.
There are two Enable pins on l293d. Pin 1 and pin 9, for being able to drive the
motor, the pin 1 and 9 need to be high. For driving the motor with left H-bridge we
need to enable pin 1 to high. And for right H-Bridge we need to make the pin 9 to
high. If anyone of the either pin1 or pin9 goes low then the motor in the
FIG-3.10: H-BRIDGE DIAGRAM
3.2.12 SIMPLE DC MOTOR
A DC motor is a mechanically commutated electric motor powered from direct
current (DC). The stator is stationary in space by definition and therefore the current
in the rotor is switched by thecommutator to also be stationary in space. This is how
the relative angle between the stator and rotor magnetic flux is maintained near 90
degrees, which generates the maximum torque.
DC motors have a rotating armature winding (winding in which a voltage is induced)
but non-rotating armature magnetic field and a static field winding (winding that
produce the main magnetic flux) or permanent magnet. Different connections of the
field and armature winding provide different inherent speed/torque regulation
This DC works on the principal, when a current carrying conductor is placed in a
magnetic field, it experiences a torque and has a tendency to move. This is known as
motoring action. If the direction of electric current in the wire is reversed, the
direction of rotation also reverses. When magnetic field and electric field interact they
produce a mechanical force, and based on that the working principle of dc motor
FIG-3.10: FLEMING’S LEFT HAND RULE
The direction of rotation of a this motor is given by Fleming‟s left hand rule, which
states that if the index finger, middle finger and thumb of your left hand are extended
mutually perpendicular to each other and if the index finger represents the direction
of magnetic field, middle finger indicates the direction of electric current, then the
thumb represents the direction in which force is experienced by the shaft of the dc
In this project we will use a motor of low rpm because we just require it to represent
an opening or closing of door.
• 4K Bytes of In-System Reprogrammable Flash Memory
– Endurance: 1,000 Write/Erase Cycles
• Fully Static Operation: 0 Hz to 24 MHz
• 128 x 8-bit Internal RAM
• 32 Programmable I/O Lines
• Two 16-bit Timer/Counters
• Six Interrupt Sources
• Programmable Serial Channel
The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with
4Kbytes of Flash programmable and erasable read only memory (PEROM). The
deviceis manufactured using Atmel‟s high-density nonvolatile memory technology.
The on-chip flash allows the program memory to be reprogrammed in-system or by a
conventionalnonvolatile memory programmer. By combining a versatile 8-bit CPU
with Flashon a monolithic chip, the Atmel AT89C51 is a powerful microcomputer
which providesa highly-flexible and cost-effective solution to many embedded
FIG-3.11: PIN DIAGRAM OF AT89C51
(Courtesy: Google Images)
PIN 9: PIN 9 is the reset pin which is used reset the microcontroller‟s internal
registers and ports upon starting up. A high on this pin for two machine cycles while
the oscillator is running resets the device.
PINS 18 & 19: The 8051 has a built-in oscillator amplifier hence we need to only
connect a crystal at these pins to provide clock pulses to the circuit.
PIN 40 and 20: Pins 40 and 20 are VCC and ground respectively. The 8051 chip
needs +5V 500mA to function properly, although there are lower powered versions
like the Atmel 2051 which is a scaled down version of the 8051 which runs on +3V.
PINS 29, 30 & 31: As described in the features of the 8051, this chip contains a builtin flash memory. In order to program this we need to supply a voltage of +12V at pin
31. If external memory is connected then PIN 31, also called EA/VPP, should be
connected to ground to indicate the presence of external memory. PIN 30 is called
ALE (address latch enable), which is used when multiple memory chips are
connected to the controller and only one of them needs to be selected.PIN 29 is called
PSEN. This is "program store enable". In order to use the external memory it is
required to provide the low voltage (0) on both PSEN and EA pins.
There are 4 8-bit ports: P0, P1, P2 and P3.
PORT P1 (Pins 1 to 8): Port 1 is an 8-bit bi-directional 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 P2 (pins 21 to 28): Port 2 is an 8-bit bi-directional 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 can also be used as a general purpose 8 bit port when no external memory is
present, but if external memory access is required then Port 2 will act as an address
bus in conjunction with PORT P0 to access external memory. Port 2 acts as A8-A15.
PORT P3 (pins 10-17): Port 3 is an 8-bit bi-directional 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
P3.0- RXD (serial input port)
P3.1 -TXD (serial output port)
P3.2 - INT0 (external interrupt 0)
P3.3 - INT1 (external interrupt 1)
P3.4 -T0 (timer 0 external input)
P3.5 - T1 (timer 1 external input)
P3.6 - WR (external data memory write strobe)
P3.7 - RD (external data memory read strobe)
PORT P0 (pins 32 to 39): Port 0 is an 8-bit open-drain bi-directional 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 high impedance inputs.
PORT P0 can be used as a general purpose 8 bit port when no external memory is
present, but if external memory access is required then PORT P0 acts as a
multiplexed address and data bus that can be used to access external memory in
conjunction with PORT P2. P0 acts as AD0-AD7.
4.WORKING OF THE PROJECT:
The microcontroller unit continuously checks for the arrival of any person
from outside by using the Op-Amp based sensors located at door.
As soon as the value at the sensor port becomes “1” or high, the DC motor
(here, it represents the door rotates first clockwise (opening of the door) and remains
in the same state for few seconds so that the person may enter the room and then it
rotates anticlockwise (closing of the door). After this the value of the seven segment
display is incremented by 1.
Similarly, if a person inside wants to go out, then the Op-Amp based IR
sensors detects that a person is standing in front of the door, inside the room. The
value at the inside sensor port goes high, the DC motor then first rotates clockwise
(opening of the door) and remains in the same state for few seconds so that the person
may leave the room and then it rotates anticlockwise (closing of the door).After this
the value of the seven segment is decremented by 1.
The value of the seven segment display at any instant corresponds to the
number of persons inside the room. It acts as a counter here.
5.1 C CODE
void motor(int,int,unsigned int);
unsigned int i;
void delay(unsigned int d)
if(P1_0==1 && P1_1==0)
void motor(int a, int b,unsigned int c)
5.2 SOFTWARE USED:
Keil μVision4 Software used for writing the code and generating the hex file.
Programmers of all levels can use them to get the most out of the embedded
microcontroller architectures that are supported. Tools developed by Keil endorse the
most popular microcontrollers and are distributed in several packages and
configurations, dependent on the architecture.
. septiembre-2001. www.atmel.com
. The 8051 MicrocontrollerandEmbedded Systems Using AssemblyandC
ByMuhammad Ali Mazidi,JaniceGillispie Mazidi &Rolin D.McKinlay
. AtmelCorp.Makers of the AVRmicrocontroller
. www.electronic projects.com
. EMBEDDED SYSTEM BY RAJ KAMAL