bidirection visitor counter.doc
TRANSCRIPT
-
8/14/2019 bidirection visitor counter.doc
1/21
Introduction
This project titled Microcontroller based Bidirectional Visitor counter is de si gn ed an d
presented in order to count the visitors of an auditorium, hall, off ices, malls,
sports venue, etc. The system counts both the entering and exiting visitor of the auditorium or
hall or other place, here i t is placed. !epending upon the interrupt from the
sensors, the system identif ies the entry and exit of the visi tor . "n the successful
implementation of the system, it displays the number of visitor present in the auditorium or
hall. This system can be ec on om i c a l l y i m pl em en t e d i n a l l t h e p l a ce s h er e
t h e v i s i t o r s h a v e t o b e c o u n t e d a n d controlled. #ince counting the visitors helps
to maximi$e the efficiency and effectiveness of employees, floor area and sales potential of an
organi$ation, etc.
-
8/14/2019 bidirection visitor counter.doc
2/21
-
8/14/2019 bidirection visitor counter.doc
3/21
!escription
%. #ensors
The bloc& shos the sensor arrangement at the entrance cum exit passage. 'ere a
pa ir of %( transmitter ) rece iver is used as sensor . *hoto transistors are used as %(
receiver, since it has sensitivity to receive %( rays.
%( Transmitter+
%nfrared%( - radiation is electromagnetic radiationof a avelength longer than that of visible
light, but shorter than that of microaves. The name means belo red from the /atin infra,
belo-, red being the color of visible lightith the longest avelength. %nfrared radiation has
avelengths beteen about 012nmand 3mm, spanning five orders of magnitude. 4
longer avelength means it has a "en fre5uency than red, hence belo. "bjects generally
emit infrared radiation across a spectrum of avelengths, but only a specific region of the
spectrum is of interest because sensors are usually designed only to collect radiation ithin a
specific bandidth. (emote controls and %r!4 devices use infrared light6emitting diodes
/7!s- to emit infrared radiation hich is focused by a plastic lens into a narro beam.
The receiver uses a silicon photodiodeto convert the infrared radiation to an electric
current. % t respo nds only to the rapid ly pulsing signal created by the transmitter,
and filters out sloly changing infrared radiation from ambient light. %( does not
penetrate alls and so does not interfere i th other devices in adjoin in g rooms.
*hoto6transistors+
*hototransistors are examples of photodiode6amplifier combinations integrated ithin a single
silicon ship. These combinations are put together in order to overcome the major fault
of photodiodes+ unity gain. Many applications demand a greater output signal from
photodiode can alays be amplified through use of an external op6amp or other circuitry, this
approach is often not as practical or as cost effective as the use of phototransistors.
http://en.wikipedia.org/wiki/Electromagnetic_radiationhttp://en.wikipedia.org/wiki/Wavelengthhttp://en.wikipedia.org/wiki/Visible_lighthttp://en.wikipedia.org/wiki/Visible_lighthttp://en.wikipedia.org/wiki/Microwaveshttp://en.wikipedia.org/wiki/Redhttp://en.wikipedia.org/wiki/Latinhttp://en.wikipedia.org/wiki/Colorhttp://en.wikipedia.org/wiki/Lighthttp://en.wikipedia.org/wiki/Nanometrehttp://en.wikipedia.org/wiki/Millimetrehttp://en.wikipedia.org/wiki/Order_of_magnitudehttp://en.wikipedia.org/wiki/Frequencyhttp://en.wikipedia.org/wiki/Light-emitting_diodehttp://en.wikipedia.org/wiki/Light-emitting_diodehttp://en.wikipedia.org/wiki/Lens_(optics)http://en.wikipedia.org/wiki/Siliconhttp://en.wikipedia.org/wiki/Photodiodehttp://en.wikipedia.org/wiki/Current_(electricity)http://en.wikipedia.org/wiki/Electromagnetic_radiationhttp://en.wikipedia.org/wiki/Wavelengthhttp://en.wikipedia.org/wiki/Visible_lighthttp://en.wikipedia.org/wiki/Visible_lighthttp://en.wikipedia.org/wiki/Microwaveshttp://en.wikipedia.org/wiki/Redhttp://en.wikipedia.org/wiki/Latinhttp://en.wikipedia.org/wiki/Colorhttp://en.wikipedia.org/wiki/Lighthttp://en.wikipedia.org/wiki/Nanometrehttp://en.wikipedia.org/wiki/Millimetrehttp://en.wikipedia.org/wiki/Order_of_magnitudehttp://en.wikipedia.org/wiki/Frequencyhttp://en.wikipedia.org/wiki/Light-emitting_diodehttp://en.wikipedia.org/wiki/Lens_(optics)http://en.wikipedia.org/wiki/Siliconhttp://en.wikipedia.org/wiki/Photodiodehttp://en.wikipedia.org/wiki/Current_(electricity) -
8/14/2019 bidirection visitor counter.doc
4/21
The basic bloc& diagram of the bidirectional visitor counter ith automatic light controller is
shon in the above figure. Mainly this bloc& diagram consists of the folloing essential bloc&s.
3. *oer #upply
8. 7ntry and 7xit sensor circuit
9. 4T:;#18 micro6controller
-
8/14/2019 bidirection visitor counter.doc
5/21
9. :;#18 Microcontroller+6
%t is a lo6poer, high performance >M"# :6bit microcontroller ith :@B of ?lash
*rogrammable and 7rasable (ead "nly Memory *7("M-. The device is manufactured using
4tmelAs high6density nonvolatile memory technology and is compatible ith the M>#6
13TM instruction set and pin out. The on6chip ?lash allos the program memory to be
reprogrammed in6system or by a conventional nonvolatile memory programmer. By combining a
versatile :6bit >* ith ?lash on a monolithic chip, the 4tmel 4T:;#18 is a poerful
Microcontroller, hich provides a highly flexible and cost effective solution for many
embedded control applications.
LIST OF COMPONENTS
Microcontroller ) 4T:;#18
%> ) 0:21
#ensor ) T#"* 309: %nfrared #ensor-
Transformer ) 3862638, 122 m4
*reset )
-
8/14/2019 bidirection visitor counter.doc
6/21
(ectifier diode ) %C
-
8/14/2019 bidirection visitor counter.doc
7/21
DESCRIPTION OF THE COMPONENTS USED
1. Microcontroller AT89S!
The 4T:;#18 is a lo6poer, high6performance >M"# :6bit microcontroller ith :@
bytes of in6system programmable ?lash memory. The device is manufactured using
4tmelAs high6density nonvolatile memory technology and is compatible ith the %ndustry6
standard :2>13 instruction set and pin out. The on6chip ?lash allos the program memory to be
reprogrammed in6system or by a conventional nonvolatile memory pro6grammar. By
combining a versatile :6bit >* ith in6system programmable ?lash on a monolithic chip, the
4tmel 4T:;#18 is a poerful microcontroller hich provides a highly6flexible and cost6
effective solution to many embedded control applications.
The 4T:;#18 provides the folloing standard features+ :@ bytes of ?lash, 81D bytes of (4M,
98 %E" lines, Fatchdog timer, to data pointers, three 3D6bit
timerEcounters, a six6vector to6level interrupt architecture, a full duplex serial port, on6
chip oscillator, and cloc& circuitry. %n addition, the 4T:;#18 is designed ith static logic for
operation don to $ero fre5uency and supports to softare selectable poer saving modes. The
%dle Mode stops the >* hile alloing the (4M, timerEcounters, serial port, and interrupt
system to continue functioning. The *oer6don mode saves the (4M contents but free$es the
oscillator, disabling all other chip functions until the next interrupt or hardare reset.
FEATURES"
G : @B (eprogrammable flash.
G 98 *rogrammable %E" lines.
G 3D bit TimerE>ounter 9.
-
8/14/2019 bidirection visitor counter.doc
8/21
G : %nterrupt sources.
G *oer range+
-
8/14/2019 bidirection visitor counter.doc
9/21
G TT/ and >M"# compatibility
G "utput active lo
G /o poer consumption
G 'igh immunity against ambient light
G >ontinuous data transmission possible up to 8
-
8/14/2019 bidirection visitor counter.doc
10/21
Features:
"utput >urrent up to 34
"utput Voltages of 1, D, :, ;, 32, 38, 31, 3:, 8
-
8/14/2019 bidirection visitor counter.doc
11/21
Circuit O,er'tion
The circuit shos the microcontroller based bidirectional visitor counter,
herein the transmitter and the receiver form the %( detection circuit. >ontrol logic is
built around the transmitter and the receiver form the %( .
The %( transmitter6receiver setup at the entrance6cum6exit of the passage is
shon at the bloc& diagram. To similar sections detect interruption of the %( beam and
generate cloc& pulse for the microcontroller. The microcontroller controls counting and
displays the number of persons present inside the hall. Fhen nobody is passing through the
entryEexit point, the %( beam continuously falls on phototransistor T3. *hototransistor
T3 conducts and the high voltage as its emitter drives ma&es pin *8.3 high.
Co if someone inters the place, first the %( beam from %( TH3 is interrupted and then
the %( beam from %( TH3 is interrupted, phototransistor T3 and transistor T9 cut6off
and pin *8.8 goes high. This triggers the external interrupt %CT2 pin 38- of microcontroller
4T:;>18.
The 4T:;>18 us an :6bit microcontroller ith : &b of flash based program
memory,81D bytes of (4M, 98 inputEoutput lines, three 3D bits timersEcounters, on6
chip oscillator and cloc& circuitry. 4 38M'$ crystal is used for providing cloc&. *orts 3 and 9
are configured for />! displays. *ort62 pin is externally pulled up ith 326&ilo6ohm resistor
netor& (CF3 because port62is an :6bit, open6drain, bidirectional, inputEoutput %E"- port. *ort6
3 and port68 are :6bit bidirectional %E" ports ith internal pull6ups no need of external pull6ups-.
*ort pins 9.2 and 9.3 are configured to provide the interrupt from %r(x3 and
%r(x8 respectively.
(eceive the interrupt the %( beams. (esistor (; and capacitor >1 provide poer6
on6reset pulse to the microcontroller. #itch #3 is used for manual reset.
Fhen the microcontroller is reset, the microcontroller at softare run time by
ma&ing their IsetA pin high for a moment. The value of the counter increments by I3Ahen the interrupt service routine for *9.2 is executed.
#imilarly, if somebody exits the place, first the %( beam from %( TH8 is interrupted and
t h en t h e % ( b e a m f r o m % ( T H 3 . F h e n t h e b e a m f r o m % ( T x 8 i s
i n t e r r u p t e d , * i n * 9 . 3 i s i n t e r r u p t e d a n d c o u n t e r i s d e c r e m e n t e d .
-
8/14/2019 bidirection visitor counter.doc
12/21
Al+orit-
4lgorithm+
#tep 3+ #tart the process
#tep 8+ #elect ports 2, 3, 8 as output ports for displaying the count value in06/>! display
#tep 9+ #elect port 9 also as output port for providing set pulse to %( Trx
#tep ontinue the process, henever the interruption occurs
-
8/14/2019 bidirection visitor counter.doc
13/21
Flo/ c-'rt
-
8/14/2019 bidirection visitor counter.doc
14/21
*>B !esign and ?abrication
*>B !esign+
sing the *rotel schematics softare, designed this *>B.
*rotel for indos *>B 3.1 capabilities+
*rotel for indos *>B is a complete *>B layout environment ith many attractive
features for productive design or&. Jou can use *rotel for indos *>B as a stand6alone
manual board layout. Fhen combined ith the schematics capture pac&age, *rotel for indos
*>B becomes the bac&bone of fully automated, end to end design system that features a high
degree of design automation and integration. 'oever you use *rotel for indos *>B, you ill
appreciate itshelps of use and the high degree of flexibility built into this proven *>B design
system.
*>B generates through hole and design and #C! design of up to sixteen signal layers,
plus four mid layer poer planes and four mechanical draing layers. Board si$e can be as big
as 322inches or :3 cm- s5uare. *lacement accuracy is to 3E3,222,222 inch .223 mil or .22281
mm-.MetricEimperial grid system allos you to or& accurately in both measurement system and
the girdcan be toggled Beteen metric and imperial modes as you design by pressing K.
4 *>B design is a series of layers hich correspond to the individual tools used
tocreate the board such as the top and bottom signal layers independently and some operations,
such astrac& placement and layers dependent ) you must first select the layers and then place the
trac&. *>B printEplot options also reflect this re5uirement for layered design.
*>B design differs from other draing tas&s in its re5uirements for extreme precision.4s
a result, *>B is more of a placing environment than a freehand draing environment.
4nother fundamental difference is connectivity ) *>BAs ability to recogni$e connection beteen
trac& segments, trac&s and component pads, etc. for example, *>B allos you to move a
component ithout brea&ing its trac& to pad connections. Jou ill be using connectivity on
several levels as you designith *>B.
-
8/14/2019 bidirection visitor counter.doc
15/21
*>B fabrication +
The proposed *>B has been carefully designed by considering all the aspectssuch as the
overall circuit functionality, si$e re5uirements, electromagnetic interface, etc. once the*>B
pattern is photographed and reproduce on clear plastic sheet. The plastic sheet is placed over
acopper glass epoxy or phenolic board, the assembly is injected to undergo a photochemical
processand the resulting copper coated board consists of printed trac&s hich interconnect the
components as per the schematic design. The basic material used for ma&ing printed circuit
board is copper clad phenolic resin laminate. ?or general use, fuse boards are single sided.
The procedure for ma&ing *>B is as follos,
G The board has to be cut to the re5uired si$e and the copper surface has to becleaned.
G The draing of the circuit through hich conduction ta&es place is made on thecopper
surface using resist in&s.
G Then the uncovered copper areas are etched aay in chemical bath.
G The resist in& is removed to expose copper conducting areas.
G !egreasing and cleaning the board are necessary to ensure that the areas ta&e solder
readily.
G /ayout starts ith an experimental design of components position and connectionsare
re5uired.
G >onnections on a *>B should cross and s&etching is usually done hencomponents
positions are to be altered. Trac&ing of the *>B plane has to be madeafter having arrived at a
suitable layout.
G The copper surface should be cleaned and dried before s&etching the circuit in the
board.
G 4fter trac&ing the pattern on the copper surface, this pattern then painted ith
resistmar&er pen. %t is alloed to dry for about 31 minutes.
-
8/14/2019 bidirection visitor counter.doc
16/21
G The board is then transferred to an etching bath. This consists of a solution of
ferricchloride &ept in a plastic tray.
G The board is placed in the path such that the copper surface is &ept facing upards.
G This process is to be continued until all the trac&s of copper have disappeared fromthe
surface.
G 4fter etching, the board is removed and ashed under running ater to removetraces of
chemicals.
G ?inally it is dried ith soft cloth. The rest should be done is drilling.
The points to be considered hile drilling are,
G !rilling should carry out such that the copper side is upper most. The use of a sharp
drill is a must.
G 4 hard material under the board prevents the points of the drill from tearing up alump
out of the bac& of the board, hen the drill brea&s through.
G To prevent the drill running of its correct position hile drilling, the point to bedrilled
has to be spotted ith the center punch.
G Vertical drill stand is best suited for drilling *>BAs. This should ensure s5uareholes.
!ue to small si$e drill is used brea&age rate can be high.
G The original trac&ing ill be helpful for ma&ing the components positions on the plan
side of the board, hich acts a guide for components assembly.
-
8/14/2019 bidirection visitor counter.doc
17/21
>onclusion
Thus the project entitled Bidirectional Visitor >ounter helps to measure the
visitor entering and exiting a particular passage or ay. The circuit counts both entering and
exiting visitors and displays the number of visitors present inside the hall. Visitor counting is n o t
l im it ed t o t he e nt ry Ee xi t p oi nt o f a c om pa ny b u t h a s a id e r an ge o f
app l i ca t ion s t ha t provide information to management on the volume and flo of people
throughout a location. the visitor helps to maximi$e the efficiency and effectiveness of
employees, floor area and sales potential of an organi$ation. The circuit may also be
enhanced ith a ide counting range of above three digits by modifying softare
section of the system. %t can also be enhanced for long and accurate sensing range using
a laser torch instead of %( transmission circuit. Thus the circuit can be used to monitor visitor
flo in effective manner, here the visitors have to counted and controlled.
-
8/14/2019 bidirection visitor counter.doc
18/21
Re0erence oo2(
*rogramming in 4C#% >+ 7 B4/4L(#4MJ
The :213microcontroller and embedded systems+ M'4MM4! 4/% M4%!%
N4C%>7 L%//%#*%7 M4%!%
The :213 microcontroller+ @7CC7T' N. 4J4/4
3e4(ite
.datasheets
-
8/14/2019 bidirection visitor counter.doc
19/21
code+
Oinclude P4T:;x18.hQ
int iR2,j,&,l,m,aS32U
void enter void- interrupt 2
i==U
ifiQ;;;- iR;;;U
*9W3R2U
formR2UmPR3222Um==-U
*9W3R3U
X
void exit void- interrupt 8
iYU
ifiP2- iR2U
*9W2R2U
formR2UmPR3222Um==-U
*9W2R3U
X
void main-
-
8/14/2019 bidirection visitor counter.doc
20/21
%7 R 399U
T>"C R 1U
*9W2R3U
*9W3R3U iR2U
hile3-
jRiZ32U
&RiE32U
lRiE322U
&R&6lG32U
*8RaSjU
*2RaS&U
*3RaSlU
X
X
-
8/14/2019 bidirection visitor counter.doc
21/21