Digital Visitor counter using 8051 microcontroller (AT89C52) Abstract : 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, where it is placed. Depending upon the interrupt from the sensors, the system identifies the entry and exit of the visitor. On the successful implementation of the system, it displays the number of visitor present in the auditorium or hall. This system can be economically implemented in all the places where the visitors have to be counted and controlled. Since counting the visitors helps to maximize the efficiency and effectiveness of employees, floor area and sales potential of an organization, etc.
30
Embed
Digital Visitor Counter Using 8051 Microcontroller
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Digital Visitor counter using 8051 microcontroller (AT89C52)
Abstract :
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, where it is
placed. Depending upon the interrupt from the sensors, the system
identifies the entry and exit of the visitor. On the successful
implementation of the system, it displays the number of visitor present in
the auditorium or hall. This system can be economically implemented in
all the places where the visitors have to be counted and controlled. Since
counting the visitors helps to maximize the efficiency and effectiveness of
employees, floor area and sales potential of an organization, etc.
Description :
A counter that can change its state in either direction, under control of an
up–down selector input, is known as an up–down counter. The circuit
given here can count numbers from 0 to 9999 in up and down modes
depending upon the state of the selector. It can be used to count the
number of persons entering a hall in the up mode at entrance gate. In the
down mode, it can count the number of persons leaving the hall by
decrementing the count at exit gate. It can also be used at gates of
parking areas and other public places.
This circuit divided in three parts: sensor, controller and counter display.
The sensor would observe an interruption and provide an input to the
controller which would run the counter in up/down mode depending upon
the selector setting. The same count is displayed on a set of 7-segment
displays through the controller.
In this circuit, two infrared (IR) sensor modules are used each for up and
down counting, respectively. Whenever an interruption is observed by the
SensorsLogic
Control Circuit
Micro-controller AT89C52
Display
PowerSupply +5V
first IR sensor, it increments the counter value. Similarly, when the second
sensor detects an obstacle, the count is decremented. The count value is
calculated depending upon the sensor’s input and is displayed on a set of
four seven segment displays by using the concept of multiplexing. The
data pins of each 7-segment display are connected to port P2 of the
microcontroller AT89C51. The first four pins of port P1 (P1^0-P1^3) are
connected to control pins to enable a particular 7-segment. P1^5 & P1^6
are configured as input pins at which the sensors are connected. The
sensor inputs are defined as up and down selector modes for the counter
in the code. Each time the first sensor is blocked, it gives a high signal at
P1^5 and the count value gets incremented. The value gets decremented
when P1^6, connected to second sensor, gives high input. At each step,
the value of the counter is sent to be displayed on the segments.
Block Diagram:
Enter
Exit
IR TX1
IR TX2 RX2
RX1
Sensor arrangement at the way :
Circuit Diagram :
Circuit Components :
Transistor BC547
BC547 is an NPN bi-polar junction transistor. A transistor, stands for transfer of resistance, is commonly used to amplify current. A small current at its base controls a larger current at collector & emitter terminals. BC547 is mainly used for amplification and switching purposes. It has a maximum current gain of 800. Its equivalent transistors are BC548 and BC549.
Seven Segment Display
A seven segment display is the most basic electronic display device that can display digits from 0-9. 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.
AT89C51 Microcontroller
AT89C51 is an 8-bit microcontroller and belongs to Atmel's 8051 family. ATMEL 89C51 has 4KB of Flash programmable and erasable read only memory (PEROM) and 128 bytes of RAM. It can be erased and program to a maximum of 1000 times.
Infrared LED
An IR LED, also known as IR transmitter, is a special purpose LED that transmits infrared rays in the range of 760 nm wavelength. Such LEDs are usually made of gallium arsenide or aluminium gallium arsenide. They, along with IR receivers, are commonly used as sensors.
Light emitting diodes
Light emitting diodes (LEDs) are semiconductor light sources. The light emitted from LEDs varies from visible to infrared and ultraviolet regions. They operate on low voltage and power. LEDs are one of the most common electronic components and are mostly used as indicators in circuits.
BC547 is an NPN bi-polar junction transistor. A transistor, stands for transfer of resistance, is commonly used to amplify current. A small current at its base controls a larger current at collector & emitter terminals. BC547 is mainly used for amplification and switching purposes. It has a maximum current gain of 800. Its equivalent transistors are BC548 and BC549. The transistor terminals require a fixed DC voltage to operate in the desired region of its characteristic curves. This is known as the biasing. For amplification applications, the transistor is biased such that it is partly on for all input conditions. The input signal at base is amplified and taken at the emitter. BC547 is used in common emitter configuration for amplifiers. The voltage divider is the commonly used biasing mode. For switching applications, transistor is biased so that it remains fully on if there is a signal at its base. In the absence of base signal, it gets completely off.
Pin Diagram:
Seven Segment Display:
Description:
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. 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.
Pin Diagram:
AT89C51 Microcontroller:
Description:
AT89C51 is an 8-bit microcontroller and belongs to Atmel's 8051 family. ATMEL 89C51 has 4KB of Flash programmable and erasable read only memory (PEROM) and 128 bytes of RAM. It can be erased and program to a maximum of 1000 times.
In 40 pin AT89C51, there are four ports designated as P1, P2, P3 and P0. All these ports are 8-bit bi-directional ports, i.e., they can be used as both input and output ports. Except P0 which needs external pull-ups, rest of the ports have internal pull-ups. When 1s are written to these port pins, they are pulled high by the internal pull-ups and can be used as inputs. These ports are also bit addressable and so their bits can also be accessed individually.
Port P0 and P2 are also used to provide low byte and high byte addresses, respectively, when connected to an external memory. Port 3 has multiplexed pins for special functions like serial communication, hardware interrupts, timer inputs and read/write operation from external memory. AT89C51 has an inbuilt UART for serial communication. It can be programmed to operate at different baud rates. Including two timers & hardware interrupts, it has a total of six interrupts.
Pin Diagram:
Pin Description:
Pin No Function Name1
8 bit input/output port (P1) pins
P1.02 P1.13 P1.24 P1.35 P1.46 P1.57 P1.68 P1.79 Reset pin; Active high Reset
10Input (receiver) for serial
communicationRxD
8 bit input/output port (P3) pins
P3.0
11Output (transmitter) for serial
communicationTxD P3.1
12 External interrupt 1 Int0 P3.213 External interrupt 2 Int1 P3.314 Timer1 external input T0 P3.415 Timer2 external input T1 P3.516 Write to external data memory Write P3.617 Read from external data memory Read P3.718
Quartz crystal oscillator (up to 24 MHz)Crystal 2
19 Crystal 120 Ground (0V) Ground21
8 bit input/output port (P2) pins/
High-order address bits when interfacing with external memory
P2.0/ A8
22 P2.1/ A9
23 P2.2/ A10
24 P2.3/ A11
25 P2.4/ A12
26 P2.5/ A13
27 P2.6/ A14
28 P2.7/ A15
29 Program store enable; Read from external program memory PSEN
30Address Latch Enable ALE
Program pulse input during Flash programming Prog
31External Access Enable; Vcc for internal program executions EA