Micro Controller Based Digital Visitor Counter
Micro Controller Based Digital Visitor Counter
2009-2010
Certificate
This is to certify that
Sumedh.M.More(07-336)
Sneha Newalkar(07-339)
Prathamesh.B.Sarang(07-349)
Page 2 of 33
Microcontroller Based Digital Visistor Counter
PAGE INDEX
3 PROGRAM 18
.
COMPONENTS
4 DETAILS
. 4.1 RESISTOR 25
4.2 CAPACITOR 25
4.3 TRANSISTOR 25
4.4 DIODES 26
4.5 INTEGRATED CIRCUIT(IC555) 26
4.6 INFRARED SENSORS 28
5 CONCLUSION
. 5.1 APPLICATIONS 29
BIBLIOGRAPHY 30
Page 3 of 33
Microcontroller Based Digital Visistor Counter
FIGURE INDEX
TABLE INDEX
Table Page No.
Page 4 of 33
Microcontroller Based Digital Visistor Counter
ACKNOWLEDGEMENT
We sincerely acknowledge with deep sense of gratitude to our project guide Prof.
Mrs. Ameya Pethe for the guidance and encourage she gave us for the preparation
of this project without her the project would have been difficult.
We also thank the staff of our electronics department for all the cooperation
and friendly treatment given to us during project.
We are also thankful to our colleagues and all those have extended the necessary
help during the course of our work .
Page 5 of 33
Microcontroller Based Digital Visistor Counter
ABSTRACT
Digital visitor counter is a reliable circuit that takes over the task of counting
Number of Persons/ Visitors in the Room very accurately. When somebody enters
into the Room then the Counter is Incremented by one. The total number of
Persons inside the Room is displayed on the seven segment display module. The
microcontroller does the above job it receives the signals from the sensors, and
this signals operated under the control of software which is stored in ROM
This project we will create counter system for apply.The total number of object is
displayed on the seven segment displays.The system is fully controlled by the 8 bit
microcontroller AT89C2051 which has a 2Kbytes of ROM for the program
memory.
Page 6 of 33
Microcontroller Based Digital Visistor Counter
INTRODUCTION
Page 7 of 33
Microcontroller Based Digital Visistor Counter
PROJECT DESCRIPTION
Figure 1.1: BLOCK DIAGRAM
Page 8 of 33
Microcontroller Based Digital Visistor Counter
The generic 8051 architecture sports a Harvard architecture, which contains two
separate buses for both program and data. So, it has two distinctive memory
spaces of 64K X 8 size for both program and data.
It is based on an 8 bit central processing unit with an 8 bit Accumulator
and another 8 bit B register as main processing blocks. Other portions of the
architecture include few 8 bit and 16 bit registers and 8 bit memory locations.
Each 8051 device has some amount of data RAM built in the device for internal
processing. This area is used for stack operations and temporary storage of data.
This base architecture is supported with onchip peripheral functions like I/O
ports, timers/counters, versatile serial communication port. So it is clear that this
8051 architecture was designed to cater many real time embedded needs.
Page 9 of 33
Microcontroller Based Digital Visistor Counter
Now you may be wondering about the non mentioning of memory space
meant for the program storage, the most important part of any embedded
controller. Originally this 8051 architecture was introduced with onchip, `one
time programmable' version of Program Memory of size 4K X 8. Intel delivered
all these microcontrollers (8051) with user's program fused inside the device. The
memory portion was mapped at the lower end of the Program Memory area. But,
after getting devices, customers couldn't change any thing in their program code,
which was already made available inside during device fabrication.
Page 10 of 33
Microcontroller Based Digital Visistor Counter
inputs and then retains a portion of the result. For other instructions, it can be
used as another general purpose register.
Timers/Counters
8051 has two 16 bit Timers/Counters capable of working in different modes. Each
consists of a `High' byte and a `Low' byte which can be accessed under software.
There is a mode control register and a control register to configure these
timers/counters in number of ways.These timers can be used to measure time
intervals, determine pulse widths or initiate events with one microsecond
resolution upto a maximum of 65 millisecond (corresponding to 65, 536 counts).
Use software to get longer delays. Working as counter, they can accumulate
occurrences of external events (from DC to 500KHz) with 16 bit precision.
In our project we are using 8 bit microcontroller AT89C2051, it is the advanced 8
bit microcontroller from ATMEL, which incorporates Flash Rom, and Timer etc.
Features of AT89C2051:
Compatible with MCS-51 Products
2 Kbytes of Reprogrammable Flash Memory
Endurance: 1,000 Write/Erase Cycles
2.7 V to 6 V Operating Range
Fully Static Operation: 0 Hz to 24 MHz
Two-Level Program Memory Lock
128 x 8-Bit Internal RAM
15 Programmable I/O Lines
Two 16-Bit Timer/Counters
Six Interrupt Sources
Programmable Serial UART Channel
Page 11 of 33
Microcontroller Based Digital Visistor Counter
Page 12 of 33
Microcontroller Based Digital Visistor Counter
Page 13 of 33
Microcontroller Based Digital Visistor Counter
Page 14 of 33
Microcontroller Based Digital Visistor Counter
Page 15 of 33
Microcontroller Based Digital Visistor Counter
Page 16 of 33
Microcontroller Based Digital Visistor Counter
+12V
IC1
D1
1 3 +5V
LM7805
230/ 9V AC D4 C1 C2
2
230V 1000uF/25V 47uF/25V
D3
AC
Gnd
D2
D(1-4)=1N4007
2.3. Flowchart
Page 17 of 33
Microcontroller Based Digital Visistor Counter
Page 18 of 33
Microcontroller Based Digital Visistor Counter
3.PROGRAM
$MOD52 ORG 00H ; Reset
JMP MAIN
DIS_A EQU P1.5
DIS_B EQU P1.4 ORG 000BH ;Timer
DIS_C EQU P1.3 Interrupt0
DIS_D EQU P1.1 JMP REFRESH
DIS_E EQU P1.2
DIS_F EQU P1.6 ;
DIS_G EQU P1.7 &&&&&&&&&&&&&&&&&&&&&&&
DIS1 EQU P3.3 &&&&&&&&&&&&&&&&&&&&&&&
DIS2 EQU P3.4 &&&&&&&&&&
DIS3 EQU P3.5 ; MAIN PROGRAM
LDR1 EQU P3.0 ;
LDR2 EQU P3.1 &&&&&&&&&&&&&&&&&&&&&&&
BUZZER EQU P1.0 &&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&
DSEG ; This is internal data MAIN:
memory CLR BUZZER
MOV SPEED,#00H
MOV COUNT,#00H
ORG 20H ; Bit adressable MOV VALUE_1,#00H
memory MOV VALUE_2,#00H
BITS: DS 1 MOV VALUE_3,#00H
UP BIT BITS.0 MOV COUNTER,#00H
DWN BIT BITS.1
COUNT: DS 1
SPEED: DS 1 CLR DIS1
VALUE_1: DS 1 CLR DIS2
VALUE_2: DS 1 CLR DIS3
VALUE_3: DS 1
COUNTER: DS 1
STACK: DS MOV TMOD,#01H ;enable
1 ; Stack begins here timer0 for scanning
CSEG ; Code begins here MOV TL0,#00H
MOV TH0,#0FDH
SETB ET0
;---------==========---------- SETB EA
==========---------=========--------- SETB TR0
; PROCESSOR INTERRUPT
AND RESET VECTORS AJMP ZAZA
;---------==========----------
==========---------=========--------- ASSA: AJMP ASAA
Page 19 of 33
Microcontroller Based Digital Visistor Counter
ZAZA:SETB LDR1
JNB LDR1,ASSA
Page 20 of 33
Microcontroller Based Digital Visistor Counter
Page 21 of 33
Microcontroller Based Digital Visistor Counter
Page 22 of 33
Microcontroller Based Digital Visistor Counter
Page 23 of 33
Microcontroller Based Digital Visistor Counter
Page 24 of 33
Microcontroller Based Digital Visistor Counter
Page 25 of 33
Microcontroller Based Digital Visistor Counter
CALL DISP
AJMP DOWN
QA3: CJNE R4,#03H,QA4
MOV SPEED,VALUE_3
CLR DIS1
CLR DIS2
COMPONENTS DETAILS
4.1. Resistor
Resistor is a component that resists the flow of direct or alternating electric
circuit.
Resistors used in electric circuits are cylindrical. They are often color
coded by three or four color bands that indicate the specific value of resistance.
Resistors obey ohm’s law, which states that the current density is directly
proportional to the electric field when the temperature is constant.
4.2. Capacitor
Capacitor or electric condenser is a device for storing an electric charge.
When one plate is charged with electricity from a direct current or
electrostatic source, the other plate have induced in it a charge of the opposite
sign; that is, positive if the original charge is negative and negative if the original
charge is positive. Capacitors are produced in a wide variety of forms. Air, Mica,
Ceramics, Paper, Oil, and Vacuums are used as dielectrics depending on the
purpose for which the device is intended.
4.3. Transistor
Transistor is a device which transforms current flow from low resistance path to
high resistance path. It is capable of performing many functions of the vacuum
Page 26 of 33
Microcontroller Based Digital Visistor Counter
tube in electronic circuits, the transistor is the solid state device consisting of a
tiny piece of semi conducting material, usually germanium or silicon, to which
three or more electrical connections are made.
4.4 Diode
Diode is a electronic device that allows the passage of current in only one
direction. The diodes commonly used in electronic circuits are semiconductor
diodes. There are different diodes used in electronic circuits such as Junction
diode, Zener diode, Photo diodes, and tunnel diode. Junction diodes consist of
junction of two different kinds of semiconductor material. The Zener diode is a
special junction type diode, using silicon, in which the voltage across the junction
is independent of the current through the junction.
Page 27 of 33
Microcontroller Based Digital Visistor Counter
Page 28 of 33
Microcontroller Based Digital Visistor Counter
The TSOP17.. – series are miniaturized receivers for infrared remote control
systems. PIN diode and preamplifier are assembled on lead frame, the epoxy
package is designed as IR filter. The demodulated output signal can directly be
decoded by a microprocessor. TSOP17.. is the standard IR remote control
receiver series, supporting all major transmission codes.
Features
Photo detector and preamplifier in one package
Internal filter for PCM frequency
Improved shielding against electrical field disturbance
TTL and CMOS compatibility
Output active low
Low power consumption
Page 29 of 33
Microcontroller Based Digital Visistor Counter
Page 30 of 33
Microcontroller Based Digital Visistor Counter
CONCLUSION
5.1 Application
• Visitor counter.
• The counter sensor majority apply in industry or factory.
• Vehicle parking (Counting commodity or counting a car in/out of parking)
Page 31 of 33
Microcontroller Based Digital Visistor Counter
BIBLIOGRAPHY
[1] D. Neamen, Electronic Circuit Analysis and Design. New Mexico: Times
Mirror Higher Education Group Inc., 1996, pp. 69.
http://www.8051projects.info/proj.asp?ID=36
http://www.ehow.com/how_2859_write-bibliography.html
Page 32 of 33
Microcontroller Based Digital Visistor Counter
Page 33 of 33