Sunteți pe pagina 1din 31

CHAPTER 1 INTRODUCTION

Visitor counter is simply a measurement of the visitor traffic entering and exiting offices, malls, sports venue etceteras. Counting the visitors help to maximise the efficiency and effectiveness of employees, floor area and sales potential of an organisation. Visitor counter is not limited to the entry/exit point of accompany but has a wide range of applications that provide information to management on the volume and flow of people throughout a location. A primary method for counting the visitors involves hiring human auditors to stand and manually tally the number of visitors who pass by a certain location ,but human-based data collection comes at great expense. Here is a low cost microcontroller based visitor counter that can be used to know the number of persons at a place. Two IR transmitter-receiver pairs are used at the passage, each pair consisting of IR transmitter and photo-transistor installed at entry and exit point. In todays world there is a continuous need for automatic appliances with the increase in standard of living , there is a sense of urgency for developing circuits which would ease te complexity of life. Also if at all one wants to know the number of people present in room so as not to have congestion. This circuit proves to be useful.

1.1 PROJECT OVERVIEW


This Project microcontroller based Visitor Counter using Microcontroller is a reliable circuit that takes over the task counting number of persons/ visitors in the room very accurately. When somebody enters into the room then the counter is incremented by one and when any one leaves the room then the counter is decremented by one. The total number of persons inside the room is also displayed on the seven segment displays. The microcontroller does the above job. It receives the signals from the sensors, and this signal is operated under the control of software which is stored in ROM. Microcontroller AT89S52 continuously monitor the Infrared Receivers, When any object pass through the IR Receiver's then the IR Rays falling on the receiver are obstructed , this obstruction is sensed by the Microcontroller.

CHAPTER 2 BLOCK DIAGRAM


DESCRIPTION The basic block diagram of the bidirectional visitor counter with automatic light controller is shown in the figure 1.. Block diagram consist of the following essential blocks. 1. Power supply. 2. Enter and exit sensor circuits. 3. AT89S52 microcontroller. 4. Seven segment display.

2.1 Power Supply:We are using +5 V DC power supply. This is obtained by using a 7805 voltage regulator IC ,whch converts the 12 V dc supply into 5 V supply. 12 V is obtained by using a stepdown transformer.

2.2 Enter and exit sensor:This is the main part of the project the main intension of this block is to sense the person. To sense the person, we are using IR pair sensor circuit. By using this sensor and its related circuit we can count the number of persons.

2.3 AT89S52 microcontroller


The AT89S52 is a low-power ,high performance CMOS 8-bit microcontroller with 8K bytes of in system programmable flash memory. 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 8-bit CPU within system programmable Flash on a monolithic chip, the ATMEL 89S52 is a powerful microcontroller which provides a highly- flexible and cost-effective solution to many embedded control applications.

2.4 Seven segment display


We are using the LTS543 seven segment display which is common cathode configuration for displaying the count. We are using three seven segments display, so we can count upto 999 persons. ENTER Enter Sensor Signal conditioning A T 8 9 Exit Sensor Signal conditioning S 5 2 EXIT

Power supply

Seven segment display

Fig 1.Block Diagram Of Microcontroller Based Visitor Counter

CHAPTER 3 COMPONENTS USED


Followings are the important electronic components used in the project microcontroller based visitor counter.

3.1 MICROCONTROLLER
The AT89S52 is a low-power, high performance CMOS 8-bit microcontroller with 8K bytes of in system programmable flash memory. 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 8-bit CPU within system programmable Flash on a monolithic chip, the ATMEL 89S52 is a powerful microcontroller which provides a highly- flexible and costeffective solution to many embedded control applications[1]. The AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The idle mode stop 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 interrupt or hardware reset.

3.1.1 FEATURES OF AT89S52 MICROCONTROLLER


Following are the important features of the AT89S52 microcontroller. They are as follows:y y y y y y y y y y y y y y 8 KB Reprogrammable flash. 32 Programmable I/O lines. 3 16-bit Timer/Counter. 8 Interrupt sources. Power range : 4 V- 5.5 V. Endurances : 1000 writes/erase cycles[1]. Fully static operation: 0Hz to 33 MHz. Three level program memory lock. Pwer off Flag. Full duplex UART serial channel. Low power idle and power down modes. Interrupt recovery from power down modes. 256 KB internal RAM[1]. Dual data pointer.

3.1.2 PIN DIAGRAM OF AT89S52


AT89S52 is a 40 pin microcontroller. The following figure shows the pin-diagram of it.

Fig 2. pin diagram of AT89S52[2].

PIN DESCRIPTION: 1. Vcc- supply voltage. 2. GND- ground. 3. PORT 0Port 0 is an 8-bit open drain bidirectional 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 0 can also be configured to be the multiplexed low-order 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 dur-ing program verification. External pullups are required during program verification.

4. PORT 1Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. 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 inter-nal pull-ups and can be used as inputs. As inputs, Port 1 pins 5

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 in the follow-ing table. Port 1 also receives the low-order address bytes during Flash programming and verification.

5. PORT 2Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. 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 inter-nal 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. Port 2 emits the high-order address byte during fetches from external program memory and dur-ing accesses to external data memory that use 16-bit addresses (MOVX @ DPTR). In this application, Port 2 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 program-ming and verification.

6. PORT 3Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. 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 inter-nal 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 receives some control signals for Flash programming and verification. 7. RST- Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device. This pin drives high for 98 oscillator periods after the Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature is enabled.

8. ALE/PROGAddress Latch Enable (ALE) is an output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. 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 dur-ing each access to external data memory.

9. PSENProgram Store Enable (PSEN) is the read strobe to external program memory. When the AT89S52 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.

10. EA/VPPExternal 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. 6

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 receives the 12-volt programming enable voltage (VPP) during Flash programming.

11. XTAL 1Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

12. XTAL 2Output from the inverting oscillator amplifier.

Fig 3. block diagram of AT89S52 microcontroller[2].

3.2 LM 324 IC
It consists of four 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. Application areas include transducer amplifiers, DC gain blocks and all the conventional op-amp circuits which now can be more easily implemented in single power supply systems. ADVANTAGES: y y y y y Eliminates need for dual supplies. Four internally compensated op-amps in a single package. Allows directly sensing near GND and VOUT also goes toGND. Compatible with all forms of logic. Power drain suitable for battery operation.

3.2.1 PIN DIAGRAM


LM324 is a 14 pin IC.Following diagram shows the pin diagram of LM324 IC.

Fig 4 pin diagram of LM324[3]

PIN description
pin.no 1 2 3 4 5 6 7 8 9 10 11 12 13 14

Name of the pin


Output 1 Input 1Input 1+ Vcc Input 2+ Input 2Output 2 Output 3 Input 3Input 3 + GND Input 4+ Input 4Output 4

Function of the pin


Output of first comparator Inverting input of first comparator Non-inverting input of first comparator Supply voltage,5 V(upto 32 V) Non-inverting input of second comparator Inverting input of seond comparator Output of second comparator Output of third comparator Inverting input of third comparator Non-inverting input of third comparator Ground 0V Non-inverting input of fourth comparator Inverting input of fourth comparator Output of fourth comparator

3.2.2 FEATURES
Following are the important features of the LM324 IC y y y y y y y y Internally frequency compensated for unity gain. Large DC voltage gain of 100dB. Wide bandwidth (unity gain ) of 1MHz. Wide power supply range varies from 3V to 32 V. Very low supply drain current (700 A) essentially independent of supply voltage. Low input offset voltage of 2 mV. Low input offset current of 5 nA. Low input biasing current of 45 nA .

10

3.3 IC 74LS76
This is a dual master slave J-K flip flop IC. This device contains two independent positive pulse triggered J-K flip-flop with complementary outputs. The J and K data is processed by the flip-flop after a complete clock pulse. While the clock is low the slave is isolated from the master. On the positive transition of the clock, the data from the J and K inputs is transferred to master while the clock is high, the J and K inputs are disabled. On the negative transition of the clock, the data from the master is transferred to the slave. The logic state of J and K inputs must not be allowed to change while the clock is high. The data is transferred to the outputs on the falling edge of the clock pulse. A low logic level on the preset or clear inputs will set or reset the outputs regardless of the logic levels of other inputs.

3.3.1 Pin diagram


Following diagram discusses the pin-diagram of the 74LS76 IC. It has 16 pins.

Fig 5 pin diagram of 74LS76[3]

11

3.3.2 Function table the J-K flip flop

Where, H= high logic level. L= Low logic level. X= either low or high logic level. Q0= the output logic level before the indicated input conditions were established. Toggle = each output changes to the complementof its previous level on each complete active high level clock pulse.

3.3.3 Features
y y y y y y y Output drive capability 10 LSTTL loads. Outputs directly interface to CMOS,NMOS and TTL. Low operating voltage range. Low input current. High noise immunity. Input voltage- 5 V Operating free air temperature 0 0 c to + 70 0 c.

12

Pin description
Pin number 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Name Clock 1 input Preset 1 input Clear 1 input J 1 input Vcc Clock 2 input Preset 2 input Clear 2 input J 2 input Complement Q 2 output Q 2 output K 2 input Ground Complement Q 1 output Q 1 output K 1 input

3.4 LTS 543 SEVEN SEGMENT DISPLAY

Fig 6 seven segment display The LTS 543 is a 0.52 inch digit height single digit seven-segment display. This device utilizes high efficiency red LED chips , which are made from GaAsP on GaP substrate ,and has a red face and red segment. They are designed for viewing distances up to 7 m. these displays are ideal for most applications. Pin for pin equivalent displays are also available in low current design. The low current displays are ideal for portable applications. 3.4.1 Features 13

Following are the important features of the LTS543 seven segment display. y y y y y y Common cathode configuration. 0.52 inch digit height. Low power requirements. Excellent characters appearance. High brightness and high contrast. Wide viewing angle.

14

Seven segment display truth table

15

3.5 LM7805 VOLTAGE REGULATOR LM7805


(MC78XX/LM78XX/MC78XXA 3-Terminal 1A Positive Voltage Regulator) 3.5.1 Features Output Current up to 1A Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V Thermal Overload Protection Short Circuit Protection Output Transistor Safe Operating Area Protection Description The MC78XX/LM78XX/MC78XXA series of three terminal positive regulators are available in the TO-220/D-PAK package and with several fixed output voltages, making them useful in a wide range of applications. Each type employs internal current limiting, thermal shut down and safe operating area protection,making it essentially indestructible. If adequate heat sinking is provided, they can deliver over 1A output current[4]. Although designed primarily as fixed voltage regulators, these devices can be used with external components to obtain adjustable voltages and currents.

Fig 7 LM7805 regulator IC

16

Internal Block Digram:-

Fig 8 block diagram of 7805[4].

Absolute Maximum Ratings.

17

3.6 Resistors

Fig 9 different types of resistors Resistors are components that have a predetermined resistance. Resistance determines how much current will flow through a component. Resistors are used to control voltages and currents. A very high resistance allows very little current to flow. Air has very high resistance. Current almost never flows through air. (Sparks and lightning are brief displays of current flow through air. The light is created as the current burns parts of the air.) A low resistance allows a large amount of current to flow. Metals have very low resistance. That is why wires are made of metal. They allow current to flow from one point to another point without any resistance. Wires are usually covered with rubber or plastic. This keeps the wires from coming in contact with other wires and creating short circuits. High voltage power lines are covered with thick layers of plastic to make them safe, but they become very dangerous when the line breaks and the wire is exposed and is no longer separated from other things by insulation. Resistance is given in units of ohms. (Ohms are named after Mho Ohms who played with electricity as a young boy in Germany.) Common resistor values are from 100 ohms to 100,000 ohms. Each resistor is marked with colored stripes to indicate its resistance.

Variable Resistors

Fig 10 variable resistor Variable resistors are also common components. They have a dial or a knob that allows you to change the resistance. This is very useful for many situations. Volume controls are variable resistors. When you change the volume you are changing the resistance which changes the current. Making the resistance higher will let less current flow so the volume goes down. 18

Making the resistance lower will let more current flow so the volume goes up. The value of a variable resistor is given as its highest resistance value. For example, a 500 ohm variable resistor can have a resistance of anywhere between 0 ohms and 500 ohms. A variable resistor may also be called a potentiometer.

3.7 Capacitors

Fig 11 capacitor symbol Now suppose you want to control how the current in your circuit changes (or not changes) over time. Now why would you? Well radio signals require very fast current changes. Robot motors cause current fluctuations in your circuit which you need to control. What do you do when batteries cannot supply current as fast as you circuit drains them? How do you prevent sudden current spikes that could fry your robot circuitry? The solution to this is capacitors.

Fig 12 electrolytic capacitor Capacitors are like electron storage banks. If your circuit is running low, it will deliver electrons to your circuit. In our water analogy, think of this as a water tank with water always flowing in, but with drainage valves opening and closing. Since capacitors take time to charge, and time to discharge, they can also be used for timing circuits. Timing circuits can be used to generate signals such as PWM or be used to turn on/off motors in solar powered BEAM robots. Quick note, some capacitors are polarized, meaning current can only flow one direction through them. If a capacitor has a lead that is longer than the other, assume the longer lead must always connect to positive.

3.8 Switches
Switches are devices that create a short circuit or an open circuit depending on the position of the switch. For a light switch, ON means short circuit (current flows through the switch, and lights light up.) When the switch is OFF, that means there is an open circuit (no current flows, lights go out.When the switch is ON it looks and acts like a wire. When the switch is OFF there is no connection. 19

3.9 The Transistor


Transistors are basic components in all of today's electronics. They are just simple switches that we can use to turn things on and off. Even though they are simple, they are the most important electrical component. For example, transistors are almost the only components used to build a Pentium processor. A single Pentium chip has about 3.5 million transistors. The ones in the Pentium are smaller than the ones we will use but they work the same way. Transistors that we will use in projects look like this:

Fig 13 transistor The transistor has three legs, the Collector (C), Base (B), and Emitter (E). Sometimes they are labeled on the flat side of the transistor. Transistors always have one round side and one flat side. If the round side is facing you, the Collector leg is on the left, the Base leg is in the middle, and the Emitter leg is on the right.

Basic Circuit
The Base (B) is the On/Off switch for the transistor. If a current is flowing to the Base, there will be a path from the Collector (C) to the Emitter (E) where current can flow (The Switch is On.) If there is no current flowing to the Base, then no current can flow from the Collector to the Emitter. (The Switch is off.)

Transistor BC 547
The BC547 transistor is an NPN bipolar transistor, in which the letters "N" and "P" refer to the majority charge carriers inside the different regions of the transistor. Most bipolar transistors used today are NPN, because electron mobility is higher than hole mobility in semiconductors, allowing greater currents and faster operation. NPN transistors consist of a layer of P-doped semiconductor (the "base") between two N-doped layers. A small current entering the base in common-emitter mode is amplified in the collector output. In other terms, an NPN transistor is "on" when its base is pulled high relative to the emitter. The arrow in the NPN transistor symbol is on the emitter leg and points in the direction of the conventional current flow when the device is in forward active mode.

20

One mnemonic device for identifying the symbol for the NPN transistor is "not pointing in." An NPN transistor can be considered as two diodes with a shared anode region. In typical operation, the emitter base junction is forward biased and the base collector junction is reverse biased. In an NPN transistor, for example, when a positive voltage is applied to the base emitter junction, the equilibrium between thermally generated carriers and the repelling electric field of the depletion region becomes unbalanced, allowing thermally excited electrons to inject into the base region. These electrons wander (or "diffuse") through the base from the region of high concentration near the emitter towards the region of low concentration near the collector. The electrons in the base are called minority carriers because the base is doped p-type which would make holes the majority carrier in the base.

Features
     BC547 is an NPN bi-polar junction transistor. BC547 is mainly used for amplification and switching purposes. It has a maximum current gain of 800. Its equivalent transistors are BC548 and BC549. BC547 is used in common emitter configuration for amplifiers.

21

3.10 IR SENSOR

Fig 14 IR sensor [6] The basic principle of IR sensor is based on an IR emitter and an IR receiver. IR emitter will emit infrared continuously when power is supplied to it. On the other hand, the IR receiver will be connected and perform the task of a voltage divider. IR receiver can be imagined as a transistor with its base current determined by the intensity of IR light received. The lower the intensity of IR light cause higher resistance between collector-emitter terminals of transistor, and limiting current from collector to emitter. This change of resistance will further change the voltage at the output of voltage divider. In others word, the greater the intensity of IR light hitting IR receiver, the lower the resistance of IR receiver and hence the output voltage of voltage divider will decreased. Usually the IR emitter and IR receiver will be mounted side by side, pointing to a reflective surface. The further distance away between emitter and receiver decrease the amount of infrared light hitting the receiver if the distance between the sensor and a reflective surface is fixed.

Fig 14 IR sensor [6]

22

Features
SDP8475-201 SDP8476-201

      

Package style Angular response Light current (min.) Light current (max.) Light current slope Mounting configuration Termination style

T-1 20 4 mA 14 mA 4 mA/mW/cm to 14 mA/mW/cm through-hole 0.020 in sq leads

23

CHAPTER 4 PRINTED CIRCUIT BOARD


The use of miniaturization and sub miniaturization in electronic equipment design has been responsible for the introduction of a new technique in inters component wiring and assembly that is popularly known as printed circuit. The printed circuit boards (PCBs) consist of an insulating substrate material with metallic circuitry photo chemically formed upon that substrate. Thus PCB provides sufficient mechanical support and necessary electrical connections for an electronic circuit. Advantages of printed circuit boards: 1) Circuit characteristics can be maintained without introducing variations inter circuit capacitance. 2) Wave soldering or vapour phase reflow soldering can mechanize component wiring and assembly. 3) Mass production can be achieved at lower cost. 4) The size of component assembly can be reduced with corresponding decrease in weight. 5) Inspection time is reduced as probability of error is eliminated.

4.1 Types of PCBs


There are four major types of PCBs: 1) Single sided PCB: - In this, copper tracks are on one side of the board, and are the simplest form of PCB. These are simplest to manufacture thus have low production cost. 2) Double sided PCB:- In this, copper tracks are provided on both sides of the substrate. To achieve the connections between the boards, hole plating is done, which increase the manufacturing complexity. 3) Multilayered PCB: - In this, two or more pieces of dielectric substrate material with circuitry formed upon them are stacked up and bonded together. Electrically connections are established from one side to the other and to the layer circuitry by drilled holes, which are subsequently plated through copper. 4) Flexible PCB: - Flexible circuit is basically a highly flexible variant of the conventional rigid printed circuit board theme.

4.2 PCB Manufacturing Process


There are a number of different processes, which are used to manufacture a PCB, which is ready for component assembly, from a copper clad base material. These processes are as follows  Pre processing: - This consists of initial preparation of a copper clad laminate ready for subsequent processing. Next is to drill tooling holes. Passing a board through rollers performs cleaning operation. 24

 Photolithography: - This process for PCBs involves the exposure of a photo resist material to light through a mask. This is used for defining copper track and land patterns.  Etching: - The etching process is performed by exposing the surface of the board to an etchant solution which dissolves away the exposed copper areas .The different solutions used are: FeCl, CuCl, etc.  Drilling: - Drilling is used to create the component lead holes and through holes in a PCB .The drilling can be done before or after the track areas have been defined.  Solder Masking: - It is the process of applying organic coatings selectively to those areas where no solder wettings is needed .The solder mask is applied by screenprinting.  Metal Plating: - The plating is done to ensure protection of the copper tracks and establish connection between different layers of multiplayer boards. PCBs are stacked before being taken for final assembly of components .The PCB should retain its solder ability.  Bare-Board Testing: - Each board needs to ensure that the required connections exist, that there are no short circuits and holes are properly placed .The testing usually consists of visual inspection and continuity testing.

25

Chapter 5 CIRCUIT DIAGRAM AND DESCRIPTION


The circuit diagram of the microcontroller based bidirectional visitor counter is shown in fig 15.

Fig 15: circuit diagram of bidirectional visitor counter.

Fig 16: power supply circuit 26

5.1 Circuit working


Two similar sections detect interrupt of the IR beam and generate clock pulse for the microcontroller. The microcontroller controls counting and displays the number of persons present inside the hall. When nobody is passing through the entry/exit point, IR beam continuously falls on phototransistor. It conducts and high voltages at its emitter drives the transistor into saturation, which makes pin 3 of comparator low and finally output pin of comparator is high. The low output of comparator provides negative trigger pulse to pin 1 of J-K flip flop . at this moment, the high input at J and K pins of flip-flop toggles its output to low. Port 0,1 and 2 are configured for seven segment displays. Port 0 pin is externally pulled up with 10 K ohm resistor network because it is an open drain port. Port pins 3.0 and 3.1 are configured to provide set pulse to J-K flip flop respectively. Externally interrupts INT0 and INT1 receive the interrupt pulse whe the person interrupts the IR beam. The value of the counter increments by 1 when the interrupt service routine for INT0 is executed. The output of corresponding J-K flipflop is set to high again by making its input pin low through the microcontroller. Similarly, when external interrupt INT1 is executed, the value of the counter decrements by 1 . the output of the corresponding J-K flip-flop is set to high again by making its set input pin low through the microcontroller.

5.2 Flow-chart
The logic behind the microcontroller based visitor counter is explained by following flow chart. Start

Infrared signal /beam transmission

Interrupt from sensor number 1

Interrupt from sensor number 2

Increment counter by 1

Decrement counter by 1

Fig 17 flow chart of the program

27

Chapter 6 CODING
Following program is the coding for the software of the project microcontroller based visitor counter written in C language. #include<AT89x52.h> int i=0,j,k,l,m,a[ ]={63,6,91,79,102,109,125,7,127,111}; void enter(void) interrupt 0 { i++; if(i>999) i=999; P3_1=0; for(m=0;m<=1000;m++); P3_1=1; } void exit (void) interrupt 2 { i--; if(i<0) i=0; P3_0=0; for(m=0;m<=1000;m++); P3_0=1; } void main() { IE=133; 28

TCON=5; P3_0=1; P3_1=1; i=0; while(1) { j=i%10; k=i/10; l=i/100; k=k-l*10; P2=a[j]; P0=a[k]; P1=a[l]; } }

29

Chapter 7 CONCLUSION
THE MICROCONTROLLER BASED VISITOR COUNTER was finally completed. A lot of effort was put into the design, implementation and days of toil in front of the computer, writing and debugging the code. The project was finally running with a few glitches here and there which were sorted in the later versions of the firmware. The project still has a few shortcomings but achieves most of the objectives. I earned a lot of knowledge on micro-controller, a deeper and clearer view of the architecture , ports and all other functional blocks was achieved. I must be honest and admit that there were various practical issues which one would learn only during a project. Theres a lot of learning and yet not the end, learning is a continuous never ending process but is definitely fun. The project can be further enhanced to let the user decide whether it can also control the lights of the hall. It can also have expansion of adding relay circuits to open and close the door of the hall when nobody is in the hall, the door can remain open till the hall is completely packed the other application lie in the public transport system that the crowdness can be controlled when the system has achieved its full capacity, no extra person can board as the door will close. this can also be used at public parking systems to avoid conjestion in the traffic. The major disadvantages is that it count only one person at a time. If two person passes simultaneously, then it will not count both of them individually, it counts only one.

30

REFERENCES
1. Ali Muhammad Mazidi, Janice Gillispe Mazidi and Rolin D. Mckinlay,The 8051 Microcontroller and Embedded Systems using Assembly and C, Pearson Prentice Hall Publication, pg no .152- 189, Fourth impression-2009 2. www.atmel.com/dyn/resources/prod_documents/DOC4316.PDF 3. www.datasheets4u.com 4. www.datasheetcatalog.com 5. www.EFYMAG.com/January 2007/info_/id_76. 6. www.wikipedia.org/IR sensor

31

S-ar putea să vă placă și