Sie sind auf Seite 1von 30

BENGAL INSTITUTE OF TECHNOLOGY AND MANAGEMENT

2009-2013

CERTIFICATE
This is to certify that

Chandra Bhanu Pratap Singh Ravi shekhar Priyambada Ojha Tejaswi Parimal Sushant Kumar
Have satisfactorily completed the project entitled

Microcontroller Based Digital Visitor Counter


In fulfillment of the Degree of B.Tech in Electronics & Communication Engineering From BENGAL INSTITUTE OF TECHNOLOGY AND MANAGEMENT Affiliated to the WEST BENGAL UNIVERSITY OF TECHNOLOGY For the academic year 2009-13 Date: ____________

Microcontroller Based Digital Visitor Counter

Page 2 of 30

Microcontroller Based Digital Visitor Counter

PAGE INDEX
Topic ACKNOWLEDMENT ABSTRACT INTRODUCTION PROJECT DESCRIPTION 1.1 2 . BLOCK DIAGRAM EXPLAINATION Page No. 4 5 6 8

1 .

CIRCUIT DIAGRAM AND DESCRIPTION 2.1 2.2 2.3 CIRCUIT DIAGRAM POWER SUPPLY FLOW CHART 15 16 17 18

3 . 4 .

PROGRAM COMPONENTS DETAILS 4.1 4.2 4.3 4.4 4.5 4.6 CONCLUSION 5.1

RESISTOR CAPACITOR TRANSISTOR DIODES INTEGRATED CIRCUIT(IC555) INFRARED SENSORS

25 25 25 26 26 28

5 .

APPLICATIONS BIBLIOGRAPHY PROJECT PRINTOUTS

29 30 31 onwards

Page 3 of 30

Microcontroller Based Digital Visitor Counter

FIGURE INDEX
Figure 1.1 1.2 1.3 2.1 2.2 4.1 4.2 BLOCK DIAGRAM PIN Configuration Block Diagram Circuit diagram of Digital Visitor Counter Power Supply Diagram Pin diagram of IC555 Infrared Sensor Page No. 7 12 13 15 16 27 28

TABLE INDEX
Table 1.1 Pin Description of AT89C2051 Page No. 14

Page 4 of 30

Microcontroller Based Digital Visitor 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 .

Page 5 of 30

Microcontroller Based Digital Visitor 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 30

Microcontroller Based Digital Visitor 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 LCD module. 1. Detect Object (Sensor): Proximity sensor(infrared sensors) 2. Data Processing (CPU): For this project we choose microcontroller 8051 3. 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 7 of 30

Microcontroller Based Digital Visitor Counter

PROJECT DESCRIPTION
Figure 1.1: BLOCK DIAGRAM

Infrared Sensors
TSOP1736

Timer ICs

Micro Controller AT8C2051

Seven segment display

1.1 BLOCK DIAGRAM EXPLANATION


INTELS 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

Page 8 of 30

Microcontroller Based Digital Visitor Counter

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

Page 9 of 30

Microcontroller Based Digital Visitor Counter

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.

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.

Page 10 of 30

Microcontroller Based Digital Visitor Counter

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 11 of 30

Microcontroller Based Digital Visitor 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 Atmels 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.

Figure1.2: PIN Configurations

Page 12 of 30

Microcontroller Based Digital Visitor Counter

Figure 1.3: Block Diagram

Page 13 of 30

Microcontroller Based Digital Visitor Counter

Table 1.1:PIN DESCRIPTION OF AT89C2051 VCC GND Port 1 Supply voltage. Ground. 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 Port 3 receives code data during Flash programming and program verification. 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 onchip 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 RST programming verification. 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 XTAL1 XTAL2 clock cycles. Input to the inverting oscillator amplifier and input to the internal clock operating circuit. Output from the inverting oscillator amplifier.

CIRCUIT DIAGRAM AND DESCRIPTION


Figure 2.1 Circuit Diagram of Digital visitor counter.

Page 14 of 30

Microcontroller Based Digital Visitor Counter

2.2 Power Supply


Figure 2.2. Power Supply Diagram

Page 15 of 30

Microcontroller Based Digital Visitor Counter

+12V IC1 D1 230/ 9V AC 230V AC D4 D3 D2 D(1-4)=1N4007 C1 1 LM7805 2 1000uF/25V 47uF/25V Gnd 3 C2 +5V

The microcontroller and other devices get power supply from AC to Dc adapter 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.

2.3. Flowchart

Page 16 of 30

Microcontroller Based Digital Visitor Counter

Page 17 of 30

Microcontroller Based Digital Visitor Counter

3. PROGRAM
$MOD52 DIS_A EQU DIS_B EQU DIS_C EQU DIS_D EQU DIS_E EQU DIS_F EQU DIS_G EQU DIS1 EQU DIS2 EQU DIS3 EQU LDR1 EQU LDR2 EQU BUZZER DSEG memory P1.5 P1.4 P1.3 P1.1 P1.2 P1.6 P1.7 P3.3 P3.4 P3.5 P3.0 P3.1 EQU P1.0 ; This is internal data ORG 00H JMP ; Reset MAIN ;Timer

ORG 000BH Interrupt0 JMP REFRESH

ORG 20H ; Bit adressable memory BITS: DS 1 UP BIT BITS.0 DWN BIT BITS.1 COUNT: DS 1 SPEED: DS 1 VALUE_1: DS 1 VALUE_2: DS 1 VALUE_3: DS 1 COUNTER: DS 1 STACK: DS 1 ; Stack begins here CSEG ; Code begins here ;---------==========---------==========---------=========--------; PROCESSOR INTERRUPT AND RESET VECTORS ;---------==========---------==========---------=========--------JNB LDR1,ASSA CALL DELAY

; &&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&& ; MAIN PROGRAM ; &&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&& MAIN: CLR BUZZER MOV SPEED,#00H MOV COUNT,#00H MOV VALUE_1,#00H MOV VALUE_2,#00H MOV VALUE_3,#00H MOV COUNTER,#00H CLR DIS1 CLR DIS2 CLR DIS3 MOV TMOD,#01H timer0 for scanning MOV TL0,#00H MOV TH0,#0FDH SETB ET0 SETB EA SETB TR0 AJMP ZAZA ASSA: AJMP ASAA ZAZA:SETB LDR1 ZX3: MOV A,#40 ;enable

Page 18 of 30

Microcontroller Based Digital Visitor Counter

SETB LDR2 JNB LDR2,$ ; &&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&& ; UP COUNTER ; &&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&& SETB BUZZER INC COUNTER MOV R5,COUNTER DOIT: MOV A,#10 CLR C SUBB A,R5 JC ZX1 JZ AQ1 INC VALUE_1 AJMP CVC AQ1: MOV VALUE_2,#01H MOV VALUE_1,#00H AJMP CVC ZX1: MOV A,#20 CLR C SUBB A,R5 JC ZX2 JZ AQ2 INC VALUE_1 AJMP CVC AQ2: MOV VALUE_2,#02H MOV VALUE_1,#00H AJMP CVC ZX2: MOV A,#30 CLR C SUBB A,R5 JC ZX3 JZ AQ3 INC VALUE_1 AJMP CVC AQ3: MOV VALUE_2,#03H MOV VALUE_1,#00H AJMP CVC ZX7: MOV A,#80 CLR C SUBB A,R5 JC ZX8

CLR C SUBB A,R5 JC ZX4 JZ AQ4 INC VALUE_1 AJMP CVC AQ4: MOV VALUE_2,#04H MOV VALUE_1,#00H AJMP CVC ZX4: MOV A,#50 CLR C SUBB A,R5 JC ZX5 JZ AQ5 INC VALUE_1 AJMP CVC AQ5: MOV VALUE_2,#05H MOV VALUE_1,#00H AJMP CVC ZX5: MOV A,#60 CLR C SUBB A,R5 JC ZX6 JZ AQ6 INC VALUE_1 AJMP CVC AQ6: MOV VALUE_2,#06H MOV VALUE_1,#00H AJMP CVC ZX6: MOV A,#70 CLR C SUBB A,R5 JC ZX7 JZ AQ7 INC VALUE_1 AJMP CVC AQ7: MOV VALUE_2,#07H MOV VALUE_1,#00H AJMP CVC ZXX1: MOV VALUE_1,#00H MOV VALUE_2,#00H MOV VALUE_3,#00H

Page 19 of 30

Microcontroller Based Digital Visitor Counter

JZ AQ8 INC VALUE_1 AJMP CVC AQ8: MOV VALUE_2,#08H MOV VALUE_1,#00H AJMP CVC ZX8: MOV A,#90 CLR C SUBB A,R5 JC ZX9 JZ AQ9 INC VALUE_1 AJMP CVC AQ9: MOV VALUE_2,#09H MOV VALUE_1,#00H AJMP CVC ZX9: MOV A,#100 CLR C SUBB A,R5 JC ZX10 JZ AQ10 INC VALUE_1 AJMP CVC AQ10: MOV VALUE_3,#01H MOV VALUE_2,#00H MOV VALUE_1,#00H AJMP CVC ZX10: MOV A,COUNTER CLR C SUBB A,#100 JZ AQQ1 JC ZXX1 MOV R5,A AJMP DOIT AQQ1:MOV VALUE_3,#02H MOV VALUE_2,#00H MOV VALUE_1,#00H AJMP CVC GHG: DEC VALUE_1 AJMP CVCV AAQ1:MOV VALUE_2,#01H MOV VALUE_1,#00H AJMP CVCV AZX1: MOV A,#20

CVC: ; &&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&& CALL DELAY CLR BUZZER JB LDR2,$ AJMP ZAZA ZAZAA: JMP ZAZA ASAA: SETB LDR2 JNB LDR2,ZAZAA CALL DELAY SETB LDR1 JNB LDR1,$ ; &&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&& ; DOWN COUNTER ; &&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&& SETB BUZZER DEC COUNTER MOV R5,COUNTER MOV A,R5 INC A CJNE A,#00H,DOIT1 MOV VALUE_1,#00H MOV VALUE_2,#00H MOV VALUE_3,#00H MOV COUNTER,#00H AJMP CVCV DOIT1: MOV A,#10 CLR C SUBB A,R5 JC AZX1 JZ AAQ1 MOV R6,VALUE_1 CJNE R6,#00H,GHG MOV VALUE_2,#00H MOV VALUE_1,#09H AJMP CVCV MOV R6,VALUE_1 CJNE R6,#00H,GHG3 MOV VALUE_2,#03H MOV VALUE_1,#09H

Page 20 of 30

Microcontroller Based Digital Visitor Counter

CLR C SUBB A,R5 JC AZX2 JZ AAQ2 MOV R6,VALUE_1 CJNE R6,#00H,GHG1 MOV VALUE_2,#01H MOV VALUE_1,#09H AJMP CVCV GHG1: DEC VALUE_1 AJMP CVCV AAQ2:MOV VALUE_2,#02H MOV VALUE_1,#00H AJMP CVCV AZX2: MOV A,#30 CLR C SUBB A,R5 JC AZX3 JZ AAQ3 MOV R6,VALUE_1 CJNE R6,#00H,GHG2 MOV VALUE_2,#02H MOV VALUE_1,#09H AJMP CVCV GHG2: DEC VALUE_1 AJMP CVCV AAQ3:MOV VALUE_2,#03H MOV VALUE_1,#00H AJMP CVCV AZX3: MOV A,#40 CLR C SUBB A,R5 JC AZX4 JZ AAQ4 AZX6: MOV A,#70 CLR C SUBB A,R5 JC AZX7 JZ AAQ7 MOV R6,VALUE_1 CJNE R6,#00H,GHG6 MOV VALUE_2,#06H MOV VALUE_1,#09H

AJMP CVCV GHG3: DEC VALUE_1 AJMP CVCV AAQ4:MOV VALUE_2,#04H MOV VALUE_1,#00H AJMP CVCV AZX4: MOV A,#50 CLR C SUBB A,R5 JC AZX5 JZ AAQ5 MOV R6,VALUE_1 CJNE R6,#00H,GHG4 MOV VALUE_2,#04H MOV VALUE_1,#09H AJMP CVCV GHG4: DEC VALUE_1 AJMP CVCV AAQ5:MOV VALUE_2,#05H MOV VALUE_1,#00H AJMP CVCV AZX5: MOV A,#60 CLR C SUBB A,R5 JC AZX6 JZ AAQ6 MOV R6,VALUE_1 CJNE R6,#00H,GHG5 MOV VALUE_2,#05H MOV VALUE_1,#09H AJMP CVCV GHG5: DEC VALUE_1 AJMP CVCV AAQ6:MOV VALUE_2,#06H MOV VALUE_1,#00H AJMP CVCV GHG8: DEC VALUE_1 AJMP CVCV AAQ9:MOV VALUE_2,#09H MOV VALUE_1,#00H AJMP CVCV

Page 21 of 30

Microcontroller Based Digital Visitor Counter

AJMP CVCV GHG6: DEC VALUE_1 AJMP CVCV AAQ7:MOV VALUE_2,#07H MOV VALUE_1,#00H AJMP CVCV AZX7: MOV A,#80 CLR C SUBB A,R5 JC AZX8 JZ AAQ8 MOV R6,VALUE_1 CJNE R6,#00H,GHG7 MOV VALUE_2,#07H MOV VALUE_1,#09H AJMP CVCV GHG7: DEC VALUE_1 AJMP CVCV AAQ8:MOV VALUE_2,#08H MOV VALUE_1,#00H AJMP CVCV AZX8: MOV A,#90 CLR C SUBB A,R5 JC AZX9 JZ AAQ9 MOV R6,VALUE_1 CJNE R6,#00H,GHG8 MOV VALUE_2,#08H MOV VALUE_1,#09H AJMP CVCV CVCV: ; &&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&& CALL DELAY CLR BUZZER JB LDR1,$ AJMP ZAZA ; &&&&&&&&&&&&&&&&&&&&&&

AZX9: MOV A,#100 CLR C SUBB A,R5 JC AZX10 JZ AAQ10 MOV R6,VALUE_1 CJNE R6,#00H,GHG9 MOV VALUE_3,#00H MOV VALUE_2,#09H MOV VALUE_1,#09H AJMP CVCV GHG9: DEC VALUE_1 AJMP CVCV AAQ10: MOV VALUE_3,#01H MOV VALUE_2,#00H MOV VALUE_1,#00H AJMP CVCV AZX10: MOV A,COUNTER CLR C SUBB A,#100 JZ AAQQ1 JC AZXX1 MOV R5,A MOV A,COUNTER CJNE A,#199,JKJK MOV VALUE_3,#01H JKJK: AJMP DOIT1 AAQQ1: MOV VALUE_3,#02H MOV VALUE_2,#00H MOV VALUE_1,#00H AJMP CVCV AZXX1: MOV VALUE_1,#00H MOV VALUE_2,#00H MOV VALUE_3,#00H RET AS3: CJNE R2,#03H,AS4 CLR DIS_A CLR DIS_B CLR DIS_C CLR DIS_D CLR DIS_G SETB DIS_E SETB DIS_F RET

Page 22 of 30

Microcontroller Based Digital Visitor Counter

&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&& ; 7 SEGMENT DISPLAY ; &&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&& DISP: MOV R2,SPEED CJNE R2,#00H,AAS1 CLR DIS_A CLR DIS_B CLR DIS_C CLR DIS_D CLR DIS_E CLR DIS_F SETB DIS_G RET AAS1: CJNE R2,#01H,AS2 CLR DIS_B CLR DIS_C SETB DIS_A SETB DIS_D SETB DIS_E SETB DIS_F SETB DIS_G RET AS2: CJNE R2,#02H,AS3 CLR DIS_A CLR DIS_B CLR DIS_D CLR DIS_E CLR DIS_G SETB DIS_C SETB DIS_F RET AS8: CJNE R2,#08H,AS9 CLR DIS_A CLR DIS_B CLR DIS_C CLR DIS_D CLR DIS_E CLR DIS_F CLR DIS_G RET AS9: CJNE R2,#09H,AS10 CLR DIS_A CLR DIS_B CLR DIS_C

AS4: CJNE R2,#04H,AS5 CLR DIS_B CLR DIS_C CLR DIS_F CLR DIS_G SETB DIS_A SETB DIS_D SETB DIS_E RET AS5: CJNE R2,#05H,AS6 CLR DIS_A CLR DIS_C CLR DIS_D CLR DIS_F CLR DIS_G SETB DIS_B SETB DIS_E RET AS6: CJNE R2,#06H,AS7 CLR DIS_A CLR DIS_C CLR DIS_D CLR DIS_E CLR DIS_F CLR DIS_G SETB DIS_B RET AS7: CJNE R2,#07H,AS8 CLR DIS_A CLR DIS_B CLR DIS_C SETB DIS_D SETB DIS_E SETB DIS_F SETB DIS_G SETB DIS3 CALL DISP AJMP DOWN QA4: MOV COUNT,#01H MOV R4,COUNT AJMP QA1 DOWN: MOV TL0,#0FFH ;reload the timer for scanning MOV TH0,#0F2H RETI ; &&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&

Page 23 of 30

Microcontroller Based Digital Visitor Counter

CLR DIS_D CLR DIS_F CLR DIS_G SETB DIS_E RET AS10: MOV SPEED,#00H AJMP DISP ; &&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&& REFRESH: INC COUNT MOV R4,COUNT QA1: CJNE R4,#01H,QA2 MOV SPEED,VALUE_1 SETB DIS1 CLR DIS2 CLR DIS3 CALL DISP AJMP DOWN QA2: CJNE R4,#02H,QA3 MOV SPEED,VALUE_2 CLR DIS1 SETB DIS2 CLR DIS3 CALL DISP AJMP DOWN QA3: CJNE R4,#03H,QA4 MOV SPEED,VALUE_3 CLR DIS1 CLR DIS2

&&&&&&&&&&&& DELAY: MOV R1,#0FFH RE1: MOV R2,#5FH RE: NOP DJNZ R2,RE DJNZ R1,RE1 RET END

Page 24 of 30

Microcontroller Based Digital Visitor Counter

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 ohms 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 30

Microcontroller Based Digital Visitor 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 Temperature stability better than 0.005% per C Normally on and normally off output Applications:
Page 26 of 30

Microcontroller Based Digital Visitor Counter

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:

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

Page 27 of 30

Microcontroller Based Digital Visitor Counter

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 30

Microcontroller Based Digital Visitor 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 29 of 30

Microcontroller Based Digital Visitor 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 30

Das könnte Ihnen auch gefallen