Beruflich Dokumente
Kultur Dokumente
ON
CERTIFICATE
This is certified that satish chander has carried out project
work presented in this thesis entitled bidirectional visitor
counter for the award of IETE, under my supervision.
The report embodies result of original work and studies
carried out by student himself and the contents of the thesis
do not form the basis for the awrd of any other degree or
diploma to the candidate or to anybody else.
ACKNOWLEDGEMENT
I am very much thankful from the core of my heart for the
precious contribution of my guide who provided his
possible help the succses ful completion of the project has
been possible due to sincere co operation guidance ,
inpiration, moral support and timely advice of my guide
who ddevoted his utmost co operation in this project work.
I also give special thanks to my colleagues for that endless
flow of ideas and all those who helped in this project in
some way or the other.
SATISH CHANDER
SG 188152 W
BLOCK DIAGRAM:
CIRCUIT DESCRIPTION:
CIRCUIT DIAGRAM:
IR S E N S O R P A IR 1
IR S E N S O R P A IR 2
5 V
5 V
5V
5V
R 2
R
R 2
R
470 E
3
D 2
2
D 1
Q 1A
D 1
LE D
D 2
3
470 E
LE D
LED
Q 1A
LE D
R 3
R
T R AN S M IT T E R 2
T R A N S M IT T E R 1
P 0 .0
R 3
R
R E C E IV E R 1
R E C E IV E R 2
P 0 .2
P 0 .3
P 0 .4
P 0 .5
1
2
3
4
5
6
7
8
19
18
I R R e c e iv e r 1
I R R e c e iv e r 2
P 0 .6
P 0 .7
1 1 .0 5 9 2 M H z
31
9
22pf
22pf
40
+5V
10m f
+5V
S W IT C H
+5V
P
P
P
P
P
P
P
P
0
0
0
0
0
0
0
0
.0 /A
.1 /A
.2 /A
.3 /A
.4 /A
.5 /A
.6 /A
.7 /A
P
P
P
P
P
P
P
P
1
1
1
1
1
1
1
1
.0
.1
.2
.3
.4
.5
.6
.7
D
D
D
D
D
D
D
D
0
1
2
3
4
5
6
7
P 2 .0 /A 8
P 2 .1 /A 9
P 2 .2 /A 1 0
P 2 .3 /A 1 1
P 2 .4 /A 1 2
P 2 .5 /A 1 3
P 2 .6 /A 1 4
P 2 .7 /A 1 5
P 3 .0 /R XD
P 3 .1 /TXD
P 3 .2 /IN T 0
P 3 .3 /IN T 1
P 3 .4 /T 0
P 3 .5 /T 1
P 3 .6 /W R
P 3 .7 /R D
X1
X2
ALE
PSEN
EA
R ST
VC C
8051
G N D
39
38
37
36
35
34
33
32
20
P 0 .1
2
2
2
2
2
2
2
2
1
2
3
4
5
6
7
8
1
1
1
1
1
1
1
1
0
1
2
3
4
5
6
7
30
29
4.7 K
T2
T1
P 1 .1
P 1 .0
4.7 K 4 .7 K
1
2
3
4
5
6
7
8
S1
g f
P 0 .0
P 0 .1
P 0 .2
P 0 .3
P 0 .4
P 0 .5
10 K
P 0 .6
P 0 .7
f
a
f
e
h
e
c
e d
a
g
g
b
S2
a b
b
c
c h
S E V E N S E G M E N T D IS P L A Y
CODING:
#include <reg51.h>
#define msec 1
unsigned int num=0;
sbit dig_ctrl_4=P1^3; //declare the control pins of
seven segments
sbit dig_ctrl_3=P1^2;
sbit dig_ctrl_2=P1^1;
sbit dig_ctrl_1=P1^0;
unsigned int
digi_val[10]={0x40,0xF9,0x24,0x30,0x19,0x12,0x02,0xF8
,0x00,0x10};
unsigned int dig_1,dig_2,dig_3,dig_4,test=0;
unsigned char dig_disp=0;
sbit up=P3^5; //up pin to make counter count up
sbit down=P3^6; //down pin to make counter count
down
TR0=1;
while(TF0==0);
TR0=0;
TF0=0;
}
case 0:
P2= digi_val[dig_1];
dig_ctrl_1 = 1;
break;
case 1:
P2= digi_val[dig_2];
dig_ctrl_2 = 1;
break;
case 2:
P2= digi_val[dig_3];
dig_ctrl_3 = 1;
break;
case 3:
P2= digi_val[dig_4];
dig_ctrl_4 = 1;
break;
}
void main()
{
init();
while(1)
{
if(up==0&&down==1) //check if up pin is pressed
{
test++;
num=test;
dig_4=num%10;
num=num/10;
dig_3=num%10;
num=num/10;
dig_2=num%10;
dig_1=num/10;
if(test==9999)
test=0;
}
if(up==1&&down==0) //check if down pin is
pressed
{
test--;
num=test;
dig_4=num%10;
num=num/10;
dig_3=num%10;
num=num/10;
dig_2=num%10;
dig_1=num/10;
if(test==0)
test=9999;
}
}
}
BASIC COMPONENTS
CRYSTAL OSCILLATOR:
FEATURES
RESISTORS
Fig 5.5 Resistors
A resistor is a two-terminal
electronic component that produces a voltage across its
terminals that is proportional to the electric current passing through
it in accordance with Ohm's law:
V = IR
films, as well as resistance wire (wire made of a highresistivity alloy, such as nickel/chrome).
The primary characteristics of a resistor are the resistance,
the tolerance, maximum working voltage and the power
rating. Other characteristics include temperature
coefficient, noise, and inductance. Less well-known is
critical resistance, the value below which power dissipation
limits the maximum permitted current flow, and above
which the limit is applied voltage. Critical resistance
depends upon the materials constituting the resistor as well
as its physical dimensions; it's determined by design.
Resistors can be integrated into hybrid and printed circuits,
as well as integrated circuits. Size, and position of leads (or
terminals) are relevant to equipment designers; resistors
must be physically large enough not to overheat when
dissipating their power.
FUNCTION
CAPACITORS:
Fig 5.8 Capacitor
BASIC
TYPES OF CAPACITORS:
ELECTROLYTIC CAPACITOR
DESCRIPTION OF IR SENSOR
DIODE:
Working of Diode:
TYPES OF DIODE:
Construction:
2.
Short circuited: In short circuited condition, the sum
voltage in the loop must be zero. So it is assumed, that the
potential barrier at the PN junction is compensated by the
potential drops at the metal semiconductor junctions. The
holes supplied by the n-region must be driven to the p
region which is physically impossible. The similar
discussion applies to the electron current in the n-region.
3.
Forward bias: In forward bias condition, higher or
positive potential is applied at the anode and negative or
lower potential is applied at the cathode of a diode. The
positive potential at anode repels the holes in p-region
towards n-region while negative potential at the cathode
repels electrons in n-region towards p-region. Thus, the
height of the potential barrier reduces. The depletion region
disappears when the applied voltage equals to the potential
barrier and a large current flows through the diode. The
voltage required to drive the diode into a state of
conduction is called as the Cut in/Offset/Threshold/Firing
voltage. The current is of considerable magnitude as it is
dominantly constituted by the majority charge currents that
is the hole current in the p-region and the electron current
in the n-region. The current that flows from anode to
cathode is limited by the crystal bulk resistance,
recombination of charges and the ohmic contact resistances
4.
Reverse Bias: In reverse bias condition, the higher
or positive potential is applied at the cathode and negative
or lower potential is applied at the anode. The negative
potential at anode attracts the holes in p-region that are
away from the n-region while positive potential at the
cathode attracts electrons in n-region that are away from
the p-region. The applied voltage increases the height of the
potential barrier. The current flows dominantly due to the
minority charge currents that is the electron current in pregion and the hole current in n-region. Thus a constant
current of negligible magnitude flows in the reverse
direction which is called as the Reverse saturation
current. Practically, the diode remains in a state of non
conduction. The reverse saturation current is of the order of
microamperes in a germanium diode or nanoamperes in a
silicon diode If the reverse voltage exceeds the limit of
breakdown/zener/Peak inverse/Peak reverse voltage, the
potential breakdown that occurs leads to a large reverse
current.
Characteristics:
AC or dynamic resistance: It is the ratio of change in
diode voltage to the change in diode current. It is defined at
a point on the characteristic curves over a tangent.
CD -
diffusion
capacitance
dQ - change in charge stored in depletion region
V - change in applied voltage
- time interval for change in voltage
g - diode conductance
r - diode resistance
The diffusion capacitance at low frequencies is given by
the
formula:
Application:
2.
Clipper- Diode can be used to clip off some portion
of pulse without distorting the remaining part of the
waveform. The figure is as shown below:
3.
Clamper A clamping circuit restricts the voltage
levels to exceed a limit by shifting the DC level. The peak
to peak is not affected by clamping. Diodes with resistors
and capacitors are used to make clamping circuits.
Sometimes independent DC sources can be used to provide
additional shift. The figure is as shown below:
Datasheet Analysis:
Capacitance levels,
rse recovery time,
Testing of a diode:
1.
Insert the probes into the required sockets: The digital
multimeter will have several sockets for the test probes.
Insert these probes and check if they are already in the
correct sockets. Typically, these are labeled COM for
common and the others for current or voltage. This is
normally combined with the voltage measurement socket.
2.
Turn on the multimeter and select the maximum
resistance range.
3.
Check resistance in forward and reverse direction.
Place the red probe on diode anode and black probe on the
cathode to measure the forward resistance. Place the red
probe on diode cathode and black probe on anode to
measure the backward resistance. The forward resistance
must be very small in few ohms while backward resistance
must be very high in the range of mega ohms. If forward
resistance is very high the diode is open circuited and if
backward resistance is very small diode will be short
circuited.
4.
Another way is to select diode on the multimeter.
Place the red probe on diode anode and black probe on the
cathode and of the multimeter beeps then it indicates a
short circuit otherwise it is open. Place the red probe on
diode cathode and black probe on the anode and if the
multimeter does not beep then it indicates an open circuit
otherwise if it beeps the diode is short.
5.
Turn off the multimeter: Once the resistance
measurement has been made, the multimeter can be turned
off to preserve the batteries. It is also wise to turn the
function switch to a high voltage range. In this way, if the
multimeter is used again for another type of reading then no
MICROCONTROLLER(AT89C51)
Introduction
built into it. Thus, we save the time and space needed to
construct devices
Memory unit
end, or after the 8th bit, let us bring the logical unit "1"
back on the line which will mark the end of the
transmission of one data. The protocol we've just described
is called in professional literature NRZ (Non-Return to
Zero).
Figure2.8: Watchdog
Of course, when this happens with a computer, we simply
reset it and it will keep working. However, there is no reset
button we can push on the microcontroller and thus solve
our problem. To overcome this obstacle, we need to
introduce one more block called watchdog. This block is in
fact another free-run counter where our program needs to
write a zero in every time it executes correctly. In case that
program gets "stuck", zero will not be written in, and
counter alone will reset the microcontroller upon achieving
its maximum value. This will result in executing the
program again, and correctly this time around. That is an
important element of every program to be reliable without
man's supervision.
Analog to Digital Converter
PIN CONFIGURATION
Pins 32-39
PORT 1
Pins 1 through 8
No dual function
PORT 2
Pins 21 through 28
PORT 3
Pins 10 through 17
No external pull up resistors required
RAM ARCHITECTURE
The 8051 uses 8 "R" registers which are used in many of its
instructions. These "R" registers are numbered from 0
through 7 (R0, R1, R2, R3, R4, R5, R6, and R7).These
registersare generally used to assist in manipulating values
and moving data from one memory location to another. The
concept of register banks adds a great level of flexibility to
the 8051.
Bit Memory
The "R" registers are a set of eight registers that are named
R0, R1, etc. up to and including R7. These registers are
used as auxiliary registers in many operations.
The Stack Pointer, like all registers except DPTR and PC,
may hold an 8-bit (1-byte) value. The Stack Pointer is used
to indicate where the next value to be removed from the
stack.
Addressing Modes
L14G2 PHOTOTRANSISTOR
L14G2 is an NPN phototransistor. It acts as a photodetector
in the sense that it can convert the incident light into
electric response. They are commonly used as sensors
usually paired with a light source like LED.
These are the bipolar transistors having a transparent case.
This transparent case exposes the base collector region of
transistor to external light. When light incidents on this
junction, electrons are generated by the photons. These
electrons are injected in the base of phototransistor. The
current gain of the transistor amplifies the resulting
photocurrent at the base collector junction. Thus a
phototransistor conducts in the presence of light and
remains in off mode in absence of light. The maximum
dark current is 100nA; while in light its current is 500A.
A phototransistor is different from a simple transistor in the
way that in the latter, voltage applied to the base is replaced
by light striking it. Simply put, a phototransistor amplifies
variations in the light striking it.
*Phototransistors may or may not have a base terminal. If a
base terminal is available, it is used to bias its light
response.
Photodiodes can also be used for similar function as
phototransistors, but they have much lower gain and thus
lower photocurrent. Phototransistors cannot detect low
intensities of light but are more responsive to the exposed
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.
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
IR 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.
The appearance is same as a common LED. Since
the human eye cannot see the infrared radiations, it is
not possible for a person to identify whether the IR
LED is working or not, unlike a common LED. To
overcome this problem, the camera on a cellphone
can be used. The camera can show us the IR rays
being emanated from the IR LED in a circuit.
Pin Diagram:
SEVEN SEGMENT:
Hex
valu
e
24
77
a1
61
72
68
28
75
20
60