micro controller based digital visitor counter

41
Vidyalankar Institute of Technology 2009-2010 Certificate This is to certify that Sumedh.M.More(07-336) Sneha Newalkar(07-339) Prathamesh.B.Sarang(07-349) Have satisfactorily completed the project entitled Microprocessor based Digital Visitor Counter In fulfillment of the Degree of T.E. in Electronics Engineering Affiliated to the UNIVERSITY OF MUMBAI For the academic year 2009-10 Date: ____________

Upload: prathameshas90

Post on 08-Apr-2015

3.983 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Micro Controller Based Digital Visitor Counter

Vidyalankar Institute of Technology2009-2010

Certificate

This is to certify thatSumedh.M.More(07-336)Sneha Newalkar(07-339)

Prathamesh.B.Sarang(07-349)

Have satisfactorily completed the project entitled

Microprocessor based Digital Visitor Counter

In fulfillment of the Degree of T.E. in ElectronicsEngineering Affiliated to theUNIVERSITY OF MUMBAI

For the academic year 2009-10Date: ____________

Page 2: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

PAGE INDEX

Topic Page No.ACKNOWLEDMENT ABSTRACTINTRODUCTION

4 5 6

1. PROJECT DESCRIPTION1.1 BLOCK DIAGRAM

EXPLAINATION 8

2. CIRCUIT DIAGRAM AND DESCRIPTION2.1 CIRCUIT DIAGRAM 152.2 POWER SUPPLY 162.3 FLOW CHART 17

3.

4.

PROGRAM

COMPONENTS DETAILS4.1 4.24.34.44.54.6

RESISTOR CAPACITORTRANSISTORDIODESINTEGRATED CIRCUIT(IC555)INFRARED SENSORS

18

25 25 25 26 26 28

5. CONCLUSION5.1 APPLICATIONS 29

BIBLIOGRAPHY 30

PROJECT PRINTOUTS 31 onwards

Page 2 of 31

Page 3: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

FIGURE INDEX

Figure Page No.

1.1 BLOCK DIAGRAM 71.21.3

PIN ConfigurationBlock Diagram

12 13

2.1 Circuit diagram of Digital Visitor Counter 152.2 Power Supply Diagram 16

4.14.2

Pin diagram of IC555Infrared Sensor

27 28

TABLE INDEX

Table Page No.

1.1 Pin Description of AT89C2051 14

Page 3 of 31

Page 4: Micro Controller Based Digital Visitor Counter

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 are highly obliged to Mr. Shrikant Velankar,H.O.D(Elecronics) for his

noble spontaneous and timely help that carried out us throughout our endeavour

and finally made a grand success.  

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 .  

ABSTRACT

Page 4 of 31

Page 5: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

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 5 of 31

Page 6: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

INTRODUCTION

The proposed system is based on 8051 μcontroller which is in our syllabus.For doing this project we use some of the software like Eagle software is used for designing the PCB for this project.(Since PCB making is a big process and involves lot of machineries which are expensive, we are going to outsource this to the manufacturer.)

IC8051 is one of the popular Microcontroller. It has only 20 pins and there are 15 input/output lines. The microcontroller has a program memory of 2 Kilobytes. The microcontroller continuously monitor the sensor feed and if somebody enters sensors will provide information to the data processing unit.This counter Sensor consist of 3 Section as follows:Detect Object (Sensor), Data Processing (CPU) and final section Display by LCDmodule.

1. Detect Object (Sensor): Proximity sensor(infrared sensors)2. Data Processing (CPU): For this project we choose microcontroller 80513. Display: For final section Display by seven segment display

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. 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. You can reset the counter using switch.

Page 6 of 31

Page 7: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

1. PROJECT DESCRIPTION

Figure 1.1: BLOCK DIAGRAM

Page 7 of 31

Page 8: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

1.1 BLOCK DIAGRAM EXPLANATION

INTEL’S 8051 Architecture

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.

The following list gives the features of the 8051 architecture:

Optimized 8 bit CPU for control applications.

Extensive Boolean processing capabilities.

64K Program Memory address space.

64K Data Memory address space.

128 bytes of onchip Data Memory.

32 Bi directional and individually addressable I/O lines.

Two 16 bit timer/counters.

Full Duplex UART.

6 source / 5 vector interrupt structure with priority levels.

Page 8 of 31

Page 9: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

Onchip clock oscillator.

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.

Central Processing Unit

The CPU is the brain of the microcontrollers reading user's programs and

executing the expected task as per instructions stored there in.

Its primary elements are an 8 bit Arithmetic Logic Unit (ALU),

Accumulator (Acc), few more 8 bit registers, B register, Stack Pointer (SP),

Program Status Word (PSW) and 16 bit registers, Program Counter (PC) and Data

Pointer Register (DPTR). The ALU (Acc) performs arithmetic and logic functions

on 8 bit input variables. Arithmetic operations include basic addition, subtraction,

multiplication and division. Logical operations are AND, OR, Exclusive OR as

well as rotate, clear, complement and etc. Apart from all the above, ALU is

responsible in conditional branching decisions, and provides a temporary place in

data transfer operations within the device. B register is mainly used in multiply

and divide operations. During execution, B register either keeps one of the two

inputs and then retains a portion of the result. For other instructions, it can be

used as another general purpose register.

Page 9 of 31

Page 10: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

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

Direct LED Drive Outputs

On-Chip Analog Comparator

Low Power Idle and Power Down Modes

Page 10 of 31

Page 11: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

Description

The AT89C2051 is a low-voltage, high-performance CMOS 8-bit microcomputer

with 2 Kbytes of Flash Programmable and erasable read only memory (PEROM).

The device is manufactured using Atmel’s high density nonvolatile

memory technology and is compatible with theindustry Standard MCS-51Ô

instruction set and pinout. By combining a versatile 8-bit CPU with Flash on a

monolithic chip, the Atmel AT89C2051 is a powerful microcomputer which

provides a highly flexible and cost effective solution to many embedded control

applications.

Page 11 of 31

Page 12: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

Figure1.2: PIN Configurations

Page 12 of 31

Page 13: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

Figure 1.3: Block Diagram

Page 13 of 31

Page 14: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

Table 1.1:PIN DESCRIPTION OF AT89C2051

VCC Supply voltage.

GND Ground.

Port 1 Port 1 is an 8-bit bidirectional I/O port. Port pins P1.2 to P1.7 provide

internal pullups. P1.0 and P1.1 require external pullups. P1.0 and P1.1

also serve as the positive input (AIN0) and the negative input (AIN1),

respectively, of the on-chip precision analog comparator. The Port 1

output buffers can sink 20 mA and can drive LED displays directly.

When 1s are written to Port 1 pins, they can be used as inputs. When

pins P1.2 to P1.7 are used as inputs and are externally pulled low, they

will source current (IIL) because of the internal pullups. Port 1 also

receives code data during Flash programming and program verification.

Port 3 Port 3 pins P3.0 to P3.5, P3.7 are seven bidirectional I/O pins with

internal pullups. P3.6 is hard-wired as an input to the output of the on-

chip comparator and is not accessible as a general purpose I/O pin. The

Port 3 output buffers can sink 20 mA. When 1s are written to Port 3

pins they are pulled high by the internal pullups and can be used as

inputs. As inputs, Port 3 pins that are externally being pulled low will

source current (IIL) because of the pullups. Port 3 also serves the

functions of various special features of the AT89C2051 as listed below.

Port 3 also receives some control signals for Flash programming and

programming verification.

RST Reset input. All I/O pins are reset to 1s as soon as RST goes high.

Holding the RST pin high for two machine cycles while the oscillator is

running resets the device. Each machine cycle takes 12 oscillator or

clock cycles.

XTAL1 Input to the inverting oscillator amplifier and input to the internal clock

operating circuit.

XTAL2 Output from the inverting oscillator amplifier.

Page 14 of 31

Page 15: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

2. CIRCUIT DIAGRAM AND DESCRIPTION

Figure 2.1 Circuit Diagram of Digital visitor counter.

Page 15 of 31

Page 16: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

2.2 Power Supply

Figure 2.2. Power Supply Diagram

AC230V

D1

D2

1000uF/25V

C1D4

D(1-4)=1N4007

D3

230/ 9V AC+5V1

2

3LM7805

IC1

Gnd

47uF/25V

C2

+12V

The microcontroller and other devices get power supply from AC to Dcadapter through 7805, 5 volts regulator.

The adapter output voltage will be 12V DC unregulated. The 7805/7812 voltage regulators are used to convert 12 V to 5V/12V DC. Vital role of power supply. The adapter output voltage will be 12V DC unregulated. The 7805/7812 voltage regulators are used to convert 12 V to 5V/12V DC.

Page 16 of 31

Page 17: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

2.3. Flowchart

Page 17 of 31

Page 18: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

3.PROGRAM

$MOD52

DIS_A EQU P1.5DIS_B EQU P1.4DIS_C EQU P1.3DIS_D EQU P1.1DIS_E EQU P1.2DIS_F EQU P1.6DIS_G EQU P1.7DIS1 EQU P3.3DIS2 EQU P3.4 DIS3 EQU P3.5LDR1 EQU P3.0LDR2 EQU P3.1BUZZER EQU P1.0

DSEG ; This is internal data memory

ORG 20H ; Bit adressable memory BITS: DS 1

UP BIT BITS.0 DWN BIT BITS.1COUNT: DS 1SPEED: DS 1VALUE_1: DS 1VALUE_2: DS 1VALUE_3: DS 1COUNTER: DS 1STACK: DS

1 ; Stack begins here CSEG ; Code begins here

;---------==========----------==========---------=========---------; PROCESSOR INTERRUPT AND RESET VECTORS;---------==========----------==========---------=========---------

ORG 00H ; Reset JMP MAIN

ORG 000BH ;Timer Interrupt0

JMP REFRESH

;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&; MAIN PROGRAM;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&MAIN:

CLR BUZZERMOV SPEED,#00HMOV COUNT,#00HMOV VALUE_1,#00HMOV VALUE_2,#00HMOV VALUE_3,#00HMOV COUNTER,#00H

CLR DIS1CLR DIS2CLR DIS3

MOV TMOD,#01H;enable timer0 for scanningMOV TL0,#00HMOV TH0,#0FDH SETB ET0SETB EASETB TR0

AJMP ZAZA

ASSA: AJMP ASAA

ZAZA:SETB LDR1

Page 18 of 31

Page 19: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

JNB LDR1,ASSA

CALL DELAYSETB LDR2JNB LDR2,$

;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&; UP COUNTER;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

SETB BUZZERINC COUNTERMOV R5,COUNTER

DOIT: MOV A,#10CLR CSUBB A,R5JC ZX1JZ AQ1 INC VALUE_1AJMP CVC

AQ1: MOV VALUE_2,#01HMOV VALUE_1,#00HAJMP CVC

ZX1: MOV A,#20CLR CSUBB A,R5JC ZX2JZ AQ2INC VALUE_1AJMP CVC

AQ2: MOV VALUE_2,#02HMOV VALUE_1,#00HAJMP CVC

ZX2: MOV A,#30CLR CSUBB A,R5JC ZX3JZ AQ3INC VALUE_1AJMP CVC

AQ3: MOV VALUE_2,#03HMOV VALUE_1,#00HAJMP CVC

ZX3: MOV A,#40CLR CSUBB A,R5JC ZX4JZ AQ4INC VALUE_1AJMP CVC

AQ4: MOV VALUE_2,#04HMOV VALUE_1,#00HAJMP CVC

ZX4: MOV A,#50CLR CSUBB A,R5JC ZX5JZ AQ5INC VALUE_1AJMP CVC

AQ5: MOV VALUE_2,#05HMOV VALUE_1,#00HAJMP CVC

ZX5: MOV A,#60CLR CSUBB A,R5JC ZX6JZ AQ6INC VALUE_1AJMP CVC

AQ6: MOV VALUE_2,#06HMOV VALUE_1,#00HAJMP CVC

ZX6: MOV A,#70CLR CSUBB A,R5JC ZX7JZ AQ7INC VALUE_1AJMP CVC

AQ7: MOV VALUE_2,#07HMOV VALUE_1,#00HAJMP CVC

Page 19 of 31

Page 20: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

ZX7: MOV A,#80CLR CSUBB A,R5JC ZX8JZ AQ8INC VALUE_1AJMP CVC

AQ8: MOV VALUE_2,#08HMOV VALUE_1,#00HAJMP CVC

ZX8: MOV A,#90CLR CSUBB A,R5JC ZX9JZ AQ9INC VALUE_1AJMP CVC

AQ9: MOV VALUE_2,#09HMOV VALUE_1,#00HAJMP CVC

ZX9: MOV A,#100CLR CSUBB A,R5JC ZX10JZ AQ10INC VALUE_1AJMP CVC

AQ10: MOV VALUE_3,#01HMOV VALUE_2,#00HMOV VALUE_1,#00HAJMP CVC

ZX10: MOV A,COUNTERCLR CSUBB A,#100JZ AQQ1JC ZXX1MOV R5,AAJMP DOIT

AQQ1:MOV VALUE_3,#02HMOV VALUE_2,#00HMOV VALUE_1,#00HAJMP CVC

ZXX1: MOV VALUE_1,#00HMOV VALUE_2,#00HMOV VALUE_3,#00H

CVC:;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

CALL DELAYCLR BUZZERJB LDR2,$AJMP ZAZA

ZAZAA: JMP ZAZAASAA: SETB LDR2

JNB LDR2,ZAZAA

CALL DELAYSETB LDR1JNB LDR1,$

;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&; DOWN COUNTER;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

SETB BUZZERDEC COUNTERMOV R5,COUNTERMOV A,R5INC ACJNE A,#00H,DOIT1MOV VALUE_1,#00HMOV VALUE_2,#00HMOV VALUE_3,#00HMOV COUNTER,#00HAJMP CVCV

DOIT1:MOV A,#10CLR CSUBB A,R5JC AZX1JZ AAQ1 MOV R6,VALUE_1CJNE R6,#00H,GHGMOV VALUE_2,#00HMOV VALUE_1,#09HAJMP CVCV

Page 20 of 31

Page 21: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

GHG:DEC VALUE_1AJMP CVCV

AAQ1:MOV VALUE_2,#01HMOV VALUE_1,#00HAJMP CVCV

AZX1: MOV A,#20CLR CSUBB A,R5JC AZX2JZ AAQ2MOV R6,VALUE_1CJNE R6,#00H,GHG1MOV VALUE_2,#01HMOV VALUE_1,#09HAJMP CVCV

GHG1:DEC VALUE_1AJMP CVCV

AAQ2:MOV VALUE_2,#02HMOV VALUE_1,#00HAJMP CVCV

AZX2: MOV A,#30CLR CSUBB A,R5JC AZX3JZ AAQ3MOV R6,VALUE_1CJNE R6,#00H,GHG2MOV VALUE_2,#02HMOV VALUE_1,#09HAJMP CVCV

GHG2:DEC VALUE_1AJMP CVCV

AAQ3:MOV VALUE_2,#03HMOV VALUE_1,#00HAJMP CVCV

AZX3: MOV A,#40CLR CSUBB A,R5JC AZX4JZ AAQ4

MOV R6,VALUE_1CJNE R6,#00H,GHG3MOV VALUE_2,#03HMOV VALUE_1,#09HAJMP CVCV

GHG3:DEC VALUE_1AJMP CVCV

AAQ4:MOV VALUE_2,#04HMOV VALUE_1,#00HAJMP CVCV

AZX4: MOV A,#50CLR CSUBB A,R5JC AZX5JZ AAQ5MOV R6,VALUE_1CJNE R6,#00H,GHG4MOV VALUE_2,#04HMOV VALUE_1,#09HAJMP CVCV

GHG4:DEC VALUE_1AJMP CVCV

AAQ5:MOV VALUE_2,#05HMOV VALUE_1,#00HAJMP CVCV

AZX5: MOV A,#60CLR CSUBB A,R5JC AZX6JZ AAQ6MOV R6,VALUE_1CJNE R6,#00H,GHG5MOV VALUE_2,#05HMOV VALUE_1,#09HAJMP CVCV

GHG5:DEC VALUE_1AJMP CVCV

AAQ6:MOV VALUE_2,#06HMOV VALUE_1,#00HAJMP CVCV

Page 21 of 31

Page 22: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

AZX6: MOV A,#70CLR CSUBB A,R5JC AZX7JZ AAQ7MOV R6,VALUE_1CJNE R6,#00H,GHG6MOV VALUE_2,#06HMOV VALUE_1,#09HAJMP CVCV

GHG6:DEC VALUE_1AJMP CVCV

AAQ7:MOV VALUE_2,#07HMOV VALUE_1,#00HAJMP CVCV

AZX7: MOV A,#80CLR CSUBB A,R5JC AZX8JZ AAQ8MOV R6,VALUE_1CJNE R6,#00H,GHG7MOV VALUE_2,#07HMOV VALUE_1,#09HAJMP CVCV

GHG7:DEC VALUE_1AJMP CVCV

AAQ8:MOV VALUE_2,#08HMOV VALUE_1,#00HAJMP CVCV

AZX8: MOV A,#90CLR CSUBB A,R5JC AZX9JZ AAQ9MOV R6,VALUE_1CJNE R6,#00H,GHG8MOV VALUE_2,#08HMOV VALUE_1,#09HAJMP CVCV

GHG8:DEC VALUE_1AJMP CVCV

AAQ9:MOV VALUE_2,#09HMOV VALUE_1,#00HAJMP CVCV

AZX9: MOV A,#100CLR CSUBB A,R5JC AZX10JZ AAQ10MOV R6,VALUE_1CJNE R6,#00H,GHG9MOV VALUE_3,#00HMOV VALUE_2,#09HMOV VALUE_1,#09HAJMP CVCV

GHG9:DEC VALUE_1AJMP CVCV

AAQ10: MOV VALUE_3,#01HMOV VALUE_2,#00HMOV VALUE_1,#00HAJMP CVCV

AZX10: MOV A,COUNTERCLR CSUBB A,#100JZ AAQQ1JC AZXX1MOV R5,AMOV A,COUNTERCJNE A,#199,JKJKMOV VALUE_3,#01H

JKJK:AJMP DOIT1

AAQQ1: MOV VALUE_3,#02HMOV VALUE_2,#00HMOV VALUE_1,#00HAJMP CVCV

AZXX1: MOV VALUE_1,#00HMOV VALUE_2,#00HMOV VALUE_3,#00H

Page 22 of 31

Page 23: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

CVCV:

;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

CALL DELAYCLR BUZZERJB LDR1,$AJMP ZAZA

;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&; 7 SEGMENT DISPLAY;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&DISP:

MOV R2,SPEEDCJNE R2,#00H,AAS1CLR DIS_ACLR DIS_BCLR DIS_CCLR DIS_DCLR DIS_ECLR DIS_FSETB DIS_GRET

AAS1: CJNE R2,#01H,AS2CLR DIS_BCLR DIS_CSETB DIS_ASETB DIS_DSETB DIS_ESETB DIS_FSETB DIS_GRET

AS2: CJNE R2,#02H,AS3CLR DIS_ACLR DIS_BCLR DIS_DCLR DIS_ECLR DIS_GSETB DIS_CSETB DIS_F

RETAS3: CJNE R2,#03H,AS4

CLR DIS_A CLR DIS_BCLR DIS_CCLR DIS_DCLR DIS_GSETB DIS_ESETB DIS_FRET

AS4: CJNE R2,#04H,AS5CLR DIS_BCLR DIS_CCLR DIS_FCLR DIS_GSETB DIS_ASETB DIS_DSETB DIS_ERET

AS5: CJNE R2,#05H,AS6CLR DIS_ACLR DIS_CCLR DIS_DCLR DIS_FCLR DIS_GSETB DIS_BSETB DIS_ERET

AS6: CJNE R2,#06H,AS7CLR DIS_ACLR DIS_CCLR DIS_DCLR DIS_ECLR DIS_FCLR DIS_GSETB DIS_BRET

AS7: CJNE R2,#07H,AS8CLR DIS_ACLR DIS_BCLR DIS_CSETB DIS_DSETB DIS_ESETB DIS_FSETB DIS_G

Page 23 of 31

Page 24: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

RETAS8: CJNE R2,#08H,AS9

CLR DIS_ACLR DIS_BCLR DIS_CCLR DIS_DCLR DIS_ECLR DIS_FCLR DIS_GRET

AS9: CJNE R2,#09H,AS10CLR DIS_ACLR DIS_BCLR DIS_CCLR DIS_DCLR DIS_FCLR DIS_GSETB DIS_ERET

AS10: MOV SPEED,#00HAJMP DISP

;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&REFRESH:

INC COUNTMOV R4,COUNT

QA1: CJNE R4,#01H,QA2MOV SPEED,VALUE_1SETB DIS1CLR DIS2CLR DIS3CALL DISP AJMP DOWN

QA2: CJNE R4,#02H,QA3MOV SPEED,VALUE_2CLR DIS1SETB DIS2CLR DIS3CALL DISP AJMP DOWN

QA3: CJNE R4,#03H,QA4MOV SPEED,VALUE_3CLR DIS1CLR DIS2

SETB DIS3CALL DISP AJMP DOWN

QA4: MOV COUNT,#01HMOV R4,COUNTAJMP QA1

DOWN: MOV TL0,#0FFH;reload the timer for scanningMOV TH0,#0F2HRETI

;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

DELAY:MOV R1,#0FFH

RE1: MOV R2,#5FHRE: NOP

DJNZ R2,REDJNZ R1,RE1RET

END

Page 24 of 31

Page 25: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

4. 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

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.

Page 25 of 31

Page 26: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

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.

4.5. Integrated Circuits

Timer IC (555)

It is a highly stable device for generating accurate time delays or oscillation.

Additional terminals are provided for triggering or resetting if desired. In the time

delay mode of operation, the time is precisely controlled by one external resistor

and capacitor. For astable operation as an oscillator, the free running frequency

and duty cycle are accurately controlled with two external resistors and one

capacitor. The circuit may be triggered and reset on falling waveforms, and the

output circuit can source or sink up to 200mA or drive TTL circuits.

Features:

Direct replacement for SE555/NE555

Timing from microseconds through hours

Operates in both astable and monostable modes

Adjustable duty cycle

Output can source or sink 200 mA

Output and supply TTL compatible

Page 26 of 31

Page 27: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

Temperature stability better than 0.005% per °C

Normally on and normally off output

Applications:

Precision timing

Pulse generation

Sequential timing

Time delay generation

Pulse width modulation

Pulse position modulation

Linear ramp generator

Figure 4.1 PIN Diagram of Timer IC:

Page 27 of 31

Page 28: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

4.5. Infrared sensors

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.

Figure 4.2 Infrared sensor

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 High immunity against ambient light Continuous data transmission possible (up to 2400 bps) Suitable burst length 10 cycles/burst Output active low

Page 28 of 31

Page 29: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

5. 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 29 of 31

Page 30: Micro Controller Based Digital Visitor Counter

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.

[2]Microchip, AT89C2051 Data Sheet, Microchip Technology Inc., 2003

[3] Help for The 555 Timer Chip,

http://www2.ebtech.net/~pais/555_Timer_Help.html.

[4]“ FREE Microcontroller projects”,

http://www.8051projects.info/proj.asp?ID=36

[5]eHow.com,“How to Write a Bibliography”,

http://www.ehow.com/how_2859_write-bibliography.html

Page 30 of 31

Page 31: Micro Controller Based Digital Visitor Counter

Microcontroller Based Digital Visistor Counter

Page 31 of 31