Você está na página 1de 21

Introduction

This project titled Microcontroller based Bidirectional Visitor counter is designed and presented in order to count the visitors of an auditorium, hall, offices, malls, sports venue, etc. The system counts both the entering and exiting visitor of the auditorium or hall or other place, here it is placed. !epending upon the interrupt from the sensors, the system identifies the entry and exit of the visitor. "n the successful implementation of the system, it displays the number of visitor present in the auditorium or hall. This system can be e c o n o m i c a l l y i m p l e m e n t e d i n a l l t h e p l a c e s here 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.

!escription %. #ensors The bloc& sho s the sensor arrangeme nt at the entrance cum exit passage. 'ere a pair of %( transmitter ) receiver is used as sensor. *hoto transistors are used as %( receiver, since it has sensitivity to receive %( rays. %( Transmitter+ %nfrared,%( - radiation is electromagnetic radiation of a .belo .-, red being the color of visible light avelength longer than that of visible red. ,from the /atin infra, avelength. %nfrared radiation has

light, but shorter than that of micro aves. The name means .belo ith the longest

avelengths bet een 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 ithin a beam. spectrum is of interest because sensors are usually designed only to collect radiation ,/7!s- to emit infrared radiation hich is focused by a plastic lens into a narro

specific band idth. (emote controls and %r!4 devices use infrared light6emitting diodes The receiver uses a silicon photodiode to convert the infrared radiation to an electric current. % t r e s p o n ds o n l y t o t h e r a p i d l y pulsing signal created by the transmitter, and filters out slo ly changing infrared radiation from ambient light. %( does not penetrate alls and so does not interfere ith 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 al ays 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.

The basic bloc& diagram of the bidirectional visitor counter

ith automatic light controller is

sho n in the above figure. Mainly this bloc& diagram consists of the follo ing essential bloc&s. 3. *o er #upply 8. 7ntry and 7xit sensor circuit 9. 4T:;#18 micro6controller <. (elay driver circuit

3. *o er #upply+6 'ere e used =38V and =1V dc po er supply. The main function of this bloc& is to provide the

re5uired amount of voltage to essential circuits. =38V is given to relay driver. To get the =1V dc po er supply e have used here %> 0:21, hich provides the =1V dc regulated po er supply.

8. 7nter and 7xit >ircuits+6 This is one of the main parts of our project. The main intention of this bloc& is to sense the person. ?or sensing the person e are using a T#"* 309: sensor. By using this sensor and its related circuit diagram e can count the number of persons.

9. :;#18 Microcontroller+6 %t is a lo 6po er, high performance >M"# :6bit microcontroller ith :@B of ?lash ith the M>#6

*rogrammable and 7rasable (ead "nly Memory ,*7("M-. The device is manufactured using 4tmelAs high6density nonvolatile memory technology and is compatible 13TM instruction set and pin out. The on6chip ?lash allo s the program memory to be reprogrammed in6system or by a conventional nonvolatile memory programmer. By combining a versatile :6bit >*B Microcontroller, ith ?lash on a monolithic chip, the 4tmel 4T:;#18 is a po erful 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 ) <.0@

!isc capacitor ) 32<,99p?

(eset button s itch

(ectifier diode ) %C<3<:

/>! !isplay

DESCRIPTION OF THE COMPONENTS USED 1. Microcontroller AT89S !

The 4T:;#18 is a lo 6po er, high6performance >M"# :6bit microcontroller 4tmelAs high6density nonvolatile memory technology and is compatible

ith :@

bytes of in6system programmable ?lash memory. The device is manufactured using ith the %ndustry6 standard :2>13 instruction set and pin out. The on6chip ?lash allo s the program memory to be reprogrammed in6system or by a conventional nonvolatile memory pro6grammar. By combining a versatile :6bit >*B ith in6system programmable ?lash on a monolithic chip, the hich provides a highly6flexible and cost6 4tmel 4T:;#18 is a po erful microcontroller

effective solution to many embedded control applications. The 4T:;#18 provides the follo ing standard features+ :@ bytes of ?lash, 81D bytes of (4M, 98 %E" lines, Fatchdog timer, t o data pointers, three 3D6bit timerEcounters, a six6vector t o6level interrupt architecture, a full duplex serial port, on6 chip oscillator, and cloc& circuitry. %n addition, the 4T:;#18 is designed %dle Mode stops the >*B ith static logic for operation do n to $ero fre5uency and supports t o soft are selectable po er saving modes. The hile allo ing the (4M, timerEcounters, serial port, and interrupt system to continue functioning. The *o er6do n mode saves the (4M contents but free$es the oscillator, disabling all other chip functions until the next interrupt or hard are reset. FEATURES"

G : @B (eprogrammable flash. G 98 *rogrammable %E" lines. G 3D bit TimerE>ounter 9.

G : %nterrupt sources. G *o er range+ <V ) 1.1V G 7ndurance+ 3222 Frites E 7rase cycles G ?ully static operation+ 2 '$ to 99 M'$ G Three level program memory loc& G *o er off flag G ?ull duplex B4(T serial channel G /o po er idle and po er do n modes G %nterrupt recovery from po er do n modes G 81D @B internal (4M G !ual data pointer !. TSOP1#$8 %INFRARED SENSOR& !escription+ The T#"*30.. ) #eries are miniaturi$ed receivers for infrared remote control systems. *%C diode and preamplifier are assembled on lead frame, the epoxy pac&age is designed as %( filter. The demodulated output signal can directly be decoded by a microprocessor. T#"*30.. is the standard %( remote control receiver series, supporting all major transmission codes. Fe'ture(" G *hoto detector and preamplifier in one pac&age G %nternal filter for *>M fre5uency G %mproved shielding against electrical field disturbance

G TT/ and >M"# compatibility G "utput active lo G /o po er consumption G 'igh immunity against ambient light G >ontinuous data transmission possible ,up to 8<22 bpsG #uitable burst length .32 cyclesEburst & LM#8) %*olt'+e Re+ul'tor&

Fig. Voltage Regulator

De(cri,tion" The KA78XX/KA78XXA series of three-terminal positive regulator are available in the TO!/"-#AK pa$%age an& 'ith several fi(e& output voltages) ma%ing them useful in a 'i&e range of appli$ations. *a$h t+pe emplo+s internal $urrent limiting) thermal shut &o'n an& safe operating area prote$tion) ma%ing it essentiall+ in&estru$tible. ,f a&e-uate heat sin%ing is provi&e&) the+ $an &eliver over .A output $urrent. Although &esigne& primaril+ as fi(e& voltage regulators) these &evi$es $an be use& 'ith e(ternal $omponents to obtain a&/ustable voltages an& $urrents.

Features: "utput >urrent up to 34 "utput Voltages of 1, D, :, ;, 32, 38, 31, 3:, 8<V Thermal "verload *rotection #hort >ircuit *rotection "utput Transistor #afe "perating 4rea *rotection

Circuit O,er'tion The circuit sho s 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 sho n at the bloc& diagram. T o 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 %( b e a m 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 net or& (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 po er6 on6reset pulse to the microcontroller. # itch #3 is used for manual reset. Fhen the microcontroller is reset, the micr ocontroller at soft are run time by ma&ing their IsetA pin high for a moment. The value of the counter increments by I3A hen the interrupt service routine for *9.2 is executed. #imilarly, if somebody exits the place, first the %( beam from %( TH8 is interrupted and then the %( beam from %( TH3. Fhen the beam from %( Tx8 is interrupted, *in *9.3 is interrupted and counter is decremented.

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 <+ Fhen external interrupt %CT2 occurred, increment the count by 3. #tep 1+ Fhen external interrupt %CT3 occurred, decrement the count by 3. #tep D+ >ontinue the process, henever the interruption occurs

Flo/ c-'rt

*>B !esign and ?abrication *>B !esign+ Bsing the *rotel schematics soft are, designed this *>B. *rotel for indo s *>B 3.1 capabilities+ *rotel for indo s *>B is a complete *>B layout environment or&. Jou can use *rotel for ith many attractive indo s

features for productive design

indo s *>B as a stand6alone

manual board layout. Fhen combined

ith the schematics capture pac&age, *rotel for

*>B becomes the bac&bone of fully automated, end to end design system that features a high degree of design automation and integration. 'o ever you use *rotel for indo s *>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 po er planes and four mechanical dra ing 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 allo s you to or& accurately in both measurement system and the girdcan be toggled Bet een 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 dra ing tas&s in its re5uirements for extreme precision.4s a result, *>B is more of a placing environment than a freehand dra ing environment. 4nother fundamental difference is connectivity ) *>BAs ability to recogni$e connection bet een trac& segments, trac&s and component pads, etc. for example, *>B allo s you to move a component ithout brea&ing its trac& to pad connections. Jou ill be using connectivity on several levels as you design ith *>B.

*>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 follo s, G The board has to be cut to the re5uired si$e and the copper surface has to becleaned. G The dra ing of the circuit through surface using resist in&s. G Then the uncovered copper areas are etched a ay 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 re5uired. G >onnections on a *>B should cross and s&etching is usually done 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 resistmar&er pen. %t is allo ed to dry for about 31 minutes. ith hencomponents ith an experimental design of components position and connectionsare hich conduction ta&es place is made on thecopper

positions are to be altered. Trac&ing of the *>B plane has to be madeafter having arrived at a

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 up ards. 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 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. hile drilling, the point to bedrilled

>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 ide range of of people exiting visitors and displays the number of visitors present inside the hall. Visitor counting is n o t limited to the entryEexit point of a company but has a a p p l i c a t i o n s t h a t provide information to management on the volume and flo

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 soft are 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.

Re0erence 1oo2( *rogramming in 4C#% >+ 7 B4/4LB(B#4MJ The :213microcontroller and embedded systems+ MB'4MM4! 4/% M4M%!% N4C%>7 L%//%#*%7 M4M%!% The :213 microcontroller+ @7CC7T' N. 4J4/4

3e4(ite .datasheets<u.com .:213.com

code+ Oinclude P4T:;x18.hQ int iR2,j,&,l,m,aS32TU void enter ,void- interrupt 2 V i==U if,iQ;;;- iR;;;U *9W3R2U for,mR2UmPR3222Um==-U *9W3R3U X void exit ,void- interrupt 8 V iYU if,iP2- iR2U *9W2R2U for,mR2UmPR3222Um==-U *9W2R3U X void main,-

V %7 R 399U T>"C R 1U *9W2R3U *9W3R3U iR2U hile,3V jRiZ32U &RiE32U lRiE322U &R&6lG32U *8RaSjTU *2RaS&TU *3RaSlTU X X

Você também pode gostar