70 125 1 PB1
70 125 1 PB1
70 125 1 PB1
net/publication/261672348
CITATIONS READS
0 25,638
1 author:
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Diarah Samuel Reuben on 17 April 2014.
1
Electrical and Information Engineering, College of Science and Engineering/ Landmark University
Omu-Aran, Nigeria
2
Electrical and Information Engineering, College of Science and Engineering/ Landmark University
Omu-Aran, Nigeria
3
Electrical and Information Engineering, College of Sc ience and Engineering/ Landmark University
Omu-Aran, Nigeria
Email-diarah.samuel@lmu.edu.ng, egbune.dickson@lmu.edu.ng, adedayo.banji@lmu.edu.ng
ABSTRACT:
The implementation of a Microcontroller based automatic door control with visitor counter will lead to vast
improvement on electronic security designs. Nevertheless, for a system with large volume of movement with
little or no security consciousness, a door system to fit the system without unnecessary delay in the free flow
of movement usually tends to pose a problem. Usually, in this kind of scenario, an automatic door system
with a means of detecting incoming traffic so as to open the door as required, thus the design and
operational principles of a microcontroller based automatic door with visitor counter. The design is made of
sensors that detect human presence, a dynamic display unit that displays different messages at specific time,
the H-bridge driver IC controls the movement of the motor attached to the door. The whole system is
controlled by an 8051microcontroller (89s51).
Keywords: Microcontroller, H-bridge driver IC, Sensor, Program, Remote.
INTRODUCTION
Microcontroller based automatic door control with visitor counter was designed to automatically open a door
once somebody approaches the door without the need for any switch, button or handle. The system also has
a module that serves as visitor counter and as such, counts the number of entries in and out of the building.
In this design, the door is made to slide open once the sensor picks up a signal implying that somebody is
approaching the door. The door stays open for few minutes while the microcontroller checks the condition
of the sensor. If the sensor still senses the presence of somebody, the door stays open. Else, the door closes
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 532
while waiting for the next time to open. The design is with multi- message display using seven segment
displays.
In this design we have implored the use of both hardware and software to bring about the entire project. The
hardware components are solely coordinated by the AT89S51 micro controller chip while the C
programming language is used to program the chip.
The application of this Research work covers all works of life. Some of the applications of this project are in
cinema halls where the number of people going in is much and as such this system responds to that by
opening automatically as well as keeping count of the number of people in and out of the door.
Furthermore, if this design is applied to busy hotels or fast food joints, the need for a waiter or a security
personal to constantly open the door for customer is solved since the system is intelligent.
Moreover, this design perfectly suits a garage system; In this case, the garage door opens once a car
approaches the door of the garage.
This consists of a sensor unit that senses people approaching the door [1]. Through the output of the sensor,
the microcontroller determines when to send the necessary logic to the H-bridge driver so as to control the
motor for the door. Also the counter is incremented once the sensor receives signal but unlike the door
routine that keeps the door open once somebody stands by the sensor, the counter routine does not continue
counting if the sensor is continuously receiving signal like the door.
The use of electronic door became popular just in the 18 th century. Electronic doors usually comprises of
either electric motors or roller instead of hinges which are applicable to manual doors.
Basically the different types of electronic doors are determined by how the electric motors are activated and
controlled.
Some of the types of electronic doors include the following:
Button pressed door: this is the earliest form of electronic door and has little or no security details.
In this type of electronic door, the door is opened using a button that acts as a switch. Usually this type of
door is usually locked by default and by pressing the button; the motor of the door is activated, thus
opening the door.
Code based electronic door: this type of door is more advanced than the button pressed door lock. In
this case, the door is locked by default and usually requires an access code for the lock to be deactivated.
Once the correct code is entered, the electric motor is activated, hence opening the door.
Key card based lock: this type of door is more advanced than the button pressed door lock. In this
case, the door is locked by default and usually requires an access card to unlock the door. It is similar to
code based lock. The difference is that the unlocking code is embedded unto a card.
Thumb print lock: this is a highly advanced form of door locking system based on the uniqueness of
the human thumb print. Here once the thumb is placed on the scanner, it checks whether the thumb print
has access to the lock. If the scanned thumb has access, the electric motor controlling the door.
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 533
Retina scan based lock: this type of locking system is similar to the thumb print lock but this focuses
on the uniqueness of the human retina.
Sensor based door: this is a type of electronic door system in which the door is manipulated based on
the output of a sensor.
Component Description/Analysis
Step-Down Transforme r
A transformer is a device consisting of two closely coupled coils (called primary and secondary coils). An
AC voltage applied to the primary appears across the secondary with a voltage multiplication propor tional to
the turn ratio of the transformer and a current multiplication inversely proportional to the turn’s ratio. Power
is conserved i.e.
Turn ratio =Vp/Vs =Np/Ns and Power out = power in
Or Vs x Is= Vp x Ip
Vp = Primary voltage
Np= Number of turns in primary coil
Ip = Primary (input) current
Vs=Secondary (output) Voltage
Ns= Number of turns on secondary Coil.
For the 12 volts step down transformer needed for this project, the turn ratio is 220/12. It is represented
as shown below.
Diodes
The term diode usually implies a small signal device with current typically in the milliamp range. A
semiconductor diode consists of a PN junction and has two (2) terminals, an anode (+) and a cathode (-).
Current flows from anode to cathode within the diode.
Diodes are semiconductor devices that might be described as passing current in one d irection only.
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 534
Bridge rectifier
A bridge rectifier can be made using four individual diodes, but it is a lso available in special packages
containing the four diodes required. It is called a full-wave rectifier because it uses all the AC wave (both
positive and negative sections). 1.4V is used up in the bridge rectifier because each diode uses 0.7V when
conducting and there are always two diodes conducting, The maximum current they can pass rates bridge
rectifiers and the maximum reverse voltage they can withstand (this must be at least three times the supply
RMS voltage so the rectifier can withstand the peak voltages).
Alternate pairs of diodes conduct, changing over the connections so the alternating directions of AC are
converted to the one direction of DC
Voltage Regulators
A Voltage Regulator (also called a "regulator") has only three legs and appears to be a comparatively simple
device but it is actually a very complex integrated circuit. A regulator converts varying input voltage and
produces a constant "regulated" output voltage. Voltage regulators are available in a variety of outputs,
typically 5 volts, 9 volts and 12 volts. The last two digits in the name indicate the output voltage in the table
below.
Table (1) Voltage Regulators output Voltages
Name Voltage
LM7805 + 5 volts
LM7809 + 9 volts
LM7812 + 12 volts
LM7905 - 5 volts
LM7909 - 9 volts
LM7912 - 12 volts
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 535
Figure (2) Diagram of 7805
Resistors
Resistance is the property of a component which restricts the flow of electric current. Energy is used up as
the voltage across the component drives the current through it and this energy appears as heat in the
component.
Resistance is measured in ohms, the symbol for ohm is an omega .
1 is quite small for electronics so resistances are often given in k and M .
1k = 1000 1M = 1000000 .
Resistors used in electronics can have resistances as low as 0.1 or as high as 10 M .
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 536
Types of Transistor
There are two types of standard transistors, NPN and PNP, with different circuit symbols. The letters refer to
the layers of semiconductor material used to make the transistor. Most transistors used today are NPN
because this is the easiest type to make from silicon. This page is mostly about NPN transistors.
The leads are labeled base (B), collector (C) and emitter (E).
The base-emitter junction behaves like a diode. A base current I B flows only when the voltage VBE across
the base-emitter junction is 0.7V or more. The small base current I B controls the large collector current Ic.
Ic = hFE × IB (unless the transistor is full on and saturated) hFE is the current gain (strictly the DC current
gain), a typical value for hFE is 100 (it has no units because it is a ratio) The base current IB controls t he
collector-emitter resistance RCE:
IB = 0 RCE = infinity transistor off
IB small RCE reduced transistor partly on
IB increased RCE = 0 transistor full on ('saturated')
Additional notes:
A resistor is often needed in series with the base connection to limit the base current IB and prevent the
transistor being damaged. Transistors have a maximum collector current Ic rating. The current gain hFE can
vary widely, even for transistors of the same type!
A transistor that is full on (with RCE = 0) is said to be 'saturated'. When a transistor is saturated the
collector-emitter voltage VCE is reduced to almost 0V. When a transistor is saturated the collector current Ic
is determined by the supply voltage and the external resistance in the collector circuit, not by the transistor's
current gain. As a result the ratio Ic/I B for a saturated transistor is less than the current gain hFE.
The emitter current IE = Ic + IB, but Ic is much larger than IB, so roughly IE = Ic.
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 537
Light Dependent Resistor (LDR)
LDRs or Light Dependent Resistors are very useful especially in light/dark sensor circuits. Normally the
resistance of an LDR is very high, sometimes as high as 1000 000 ohms, but when they are illuminated with
light resistance drops dramatically.
Hardware subsystem
The project is made up of five modules namely:
1. Sensor unit
2. Display unit
3. Control unit
4. Power supply unit
5. door control unit
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 538
Regulator: eliminates ripple by setting DC output to a fixed voltage.
Power supplies made from these blocks are described below with a circuit diagram and a graph of their
output:
Transformer only
Transformer + Rectifier
Transformer + Rectifier + Smoothing
Transformer + Rectifier + Smoothing + Regulator
Transformer Only:
The low voltage AC output is suitable for lamps, heaters and specia l AC motors. It is not suitable for
electronic circuits unless they include a rectifier and a smoothing capacitor.
Transformer + Rectifier
The varying DC output is suitable for lamps, heaters and standard motors. It is not suitable for electronic
circuits unless they include a smoothing capacitor.
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 539
Figure (8) Transformer + Rectifier + Capacitor
The smooth DC output has a small ripple. It is suitable for most electronic circuits.
The regulated DC output is very smooth with no ripple. It is suitable for all electronic circuits.
DISPLAY UNIT:
The display unit consists of two sets of seven-segment displays attached to the port of the microcontroller
and LEDs for User interface [3]. These seven-segment display arrangement shows the three different
messages “CLOSED” when the door is shut, “OPEN” when the door is opening and “ENTER” the door has
fully opened. The display unit also shows the count of people at any particular point in time.
The seven-segment display used in the design is common Anode which is a type of seven-segment in which
the anodes of all the individual segments are linked together. Therefore for any of the segments to be
lighted, OV is supplied to its cathode.
The choice of common Anode seven-segment display in my design because the microcontroller sinks TTL
logic better than sourcing it. The segments of the display are connected to port O of the microcontroller and
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 540
the display is made to display any figure or character by sending the corresponding hexadecimal value to
port O.
Table (2) Common anode seven segment display Number pattern
NUM G F E D C B A Hex
0 1 0 0 0 0 0 0 0x40
1 1 1 1 1 0 0 1 0x79
2 0 1 0 0 1 0 0 0x24
3 0 1 1 0 0 0 0 0x30
4 0 0 1 1 0 0 1 0x19
5 0 1 1 0 0 1 0 0x12
6 0 0 0 0 0 1 0 0x02
7 0 1 1 1 0 0 0 0x38
8 0 0 0 0 0 0 0 0x00
9 0 0 1 1 0 0 0 0x18
- 0 1 1 1 1 1 1 0x3f
Table (3) Common anode seven segment display character pattern
XTE G F E D C B A Hex
R
O 1 0 0 0 0 0 0 0x4
0
P 0 0 0 1 1 0 0 0x0c
E 0 0 0 0 1 1 0 0x0
6
N 1 0 0 1 0 0 0 0x4
8
C 1 0 0 0 1 1 0 0x4
6
L 1 0 0 0 1 1 1 0x4
7
S 0 0 1 0 0 1 0 0x1
2
T 0 0 0 0 1 1 1 0x0
7
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 541
All the anodes of the seven segment LEDs are internally connected together and brought out to Vcc, which
is connected to the emitter of the switching transistor (NPN C 945), and its collector is connected to the Vcc,
and its base is then connected to our terminal of 4.7K resistor which in turn is connected from the
microcontroller. So remaining terminal of the 2K resistor is connected to the VCC.
As the name indicates, it iss a forward-biased P-Njunction which emits visible light when energised. The
colour of the emitted light depends on the type of material used in producing the LED.
GaAs- Infrared radiation (invisible)
GaP- Red or green light
GaAsP- Red or yellow (amber) light
LEDs that emits blue light are also available but red is the most common. LEDs emit no light when
reverse biased.
LEDs are manufactured with domed lensses in order to lesssen the reabssorption problem ; they are always
encased in order to protect their delicate wires. Being made of semiconductor material, it is rugged and has
a life of more than 10,000 hours.
Since LEDs operate at voltage levels from 1.5v to 3.3v, they are highly compatible with solid state
circuitry [2].
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 542
Also, in common anode arrangement all anodes are internally connected and brought out to + Vcc through
an external current limiting, or pull- up resistor. A low voltage to any LED cathode turns it on [3]. As read
out, LED display offers two distinct advantages, which are as follows:
Allows digital designers maximum flexibility due to their sizes and shapes.
They are visible in subdued light.But the operation o f LED in bright light (outdoor displays) makes the
display to be washed off by direct sunlight (invisible). The diagram of the seven segment display and LEDs
are shown below.
Fig (10)a S EVEN S EGMENT DISPLAY Fig (10)b DIFFER ENT COLOURS OF LEDS
Fig (11) Inte rnal Circuitry Of The Two Types Seven Segment Display
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 543
The Input Inte rface Design
The input interface is a circuitry that enables the system to fetch signal (visitor presence) from the monitored
position. Its design is achieved by the use of Light Dependent Resistors (LDR), Light emitting Diode (LED),
Resistors and Transistors connected using Voltage Divide r principle. As shown in the figure below
Vin Vcc
R3
R
1
Input to port
R2
GND
GND
Most input transducers (sensors vary their resistance and usually voltage divider is used to convert this to a
varying voltage which is more useful. The voltage signal in this context is fed as an input into a NPN (C945)
transistor switch.
The value of the resistance R will determine the range of the output voltage. Using a multimeter to find the
minimum and thee maximum values of the sensor’s (LDR) resistance (Rmin*Rmax).
Rmax = 780k
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 544
Since the system is capable of monitoring four different positions, the above design was repeated four
times to serve as input to the parallel port status pins.
Analysis
Since LDR has large resistance when dark and a low resistance when brightly lit, thus if R2 is much larger
than R1,Vout is large because most of the voltage are across R2
Thus when intruder’s shadow is cast on the LDR , there is increase in the LDR’s resistance bringing about
increase base current Ib enough to drive the NPN transistor to saturation, this causes the collector current to
flow into the parallel port input.
Ic = Vcc/Rc
Microcontroller unit:
The AT89C51 is a low power, high performance cmos 8-bit microcomputer with 4Kbytes of flash
programmable and erasable read only memory (PEROM). The device is manufactured using Atmel`s high
density nonvolatile memory technology and is compatible with the industry standard MCS-51 instruction set
and pin out. The on-chip flash allows the program memory to be reprogrammed in system or by a
conventional nonvolatile memory programmer. By combining a 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 application.
The AT89C51 is designed with static logic for operation down to zero frequency and support two software
selectable power saving modes. The idle mode stops the CPU while allowing the RAM, timer/counters,
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 545
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
A B
Stop Low Low
Clockwise Low High
Anti-clockwise High Low
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 546
H-bridge
DESIGN PROCESS:
A micro-controller based project design process is characterized by the following;
Definition of task
Requirements
Factor that influence choice
In defining a task, every design comes from an idea or a problem that requires a solution. Questions may be
generated on what exactly that is required to be achieved and the feasibility of the ideas as regards to the
implementation.
If these questions are analyzed critically with tangible solutions to the problem, a development of this idea
into a reality is the next step.
Requirements for design process have to be considered once an idea has been established. The need to
determine whether or not the idea requires a PC or not, depending on the complexity of the c ircuitry, or
whether the circuits to be designed needs to make a complex decision or deal with complex data.
Comparing these factors with using IC’s (AND gates) which two inputs when high logic changes outputs.
Preferably, a micro-controller will be the best option based on the circuits to be designed with less hardware
connections and flexibility. Writing a program that performs a desired function accesses the ability of the
micro-controller. However, it came to our thought that among all the components used here the one that
consumes the highest power is the Light Emitting Diodes (LEDs), which need as much as 15-volt to glow
and draw as maximum as 2-ampere of current. As a result of this, we decided to use 15-volts, 2-ampere
rated transformer for this design. After the voltage is stepped down 15-volts using a transformer, a full wave
rectifier circuit was designed using four Diodes (IN4001). This value of Diodes is used here because from
the specification of voltage/Diode rectifying data book, this value is adequate for lower voltages, say 0-24
volt. The load current of the rectifier is given as follows;
Idc = 21m/3.1
When 1m = maximum current = 2 amp
Idc = load current which is in dc form after recification.
Hence idc = 2*3 / 3.14 =4/3.14, idc = 1.27 amps
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 547
Therefore 1.27amps is the maximum load current that can be drawn in the whole system. Also it is known
that after rectification, the same voltage (15-volts) continues to flow into the filter. As a result the load
voltages 15- volts
Thus Vdc = Load voltage = 15volts.
And Vdc = 21m*RL / 3.14
RL = Load resistance
RL = 47.13/4
RL = 11.78* 3.14 = 1.78
From this, it is obvious that V = IR = 1.27 * 1.2
Sensor unit
Figure (15) Block Di agram of Microcontroller Based automatic door System with visitor counters
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 548
Start
Close door.
Display “closed”
Visitor
sensed? No
Yes
Open door.
Display “open”
Increment visitor
counter
Yes
Door fully
open? No
Delay 2 minutes
Display “Enter”
Yes
No
Visitor still
on sensor?
Close door
Display “Close”
Stop
FIG (16) Flow chart of microcontroller based automatic door with visitor counter.
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 549
Fig (17) Circuit diagram
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 550
Control Program
#include "at89x51.h"
code unsigned char
digit[16]={0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78,0,0x10,0x08,0x03,0x46,0x21,0x06,0x0e};
code unsigned char
digiti[]={0xff,0x40,0x0c,0x06,0x48,0x46,0x47,0x12,0x07,0x4e,0x09,0x09,0x30,0x19,0x12,0x02,0x78,0,
0x10,0xff,0x03,0x46,0x21,0x06,0x0e};
delay(2000);
while(!P3_2){;}
delay(2000);
blin();
}
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 551
}
else{dat1=5,dat2=6,dat3=1,dat4=7,dat5=3;
P3_4=1;
P3_5=0;
P3_6=1;
P3_7=0;
//door_close();
}
}
}
Conclusion
This paper have demonstrated how to reduce the work load on some staffs working as waiters, security
men and also to open doors to visitors which I witnessed at some cafeteria, fast food and some hotel,
through the help of Microcontroller based Design. It will be more appreciated if the system is designed to
have integrated voice output playback.
REFERENCES
(1) Microcontroller Based Security system with Intruder Position IOSR Journal of Electrical and Electronics
Engineering (IOSR-JEEE) e-1ssN:227-1676, P-ISSN: 2320-3331, Volume 9 ISSUE 1(Jan 2014) pp 01-08.
(2) Microcontroller Based Security system with Intruder Position IOSR Journal of Electrical and Electronics
Engineering (IOSR-JEEE) e-IssN:227-1676, P-ISSN: 2320-3331, Volume 9 ISSUE 1(Jan 2014) pp 09-17
(3) Implementation of User Interface for Microcontroller Trainer International Journal of Information
Technology Convergence and Services (IJITCS) Vol.1, No.4, August 2011 pp 53
(4). Belone Schilling, Electronic Circuits: Discrete and Integrated, McGraw-Hill, New York,1979.
(5). B.L Theraja and A.K Theraja, A Textbook on Electrical Technology, 2003, 23 rd Edition, Pp 1887 – Pp
1888.
(6). Paul Horowitz and Windfield Hill, The Art of Electronics, 1989, 2nd Edition, Pp 7- Pp 8, Pp 55 – Pp 58,
Pp 614 –Pp 622.
(7). Atmel Corporation Data Sheet on AT89C51, 0285D-B-12/97
(8). NTE Electronics Inc., ECG Data Book, January 2002, 10 th Edition.
(9). Giorgio Rizzoni, Principles of Electrical Engineering, 2003, 3 rd Edition,
(10). Ronald .J Tocci, Digital Systems, Arentice – Hall. Inc. USA.
(11). Mark Burgess, C programming tutorial, (K & R version 4).
Diarah Reuben Samuel et al IJSRE Volume 2 Issue 3 March 2014 Page 552