Professional Documents
Culture Documents
Automatic Power Saver
Automatic Power Saver
CHAPTER:1
-1-
Visitor counting is simply a measurement of the visitor traffic entering and exiting
offices, malls, sports venues, etc. Counting the visitors help to maximize the efficiency and
effectiveness of employees, floor area and sales potential of an organization.
Visitor counting is not limited to the entry/exit point of a company but has a wide range
of applications that provide information to management on the volume and flow of people
throughout a location. A primary method for counting the visitors involves hiring human auditors
to stand and manually tally the number of visitors who pass by a certain location. But humanbased data collection comes a great expense.
Here is a low-cost microcontroller-based visitor counter that can be used to know the
number of person at a place. All the components required are readily available in the market and
the circuit is easy to build.
Two IR transmitter-receiver pairs are used at the passage: one pair comprising IR
transmitter IR TX1 and receiver phototransistor T1 is installed at the entry point of the passage,
while the other pair comprising IR transmitter IR TX2 and phototransistor T2 is installed at the
exit of the passage. The IR signals from the IR LEDs should continuously fall on the respective
phototransistors, so proper orientation of the transmitter and phototransistor is necessary.
.
-2-
CHAPTER: 2
-3-
-4-
PRINCIPLE:
From the block diagram it is clear that the sensor pairs are placed face to face so
that an IR radiations from IR LED are continuously received by phototransistor
which makes its emitter base junction forward and collector current Ic equals to
emitter current Ie (i.e, Ic=Ie) assuming base current to be negligible. Hence the
voltage at collector node becomes zero (logic 0) which is feed to microcontroller
port pin P3.2 and P3.3, if any object is placed in between the sensor pair blocks the
IR radiation which in turns put the phototransistor in cut-off mode and Ic!=Ie, this
makes collector voltage to +5V (logic 1)
In our program we have to poll both the inputs from both the sensors at port pin
P3.2 and P3.3 to detect for the entry or exit, if sensor pair one is been obstructed
(P3.2 becomes one) first, implies persons entry and second pair is obstructed (P3.3
becomes one) first shows exit. After obstructed any one sensor we have to poll for
the next sensor to determine a complete entry or exit.
CIRCUIT DESCRIPTION
-5-
-6-
The circuit is powered by regulated 5V. Fig.3 shows the circuit of the power supply. The
AC mains is stepped down by transformer X1 to deliver secondary output of 7.5V, 250mA,
which is rectified by bridge rectifier BR1, filtered by capacitor C6 and regulated by IC 7805
(IC4). Capacitor C7 bypasses any ripple in the regulated output.
-7-
PARTS LIST:
Semiconductors:
R1, R2...........................68-ohm
R3, R4...........................6.8-kilo-ohm
R5, R6...........................100-ohm
R7, R8, R10, R11..........10-kilo-ohm
R9.................................4.7-kilo-ohm
R12-R32.......................220-ohm
VR1, VR2.....................20-kilo-ohm resistor Network
Capacitors:
Miscellaneous:
XTAL..............................................12MHz crystal
X1....................................................230V primary to 7.5V,
250mA secondary transformer
S1....................................................Push-to-on switch
S2....................................................On /off switch
-8-
-9-
- 10 -
CHAPTER: 3
- 11 -
- 12 -
Applications:
Telecom:
Mobile phone system (handset and base station), modems and routers.
Automotive application:
Braking system, tracking control, Airbag release system, management unit and Steerby- wire systems .
Domestic application:
- 13 -
14
Aerospace application:
Medical equipment:
Anesthesia monitoring systems, ECG monitor, pacemaker, drug delivery systems.
Defense system:
Radar systems, fighter aircraft flight controller systems, Radio systems, missile
guideline systems .
Office automation:
Laser printers, Fax machines, Pagers, Cash registers, gas pumps, Credit/Davit card
readers, Thermostats, Grain analyzers.
90.0%
80.0%
70.0%
1998-1999
60.0%
1999-2000
50.0%
40.0%
30.0%
20.0%
10.0%
0.0%
Assembly
C++
- 14 -
Java
Other
CHAPTER: 3
- 15 -
AT89C52
MICROCONTROLLER
17
Description:
The AT89C52 is a low-power, high-performance CMOS 8-bit microcomputer with 8K
bytes of Flash programmable and erasable read only memory (PEROM). The device is
manufactured using Atmels high-density nonvolatile memory technology and is compatible with
the industry-standard 80C51 and 80C52 instruction set and pin out.
The on-chip Flash allows the program memory to be reprogrammed in-system or by a
conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash
on a monolithic chip, the Atmel AT89C52 is a powerful microcomputer which provides a highlyflexible and cost-effective solution to many embedded control applications.
- 17 -
- 18 -
Pin Description:
VCC
Supply voltage.
GND
Ground.
Port 0
Port 0 is an 8-bit open drain bi-directional I/O port. As an output port, each pin can sink
eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance
inputs.
Port 0 can also be configured to be the multiplexed low order address/data bus during
accesses to external program and data memory. In this mode, P0 has internal pull-ups.
Port 0 also receives the code bytes during Flash programming and outputs the code bytes
during program verification. External pull-ups are required during program verification.
Port 1
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output buffers
can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by
the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull-ups.
- 19 -
Port 1 also receives the low-order address bytes during Flash programming and
verification.
Port 2
Port 2 is an 8-bit bi-directional I/O port with internal pullups. The Port 2 output buffers
can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by
the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally
being pulled low will source current (IIL) because of the internal pullups.
Port 2 emits the high-order address byte during fetches from external program memory
and during accesses to external data memory that uses 16-bit addresses (MOVX @ DPTR).
In this application, Port 2 uses strong internal pullups when emitting 1s. During accesses to
external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of
the P2 Special Function Register.
Port 2 also receives the high-order address bits and some control signals
during Flash programming and verification.
Port 3
Port 3 is an 8-bit bi-directional I/O port with internal pullups. The Port 3 output buffers
can sink/source four TTL inputs. 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 AT89C51, as shown in
the following table.
- 20 -
20
Port 3 also receives some control signals for Flash programming and verification.
RST:
Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device.
ALE/PROG:
Address Latch Enable is an output pulse for latching the low byte of the address during
accesses to external memory.
This pin is also the program pulse input (PROG) during Flash programming. In
normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency
and may be used for external timing or clocking purposes. Note, however, that one
ALE pulse is skipped during each access to external data memory.
If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the
bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly
pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external
execution mode.
PSEN:
Program Store Enable is the read strobe to external program memory. When the AT89C52
is executing code from external program memory, PSEN is activated twice each machine cycle,
except that two PSEN activations are skipped during each access to external data memory.
- 21 -
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2
Output from the inverting oscillator amplifier.
- 22 -
22
23
A map of the on-chip memory area called the Special Function Register (SFR) space is
shown in Table 1. Note that not all of the addresses are occupied, and unoccupied addresses may
not be implemented on the chip. Read accesses to these addresses will in general return random
data, and write accesses will have an indeterminate effect.
User software should not write 1s to these unlisted locations, since they may be used in
future products to invoke new features. In that case, the reset or inactive values of the new bits
will always be 0.
Timer 2 Registers Control and status bits are contained in registers T2CON (shown in
Table 2) and T2MOD (shown in Table 4) for Timer 2. The register pair (RCAP2H, RCAP2L) is
the Capture/Reload registers for Timer 2 in 16-bit capture mode or 16-bit auto-reload mode.
Interrupt registers the individual interrupt enable bits are in the IE register. Two priorities
can be set for each of the six interrupt sources in the IP register.
- 23 -
- 24 -
25
The AT89C52 implements 256 bytes of on-chip RAM. The upper 128 bytes occupy a
parallel address space to the special Function Registers. That means the upper 128 bytes have the
same addresses as the SFR space but are physically separate from SFR space.
When an instruction accesses an internal location above address 7FH, the address mode
used in the instruction specifies whether the CPU accesses the upper 128 bytes of RAM or the
SFR space. Instructions that use direct addressing access SFR space.
For example, the following direct addressing instruction accesses the SFR at location
0A0H (which is P2).
Timer 0 and 1
Timer 0 and Timer 1 in the AT89C52 operate the same way as Timer 0 and Timer 1 in the
AT89C51.
Timer 2
Timer 2 is a 16-bit Timer/Counter that can operate as either a timer or an event counter.
The type of operation is selected by bit C/T2 in the SFR T2CON (shown in Table 2).
Timer 2 has three operating modes: capture, auto-reload (up or down counting), and baud
rate generator. The modes are selected by bits in
T2CON, as shown in Table 3. Timer 2 consists of two 8-bit registers, TH2 and TL2. In
the Timer function, the TL2 register is incremented every machine cycle. Since a machine cycle
consists of 12 oscillator periods, the count rate is 1/12 of the oscillator frequency.
- 25 -
In the Counter function, the register is incremented in response to a 1-to-0 transition at its
corresponding external input pin, T2. In this function, the external input is sampled during S5P2
of every machine cycle. When the samples show a high in one cycle and a low in the next cycle,
the count is incremented. The new count value appears in the register during S3P1 of the
Cycle following the one in which the transition was detected. Since two machine cycles
(24 oscillator periods) are required to recognize a 1-to-0 transition, the maximum count rate is
1/24 of the oscillator frequency. To ensure that a given level is sampled at least once before it
changes, the level should be held for at least one full machine cycle.
Capture Mode:
In the capture mode, two options are selected by bit EXEN2 in T2CON. If EXEN2 = 0,
Timer 2 is a 16-bit timer or counter which upon overflow sets bit TF2 in T2CON. This bit can
then be used to generate an interrupt. If EXEN2 = 1, Timer 2 performs the same operation, but a
1- to-0 transition at external input T2EX also causes the current value in TH2 and TL2 to be
captured into RCAP2H and RCAP2L, respectively. In addition, the transition at T2EX causes bit
EXF2 in T2CON to be set. The EXF2 bit, like TF2, can generate an interrupt. The capture mode
is illustrated in Figure 1.
- 26 -
Figure 2 shows Timer 2 automatically counting up when DCEN = 0. In this mode, two
options are selected by bit EXEN2 in T2CON. If EXEN2 = 0, Timer 2 counts up to 0FFFFH
and then sets the TF2 bit upon overflow. The overflow also causes the timer registers to be
reloaded with the 16-bit value in RCAP2H and RCAP2L. The values in Timer in Capture
ModeRCAP2H and RCAP2L are preset by software. If EXEN2 = 1, a 16-bit reload can be
triggered either by an overflow or by a 1-to-0 transition at external input T2EX. This
transition also sets the EXF2 bit. Both the TF2 and EXF2 bits can generate an interrupt if
enabled.
Setting the DCEN bit enables Timer 2 to count up or down, as shown in Figure 3. In this
mode, the T2EX pin controls the direction of the count. A logic 1 at T2EX makes Timer 2
count up. The timer will overflow at 0FFFFH and set the TF2 bit. This overflow also causes
the 16-bit value in RCAP2H and RCAP2L to be reloaded into the timer registers, TH2 and
TL2, respectively.
Logic 0 at T2EX makes Timer 2 count down. The timer underflows when TH2 and TL2
equal the values stored in RCAP2H and RCAP2L. The underflow sets the TF2 bit and causes
0FFFFH to be reloaded into the timer registers.
The EXF2 bit toggles whenever Timer 2 overflows or underflows and can be used as a
17th bit of resolution. In this operating mode, EXF2 does not flag an interrupt.
- 27 -
- 28 -
The Timer can be configured for either timer or counter operation. In most applications, it is
configured for timer operation (CP/T2 = 0). The timer operation is different for Timer 2 when it
is used as a baud rate generator. Normally, as a timer, it increments every machine cycle (at 1/12
the oscillator frequency). As a baud rate generator, however, it increments every state time (at 1/2
the oscillator frequency). The baud rate formula is given below.
Where (RCAP2H, RCAP2L) is the content of RCAP2H and RCAP2L taken as a 16-bit
unsigned integer.
Timer 2 as a baud rate generator is shown in Figure 4. This figure is valid only if RCLK
or TCLK = 1 in T2CON. Note that a rollover in TH2 does not set TF2 and will not generate an
interrupt. Note too, that if EXEN2 is set, a 1-to-0 transition in T2EX will set EXF2 but will not
cause a reload from (RCAP2H, RCAP2L) to (TH2, TL2). Thus when Timer 2 is in use as a baud
rate generator, T2EX can be used as an extra external interrupt.
- 29 -
29
- 30 -
In the clock-out mode, Timer 2 roll-overs will not generate an interrupt. This behavior is
similar to when Timer 2 is used as a baud-rate generator. It is possible to use Timer 2 as a baudrate generator and a clock generator simultaneously. Note, however, that the baud-rate and clockout frequencies cannot be determined independently from one another since they both use
RCAP2H and RCAP2L.
UART
The UART in the AT89C52 operates the same way as the UART in the AT89C51.
Interrupts
The AT89C52 has a total of six interrupt vectors: two external interrupts (INT0 and
INT1), three timer interrupts (Timers 0, 1, and 2), and the serial port interrupt. These interrupts
are all shown in Figure 6.
Each of these interrupt sources can be individually enabled or disabled by setting or
clearing a bit in Special Function Register IE. IE also contains a global disable bit, EA, which
disables all interrupts at once.
Note that Table shows that bit position IE.6 is unimplemented. In the AT89C51, bit
position IE.5 is also unimplemented. User software should not write 1s to these bit positions,
since they may be used in future AT89 products.
Timer 2 interrupt is generated by the logical OR of bits TF2 and EXF2 in register
T2CON. Neither of these flags is cleared by hardware when the service routine is vectored to. In
fact, the service routine may have to determine whether it was TF2 or EXF2 that generated the
interrupt, and that bit will have to be cleared in software.
The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in which the
timers overflow. The values are then polled by the circuitry in the next cycle. However, the
Timer 2 flag, TF2, is set at S2P2 and is polled in the same cycle in which the timer overflows.
- 31 -
Oscillator Characteristics:
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier that
can be configured for use as an on-chip oscillator, as shown in Figure 7. Either a quartz crystal or
ceramic resonator may be used. To drive the device from an external clock source, XTAL2
should be left unconnected while XTAL1 is driven, as shown in Figure 8. There are no
requirements on the duty cycle of the external clock signal, since the input to the internal
clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high
and low time specifications must be observed.
Idle Mode
In idle mode, the CPU puts itself to sleep while all the on chip peripherals remain active.
The mode is invoked by software. The content of the on-chip RAM and all the special functions
registers remain unchanged during this mode. The idle mode can be terminated by any enabled
interrupt or by a hardware reset.
Note that when idle mode is terminated by a hardware reset, the device normally resumes
program execution from where it left off, up to two machine cycles before the internal reset
- 32 -
Power-down Mode
In the power-down mode, the oscillator is stopped, and the instruction that invokes
power-down is the last instruction executed. The on-chip RAM and Special Function Registers
retain their values until the power-down mode is terminated. The only exit from power-down is a
hardware reset. Reset redefines the SFRs but does not change the on-chip RAM. The reset should
not be activated before VCC is restored to its normal operating level and must be held active
long enough to allow the oscillator to restart and stabilize.
- 33 -
When lock bit 1 is programmed, the logic level at the EA pin is sampled and latched
during reset. If the device is powered up without a reset, the latch initializes to a random value
and holds that value until reset is activated. The latched value of EA must agree with the current
logic level at that pin in order for the device to function properly.
- 34 -
34
Programming Algorithm Before programming the T89C52, the address, data and control
signals should be set up according to the Flash programming mode table and Figure 9 and Figure
10. To program the AT89C52, take the following steps.
Program Verify If lock bits LB1 and LB2 have not been programmed, the programmed
code data can be read back via the address and data lines for verification. The lock bits cannot be
verified directly. Verification of the lock bits is achieved by observing that their features are
enabled.
- 35 -
Programming Interface:
Every code byte in the Flash array can be written, and the entire array can be erased, by
using the appropriate combination of control signals. The write operation cycle is self timed and
once initiated, will automatically time itself to completion.
All major programming vendors offer worldwide support for the Atmel microcontroller
series. Please contact your local programming vendor for the appropriate software revision.
- 36 -
- 37 -
CHAPTER: 4
- 38 -
The transistor could be a general purpose type with an Ft of at least 150 MHz for HF use.
A typical example would be a 2N2222A. The turns ratio on the tuned circuit depicts an
anticipated nominal load of 50 ohms. This allows theoretical 2K5 ohms on the collector. If it is
followed by a buffer amplifier (highly recommended) I would simply maintain the typical 7:1
turns ratio. I have included a formula for determining L and C in the tuned circuits of crystal
oscillators in case you have forgotten earlier tutorials. Personally I would make L a reactance of
around 250 ohms. In this case I'd make C a smaller trimmer in parallel with a standard fixed
value.
- 39 -
CHAPTER: 5
SEVEN
SEGMENT
DISPLAY
- 40 -
- 41 -
41
Anode
Connection
Common Cathode
1)
2)
3)
42
The first is to ensure that most rays strike the surface at less than the critical angle. This
may be achieved by shaping the semiconductor /air interface into a hemisphere.
b)
- 43 -
43
CHAPTER: 6
- 44 -
45
A relay is an electrical switch that opens and closes under control of another electrical
circuit. In the original form, the switch is operated by an electromagnet to open or close one or
many sets of contacts. It was invented by Joseph Henry in 1835. Because a relay is able to
control an output circuit of higher power than the input circuit, it can be considered, in a broad
sense, to be a form of electrical amplifier.
These contacts can be either Normally Open (NO), Normally Closed (NC), or change-over
contacts.
Normally-open contacts connect the circuit when the relay is activated; the circuit is
disconnected when the relay is inactive. It is also called Form A contact or "make"
contact. Form A contact is ideal for applications that require to switch a high-current
power source from a remote device.
- 45 -
Normally-closed contacts disconnect the circuit when the relay is activated; the circuit is
connected when the relay is inactive. It is also called Form B contact or "break" contact. 46
Form B contact is ideal for applications that require the circuit to remain closed until the
relay is activated.
Change-over contacts control two circuits: one normally-open contact and one normallyclosed contact with a common terminal. It is also called Form C contact.
Operation:
When a current flows through the coil, the resulting magnetic field attracts an armature
that is mechanically linked to a moving contact. The movement either makes or breaks a
connection with a fixed contact. When the current to the coil is switched off, the armature is
returned by a force that is half as strong as the magnetic force to its relaxed position. Usually this
is a spring, but gravity is also used commonly in industrial motor starters. Relays are
manufactured to operate quickly. In a low voltage application, this is to reduce noise. In a high
voltage or high current application, this is to reduce arcing.
If the coil is energized with DC, a diode is frequently installed across the coil, to dissipate
the energy from the collapsing magnetic field at deactivation, which would otherwise generate a
spike of voltage and might cause damage to circuit components. If the coil is designed to be
energized with AC, a small copper ring can be crimped to the end of the solenoid. This "shading
ring" creates a small out-of-phase current, which increases the minimum pull on the armature
during the AC cycle.
By analogy with the functions of the original electromagnetic device, a solid-state relay is
made with a thyristor or other solid-state switching device. To achieve electrical isolation, a
light-emitting diode (LED) is used with a photo transistor.
to detect and isolate faults on transmission and distribution lines by opening and closing
circuit breakers (protection relays),
to isolate the controlling circuit from the controlled circuit when the two are at different
potentials, for example when controlling a mains-powered device from a low-voltage
switch. The latter is often applied to control office lighting as the low voltage wires are
easily installed in partitions, which may be often moved as needs change. They may also
be controlled by room occupancy detectors in an effort to conserve energy,
to perform logic functions. For example, the boolean AND function is realised by
connecting NO relay contacts in series, the OR function by connecting NO contacts in
parallel. The change-over or Form C contacts perform the XOR (exclusive or) function.
- 46 -
to perform time delay functions. Relays can be modified to delay opening or delay
closing a set of contacts. A very short (a fraction of a second) delay would use a copper
disk between the armature and moving blade assembly. Current flowing in the disk
maintains magnetic field for a short time, lengthening release time. For a slightly longer
(up to a minute) delay, a dashpot is used. A dashpot is a piston filled with fluid that is
allowed to escape slowly. The time period can be varied by increasing or decreasing the
flow rate. For longer time periods, a mechanical clockwork timer is installed.
- 47 -
- 48 -
CIRCUIT DESCRIPTION:
The circuit is simple NPN transistor common emitter switching circuit. The transistor T-1
is supplied through negative at emitter. The base is conducted through the port output from
computer and collector gives output to energies the relay commonly connected to +ve supply.
The diode prevents back emf produced by relay while working.
- 49 -
49
CHAPTER: 7
- 50 -
POWER SUPPLY:
In flow in one direction only. When the anode of the diode is positive with respect to its
cathode, it is forward biased, allowing current to flow. But when its anode is negative with
alternating current the electron flow is alternate, i.e. the electron flow increases to maximum in
one direction, decreases back to zero. It then increases in the other direction and then decreases
to zero again. Direct current flows in one direction only. Rectifier converts alternating current to
respect to the cathode, it is reverse biased and does not allow current to flow. This unidirectional
property of the diode is useful for rectification. A single diode arranged back-to-back might
allow the electrons to flow during positive half cycles only and suppress the negative half cycles.
Double diodes arranged back-to-back might act as full wave rectifiers as they may allow the
electron flow during both positive and negative half cycles. Four diodes can be arranged to make
a full wave bridge rectifier. Different types of filter circuits are used to smooth out the pulsations
in amplitude of the output voltage from a rectifier. The property of capacitor to oppose any
- 51 -
THEORY
USE OF DIODES IN RECTIFIERS:
Electric energy is available in homes and industries in India, in the form of alternating
voltage. The supply has a voltage of 220V (rms) at a frequency of 50 Hz. In the USA, it is 110V
at 60 Hz. For the operation of most of the devices in electronic equipment, a dc voltage is
needed. For instance, a transistor radio requires a dc supply for its operation. Usually, this supply
is provided by dry cells. But sometime we use a battery eliminator in place of dry cells. The
battery eliminator converts the ac voltage into dc voltage and thus eliminates the need for dry
cells. Nowadays, almost all-electronic equipment includes a circuit that converts ac voltage of
mains supply into dc voltage. This part of the equipment is called Power Supply. In general, at
the input of the power supply, there is a power transformer. It is followed by a diode circuit
called Rectifier. The output of the rectifier goes to a smoothing filter, and then to a voltage
regulator circuit. The rectifier circuit is the heart of a power supply.
Rectification:
Rectification is a process of rendering an alternating current or voltage into a
unidirectional one. The component used for rectification is called Rectifier. A rectifier permits
current to flow only during the positive half cycles of the applied AC voltage by eliminating the
negative half cycles or alternations of the applied AC voltage. Thus pulsating DC is obtained. To
obtain smooth DC power, additional filter circuits are required.
A diode can be used as rectifier. There are various types of diodes. But, semiconductor
diodes are very popularly used as rectifiers. A semiconductor diode is a solid-state device
consisting of two elements is being an electron emitter or cathode, the other an electron collector
or anode. Since electrons in a semiconductor diode can flow in one direction only-from emitter
- 52 -
The output of a full-wave rectifier is also pulsating direct current. In the diagram, the two
equal resistors R across the input voltage are necessary to provide a voltage midpoint C for
circuit connection and zero reference. Note that the load resistor RL is connected from the
cathodes to this center reference point C.
An interesting fact about the output waveform vout is that its peak amplitude is not 9 V as
in the case of the half-wave rectifier using the same power source, but is less than 4 V. The
reason, of course, is that the peak positive voltage of A relative to C is 4 V, not 9 V, and part of
the 4 V is lost across R.
Though the full wave rectifier fills in the conduction gaps, it delivers less than half the
peak output voltage that results from half-wave rectification.
BRIDGE RECTIFIER:
- 53 -
Filtration:
The rectifier circuits we have discussed above deliver an output voltage that always has
the same polarity: but however, this output is not suitable as DC power supply for solid-state
circuits. This is due to the pulsation or ripples of the output voltage. This should be removed out
before the output voltage can be supplied to any circuit. This smoothing is done by incorporating
filter networks. The filter network consists of inductors and capacitors. The inductors or choke
coils are generally connected in series with the rectifier output and the load. The inductors
oppose any change in the magnitude of a current flowing through them by storing up energy in a
magnetic field. An inductor offers very low resistance for DC whereas; it offers very high
resistance to AC.
Thus, a series connected choke coil in a rectifier circuit helps to reduce the pulsations or
ripples to a great extent in the output voltage. The fitter capacitors are usually connected in
parallel with the rectifier output and the load. As, AC can pass through a capacitor but DC
cannot, the ripples are thus limited and the output becomes smoothed. When the voltage across
its plates tends to rise, it stores up energy back into voltage and current. Thus, the fluctuations in
the output voltage are reduced considerable. Filter network circuits may be of two types in
general:
- 54 -
CIRCUIT DIAGRAM
The 230 ac supply is converted into 12volts by the power supply in which 4 elements are
used: Transformer
7805 regulator
Diodes 4007(in bridge shape)
Capacitor(100microfarad & 470microfarad)
BRIDGE RECTIFIER:
Bridge rectifier circuit consists of four diodes arranged in the form of bridge as shown in figure.:
OPERATION:
During the positive half cycle of the input supply, the upper end A of the transformer secondary
becomes positive with respect to its lower point B. this makes point 1 of bridge. Positive with respect to
- 55 -
VOLTAGE REGULATOR:
THE ADAPTING 3-TERMINAL VOLTAGE REGULATORS FOR CONSTANT HIGH
VOLTAGE POWER SUPPLIES:
One can get a constant high-voltage power supply using inexpensive 3-terminal voltage
regulators through some simple techniques described below. Depending upon the current
requirement, a reasonable load regulation can be achieved. Line regulation in all cases is equal to
that of the voltage regulator used.
Though high voltage can be obtained with suitable voltage boost circuitry using ICs like
LM 723, some advantages of the circuits presented below are: simplicity, low cost, and
practically reasonable regulation characteristics. For currents of the order of 1A or less, only one
zener and some resistors and capacitors are needed. For higher currents, one pass transistor such
as ECP055 is needed.
Before developing the final circuits, let us first understand the 3-terminal type constant
voltage regulators. Let us see the schematic in Fig. where 78XX is a 3-terminal voltage regulator.
- 56 -
56
Schematic for obtaining low-voltage regulated output using 3-terminal voltage regulators.
Rectified and filtered unregulated voltage is applied at VIN and a constant voltage
appears between pins 2 and 2 of the voltage regulator. *The distribution of two currents in the
circuit (IBIAS and ILOAD) is as shown.
*
It is highly recommended to use the two capacitors as shown. Electrically regulator will
be at a distance from the rectifier supply. Thus, a tantalum grade capacitor of 5mf and rated
voltage is good. Electrolytic capacitor is not suitable for it is poor in response to load transients,
which have high frequency components. At the output side a 0.22mf disc ceramic capacitor is
useful to eliminate spurious oscillations, which the regulator might break into because of its
internal high gain circuitry.
These voltage regulators have a typical bias current of 5 mA, which is reasonably
constant. By inserting a small resistor Rx between pin 2 and ground, the output voltage in many
cases. By this method voltage increment of 5 to 10 per cent is practically feasible. However, if a
high-value resistance is used to obtain a higher output voltage, a slight variation in bias current
will result in wide variation of the output voltage.
Now let us see that what can be done to get a higher but constant output voltage. If to the
circuit of Fig. resistor RY and zener Vz are added as shown in Fig., the output voltage is now
given by ,
VOUT=VR+VZ + IBIAS RX
A constant current flows through RY** because VOUT is constant, and small variations
in IBIAS do not change practically the operating point of Vz.
This situation is like constant current biasing of zener, which results in a very accurate setting of
the zener voltage.
**
- 57 -
of
Fig,
and
5 x 10-3
It should be noted here that the maximum input voltage allowed for 78XX regulators is
35V between pins 1 and 2. We see that the actual voltage betweens pin 1 and 2 of the regulator in
this circuit is
VIN - VZ - IBIAS RX
It is therefore necessary that VIN be so chosen that voltage between pins 1 and 2 of the
IC does not exceed the maximum rating. Also, a high input-output differential voltage VIN- 58 -
= 45 + 7 - 5 = 47 VOLTS
Thus, from no-load to full-load condition, the unregulated input voltage-including peak
ripple-should be within these limits. This gives a margin of 75-47, i.e. 28 volt. Hence, the
designer can work out the maximum transformer voltage from the no-load input voltage chosen
on the upper side.
The capacitor's value can be determined from the full load unregulated voltage chosen.
Roughly, per 100mA current, 100mf capacitor gives 1-volt peak-to-peak ripple. Hence,
capacitor's value can be determined for the desired current.
This circuit will have an excellent load and line regulation. For shot-circuit protection, it
is recommended to use a fast-blow fuse of suitable value. Although the regulator has inherent
short-circuit protection, the maximum current differs from device to device. Adequate heat sink
should be used with the regulator.
Schematic for constant high-voltage power supplies providing currents in excess of one ampere
Now if currents in excess of 1A are needed, the circuit shown in fig. is useful. This circuit
is similar to that in Fig. except that a pass transistor ECP055 is added besides a 0.5-ohm or more
resistor. This transistor bypasses the excessive current. By selecting proper Rz the ratio of two
currents passing through the regulator and transistor can be altered.
- 59 -
FEATURES:
TRANSFORMER:
Transformer is a major class of coils having two or more winding usually wrapped
around a common core made from laminated iron sheets. It has two coils named primary and
secondary. If the current flowing through primary is fluctuating, then a current will be inducted
into the secondary winding. A steady current will not be transferred from one coil to other coil.
- 60 -
DIODES:
The diodes is ap-n junction device. Diode is the component used to control the flow of the
current in any one direction. The diodes widely work in forward bias.
When the current flow from the P to N direction. Then it is in forward bias. The zener
diode is used in reverse bias function i.e N to P direction. Visually the identification of diodes
terminal can be done by identifying silver/black line. The silver/black line is the negative
terminal(cathode) and the other terminal is positive terminal (anode).
- 61 -
62
RESISTANCE:
COLOURS CODE
Black-----------------------------------------------------0
Brown----------------------------------------------------1
Red-------------------------------------------------------2
Orange---------------------------------------------------3
Yellow----------------------------------------------------4
Green-----------------------------------------------------5
- 62 -
The first rings give the first digit. The second ring gives the second digit. The third ring
indicates the number of zeroes to be placed after the digits. The fourth ring gives tolerance (gold
5%, silver 10%, No colour 20%).
In variable resistors, we have the dial type of resistance boxes. There is a knob with a
metal pointer. This presses over brass pieces placed along a circle with some space b/w each of
them.
Resistance coils of different values are connected b/w the gaps. When the knob is rotated,
the pointer also moves over the brass pieces. If a gap is skipped over, its resistance is included in
the circuit. If two gaps are skipped over, the resistances of both together are included in the
circuit and so on.
A dial type of resistance box contains many dials depending upon the range, which , it
will haveit has to cover. If a resistance box has to read up to 10,000 three dials each having ten
- 63 -
63
The dial type of resistance boxes is better because the contact resistance in this case is
small & constant.
TESTING:
Resistors are checked with an ohm meter/millimeter. For a defective resistor the ohm
meter shows infinite high reading.
CAPACITORS:
It is an electronic component whose function is to accumulate charges and then release it.
To understand the concept of capacitance, consider a pair of metal plates which all are
placed near to each other without touching. If a battery is connected to these plates the positive
pole to one and the negative pole to the other, electrons from the battery will be attracted from
the plate connected to the positive terminal of the battery. If the battery is then disconnected, one
plate will be left with an excess of electrons, the other with a shortage, and a potential or voltage
difference will exists between them. These plates will be acting as capacitors. Capacitors are of
two types: - (1) fixed type like ceramic, polyester, electrolytic capacitors-these names refer to the
material they are made of aluminum foil. (2) Variable type like gang condenser in radio or
trimmer. In fixed type capacitors, it has two leads and its value is written over its body and
variable type has three leads. Unit of measurement of a capacitor is farad denoted by the symbol
F. It is a very big unit of capacitance. Small unit capacitor are pico-farad denoted by pf
(Ipf=1/1000,000,000,000 f) Above all, in case of electrolytic capacitors, it's two terminal are
marked as (-) and (+) so check it while using capacitors in the circuit in right direction. Mistake
can destroy the capacitor or entire circuit in operational.
- 64 -
BASIC:
Like a battery, a capacitor has two terminals. Inside the capacitor, the terminals connect to
two metal plates seperated by a dielectric. The dielectric can be air, paper , plastic, or anything
else that does not conduct electricity and keeps the plates from touching each other. You can
eaisily make a capacitor from two pieces of aluminium foil and piece of paper. It wont be a
particularly good capacitor in terms of its storage capacity, but it will work. In an electronic
circuit, a capacitor is shown like this:
The plate on the capacitor that attaches to the negative terminal of the battery accepts
electrons that the battery is producing.
The plate on the capacitor that attaches to the positive terminal of the battery loses
electrons to the battery.
- 65 -
TESTING:
To test the capacitors, either analog meters or special digital meters with the specified
function are used. The non-electrolyte capacitor can be tested by using the digital meter.
Multi-meter mode
Positive probe
Negative probe
Display
Result
: Continuty
: One end
: Second end
: 0(beep sound occur) OL
: Faulty OK
- 66 -
CHAPTER: 9
- 67 -
PHOTO SEMICONDUCTOR
A Germanium or silicon diode or transistor, which has a transparent encasing, can serve as a
photodiode or transistor because the light photons can initiate conduction in the p-njunction region. Early devices such as the OCP 71 were Ge-devices. Later, silicon types
became available with lower leakage current and better light sensitivity. In a phototransistor,
the base lead is not used; but, if a resistor is connected form base to emitter it reduced the
light sensitivity. Darlington connected photo transistors (two transistors together in one case)
such as the 2N5777 are very sensitive with a hFE of 2.5K, a dark current of 100nA and a light
current of 0.5-2.0mA for light flux density H=2mW/cm 2. The device is rated 200mW and
voltage of 25V maximum.
SCRs with a light window are also available, called as LASCR, which are very sensitive
and can turn mains power ON and OFF, with light.
The switching speed of phototransistors far exceeds those of LDRs, made of CdS. The s.
Maximum switching speeds and fall time is 50rise time for the 2N5777 is 75 is 1KHz.
Photo devices are useful in optical encoding, intrusion alarms, tape readers, level control,
character recognition etc.
Nowadays packing containing an LED and a photodiode, called opto-coupler is used for
switching on power or control circuits. Because the light source (LED) and photodiode are
physically kept separated (with 2mm) in the package, isolation upto 2500V can be had.
- 68 -
LED:
LED falls within the family of P-N junction device. The light emitting device(LED) is a
diode that will give off visible light when it is energized. In any forward biased P-N
junction there is, with in the structure and primarilyclose to the junction a recombination
of hole and electrons. This recombination requires that the energy possessed by the
unbound free electron be transferred to another state. This process of giving off light by
applying an electrical source is called electroluminescence.
LED is a component used for indication. All the function being carried out are displayed by
LED. The LED is diode which glows when the current is being flow through it in forward bias
condition. This LED are available in the round shell and also in the flat shells. The positive leg is
longer than negative leg.
- 69 -
PHOTODIODE
- 70 -
high as 1 mA, producing a significant output across R1. Further investigation will show that the
diode current (and thus the output voltage) is directly proportional to light intensity, and that the
diode is therefore photosensitive.
In practice, all silicon junctions are photosensitive, and a photodiode can be regarded as a
conventional diode housed in a case that lets external light reach its photosensitive
semiconductor junction. Fig. 2 shows the standard photodiode symbol. In use, the photodiode is
- 71 -
Photodiode
symbol
The human eye is sensitive to a range of light radiation, as shown in fig. 4. It has a peak spectral
response to the colour green, which has a wave length of about 550 nm, but has a relatively low
sensitivity to the colour violet (400 nm) at one end of the spectrum and to dark red (700 nm) at
the other. Photodiodes also have spectral response characteristics, and these are determined by
the chemistry used in the semiconductor junction material. Fig. 4 shows typical response curves
of a general-purpose photodiode, and infrared (IR) photodiode.
Photodiodes have a far lower light-sensitivity than cadmium-sulphide LDRs, but give a far
quicker response to changes in light level. Generally, LDRs are ideal for use in slow-acting
direct-coupled light-level sensing applications, while photodiodes are ideal for use in fast-acting
AC-coupled signalling applications. Typical photodiode applications include IR remote-control
circuits, IR beam switches and alarm circuits, and photographic flash slave circuits, etc.
- 72 -
Fig. 4 Typical spectral response curves of (a) the human eye, (b) a general-purpose photodiode, and (c) an infra-red
photodiode.
- 73 -
PRINCIPLE OF OPERATION: -
A photodiode is a p-n junction or p-i-n structure. When light with sufficient photon energy strikes
a semiconductor, photons can be absorbed, resulting in generation of a mobile electron and
electron hole. If the absorption occurs in the junction's depletion region, these carriers are swept
from the junction by the built-in field of the depletion region, producing a photocurrent.
Photodiodes can be used in either zero bias or reverse bias. In zero bias, light falling on the diode
causes a voltage to develop across the device, leading to a current in the forward bias direction.
This is called the photovoltaic effect,
and is the basis for solar cells in fact, a solar cell is just a large number of big, cheap
photodiodes.
Diodes usually have extremely high resistance when reverse biased. This resistance is reduced
when light of an appropriate frequency shines on the junction. Hence, a reverse biased diode can
be used as a detector by monitoring the current running through it. Circuits based on this effect
are more sensitive to light than ones based on the photovoltaic effect.
Avalanche photodiodes have a similar structure, however they are operated with much higher
reverse bias. This allows each photo-generated carrier to be multiplied by avalanche breakdown,
resulting in internal gain within the photodiode, which increases the effective responsivity of the
device.
MATERIALS: -
The material used to make a photodiode is critical to defining its properties, because only
photons with sufficient energy to excite an electron across the material's bandgap will produce
significant photocurrents.
Silicon
1901100
Germanium
8001700
8002600
- 74 -
Lead sulfide
<1000-3500
Because of their greater bandgap, silicon-based photodiodes generate less noise than germaniumbased photodiodes, but germanium photodiodes must be used for wavelengths longer than
approximately 1 m.
FEATURES: -
Rponsivity
The ratio of generated photocurrent to incident light power, typically expressed in A/W
when used in photoconductive mode. The responsively may also be expressed as a quantum
efficiency, or the ratio of the number of photogene rated carriers to incident photons, thus a unit
less quantity.
Dark current
The current through the photodiode in the absence of any input optical signal, when it is
operated in photoconductive mode. The dark current includes photocurrent generated by
background radiation and the saturation current of the semiconductor junction. Dark current must
be accounted for by calibration if a photodiode is used to make an accurate optical power
measurement, and it is also a source of noise when a photodiode is used in an optical
communication system.
- 75 -
Noise-equivalent power
(NEP) The minimum input optical power to generate photocurrent equal to the rms noise
current in 1 Hertz bandwidth. The related characteristic detectivity (D) is the inverse of NEP,
1/NEP; and the specific detectivity (
) is the detectivity normalized to the area (A) of the
photodetector,
photodiode.
APPLICATIONS: -
P-N photodiodes are used in similar applications to other photo detectors, such as
photoconductors, charge-coupled devices, and photomultiplier tubes.
Photodiodes are used in consumer electronics devices such as compact disc players smoke
detectors, and the receivers for remote controls in VCRs and televisions.
In other consumer items such as camera light meters, clock radios (the ones that dim the display
when its dark) and street lights, photoconductors are often used rather than photodiodes,
although in principle either could be used.
Photodiodes are often used for accurate measurement of light intensity in science and industry.
They generally have a better, more linear response than photoconductors.
- 76 -
PHOTOTRANSISTOR
- 77 -
- 78 -
Fig. 5 shows the standard symbol of a phototransistor, which can be regarded as a conventional
transistor housed in a case that enables its semiconductor junctions to be exposed to external
light. The device is normally used with its base open circuit, in either of the configurations
shown in fig. 6, and functions as follows.
In fig. 6(a), the base-collector junction of the transistor is effectively reverse biased and thus acts
as a photodiode. The photo-generated currents of the base-collector junction feed directly into
the base of the device, and the normal current-amplifying transistor action causes the output
current to appear (in greatly amplified form) as collector current, and in fig. 6(a) R 1 causes this
current to generate an output voltage as shown.
In practice, the collector and emitter current of the transistor are virtually identical and, since the
base is open circuit, the device is not subjected to significant negative feedback. Consequently,
the alternative fig. 6(b) circuit, in which R1 is connected to Q1 emitter, gives a virtually identical
performance to that of fig. 6(a).
- 79 -
The sensitivity of a phototransistor is typically one hundred times greater than that of a
photodiode, but is useful maximum operating frequency (a few hundred kilohertz) is
proportionally lower than that of a photodiode by using only its base and collector terminals and
ignoring the emitter, as shown in fig. 7.
- 80 -
INFRARED LED'S:-
- 81 -
The disadvantages of the GaAs emitter are emitted wavelength and the associated
attenuation an dispersion. A critical issue of using an LED for the fibre optics is the coupling of
light from the semiconductor to the fibre. Because of the larger refractive index of GaAs relative
to air, the internal efficiency of LED can be quite low.
INFRARED TRANSMITTER
R1=4.7K
VR1=10K
R2=10K
C2=0.001f
C3=0.01f
C1=10f16v
- 82 -
WORKING
When switch S1 is pressed, circuit is energized. The output of IC1 is square wave. The
IR-LED is connected to its output. The transmit IR-beams modulated at same frequency 36-kHz.
The oscillator frequency can be shifted by adjusting preset VR-1.
CHAPTER: 10
- 83 -
P.C.B. DESIGNING
- 84 -
INTRODUCTION
Making a Printed Circuit Board is the first step towards building electronic equipment by
any electronic industry. A number of methods are available for making P.C.B., the simplest
method is of drawing pattern on a copper clad board with acid resistant (etchants) ink or
paint or simple nail polish on a copper clad board and do the etching process for dissolving
the rest of copper pattern in acid liquid.
MATERIAL REQUIRED
Polish or Pain
- 85 -
Plastic Tray
86
PROCEDURE
The first and foremost in the process is to clean all dirt from copper sheet with say spirit or
trichloro ethylene to remove traces grease or oil etc. and then wash the board under running tap
water. Dry the surface with forced warm air or just leave the board to dry naturally for some
time.
Making of the P.C.B. drawing involves some preliminary consideration such as thickness of
lines/ holes according to the components. Now draw the sketch of P.C.B. design (tracks, rows,
square) as per circuit diagram with the help of nail polish or enamel paint or any other acid
resistant liquid. Dry the point surface in open air, when it is completely dried, the marked holes
in P.C.B. may be drilled using 1Mm drill bits. In case there is any shorting of lines due to spilling
of paint, these may be removed by scraping with a blade or a knife, after the paint has dried.
- 86 -
REACTION
Fecl
Fecl
+ Cu ----- CuCl
+ Fe
- 87 -
PRECAUTION
1.
Add Ferric Chloride (Fecl3) carefully, without any splashing. Fecl3 is irritating to the
skin and will stain the clothes.
2.
3.
Try not to breathe the vapours. Stir the solution by giving see-saw motion to the dish and
solution in it.
4.
Occasionally warm if the solution over a heater-not to boiling. After some time
the
unshaded parts change their colour continue to etch. Gradually the base material will
become visible. Etch for two minutes more to get a neat pattern.
5.
Don't throw away the remaining Fecl3 solution. It can be used again for next Printed
Circuit Board P.C.B
- 88 -
USES
Printed Circuit Board are used for housing components to make a circuit for compactness,
simplicity of servicing and case of interconnection. Thus we can define the P.C.B. as : Prinked
Circuit Boards is actually a sheet of bakelite (an insulating material) on the one side of which
copper patterns are made with holes and from another side, leads of electronic components are
inserted in the proper holes and soldered to the copper points on the back. Thus leads of
electronic components terminals are joined to make electronic circuit.
In the boards copper cladding is done by pasting thin copper foil on the boards during curing.
The copper on the board is about 2 mm thick and weights an ounce per square foot.
The process of making a Printed Circuit for any application has the following steps (opted
professionally):
- 89 -
Removing the copper in places which are not needed, by the process of etching (chemical
90
process)
Printed circuit boards are used for housing components to make a circuit, for comactness,
simplicity of servicing and ease of interconnection. Single sided, double sided and double sided
with plated-through-hold (PYH) types of p.c boards are common today.
Boards are of two types of material (1) phenolic paper based material (2) Glass epoxy
material. Both materials are available as laminate sheets with copper cladding.
Printed circuit boards have a copper cladding on one or both sides. In both boards,
pasting thin copper foil on the board during curing does this. Boards are prepared in sizes of 1 to
5 metre wide and upto 2 metres long. The thickness of the boards is 1.42 to 1.8mm. The copper
on the boards is about 0.2 thick and weighs and ounce per square foot.
- 90 -
CONSTRUCTION
An actual-size, single-side PCB for the microcontroller-based visitor counter (Fig2) including its
power supply (Fig.3) is shown in Fig.5 and its component layout in Fig6.
- 91 -
- 92 -
Building project in the proper manner is really an art, something which must be prectised
and learned through trial and error, it is not all that difficult. The main thing is to remember to
take each step slowly and carefully according to the instructions giving making since that
everything at it should be before proceeding further.
TOOLS:
The electronics workbench is an actual place of work with comfortably & conveniently & should
be supplied with compliment of those tools must often use in project building. Probably the most
important device is a soldering tool. Other tool which should be at the electronic work bench
includes a pair of needle nose pliers, diagonal wire cutter, a small knife, an assortment of screw
driver, nut driver, few nuts & bolts, electrical tape, plucker etc. Diagonal wire cutter will be used
to cut away any excess lead length from copper side of P.C.B. 7 to cut section of the board after
the circuit is complete. The needle nose pliers are most often using to bend wire leads & wrap
them in order to form a strong mechanical connection.
- 93 -
1.
SOLDERING IRON:
As soldering is a process of joining together two metallic parts, the instrument, which is
used, for doing this job is known as soldering Iron. Thus it is meant for melting the solder and to
setup the metal parts being joined. Soldering Iron is rated according to their wattage, which
varies from 10- 200 watts.
2.
SOLDER:
The raw material used for soldering is solder. It is composition of lead & tin. The good
quality solder (a type of flexible naked wire) is 60% Tin +40% Lead which will melt between
180 degree to 200 degree C temperature.
3.
- 94 -
4.
BLADES OR KNIFE:
To clean the surface & leads of components to be soldered is done by this common
instrument.
5.
SAND PAPER:
The oxide formation may attack at the tip of your soldering iron & create the
problem. To prevent this, clean the tip with the help of sand paper time to time or
you may use blade for doing this job. Apart from all these tools, the working bench
for soldering also includes disordering pump, wink wire (used for disordering
purpose), file etc.
HOW TO SOLDER?
Mount components at their appropriate place; bend the leads slightly
outwards to prevent them from falling out when the board is turned over for
soldering. No cut the leads so that you may solder them easily. Apply a small
amount of flux at these components leads with the help of a screwdriver. Now fix
the bit or iron with a small amount of solder and flow freely at the point and the
P.C.B copper track at the same time. A good solder joint will appear smooth &
shiny. If all appear well, you may continue to the next solder connections.
- 95 -
2. Keep the hot tip of the soldering iron on a piece of metal so that excess heat is dissipated.
3. Make sure that connection to the soldered is clean. Wax frayed insulation and other
substances cause poor soldering connection. Clean the leads, wires, tags etc. before
soldering.
4. Use just enough solder to cover the lead to be soldered. Excess solder can cause a short
circuit.
5. Use sufficient heat. This is the essence of good soldering. Apply enough heat to the
component lead. You are not using enough heat, if the solder barely melts and forms a round
ball of rough flaky solder. A good solder joint will look smooth, shining and spread type. The
difference between good & bad soldering is just a few seconds extra with a hot iron applied
firmly.
PRECAUTIONS
1.
Mount the components at the appropriate places before soldering. Follow the circuit
description and components details, leads identification etc. Do not start soldering before
making it confirm that all the components are mounted at the right place.
2.
Do not use a spread solder on the board, it may cause short circuit.
3.
- 96 -
Position the board so that gravity tends to keep the solder where you want it.
5.
Do not over heat the components at the board. Excess heat may damage the components or
board.
6.
The board should not vibrate while soldering otherwise you have a dry or a cold joint.
7.
Do not put the kit under or over voltage source. Be sure about the voltage either dc or ac
while operating the gadget.
8.
Do spare the bare ends of the components leads otherwise it may short circuit with the
other components. To prevent this use sleeves at the component leads or use sleeved wire
for connections.
9.
Do not use old dark colour solder. It may give dry joint. Be sure that all the joints are clean
and well shiny.
10.
Do make loose wire connections especially with cell holder, speaker, probes etc. Put knots
while connections to the circuit board, otherwise it may get loose.
- 97 -
97
DRILLING:
After completion of painting work, holes 1/23inch(1mm) diameter are drilled at desired points
where we have to fix the components.
ETCHING:
The removal of exess of copper on the plate apart from the printed circuit is known as etching.
From this process the copper clad board with printed circuit is placed in the solution of FeCl with
3-4 drops of HCL in it and is kept so far about 10-15 mins. and is taken out when all the exess
copper is removed from the P.C.B. After etching, the P.C.B. is kept in clean water for about half
an hour in order to get P.C.B. away from acidic,field, which may cause poor performance of the
circuit. After the P.C.B. has been thoroughly washed, paint is removed by soft piece of cloth, the
P.C.B. is checked as per the layout, now the P.C.B. is ready to use.
- 98 -
CHAPTER: 11
- 99 -
CODING:
;H/W DECLARATION
SEGPORT1 EQU P2
SEGPORT2 EQU P0
SEGPORT3 EQU P1
;RAM DECLARATION
- 100 -
101
;BIT DECLARATION
FLAG BIT #00H
INTFLAG BIT #01H
;CONSTANT DECLARATION
STACKVAL EQU 70H
;START
ORG 0000H
SETB SW1
SETB SW2
AJMP POWERON
POWERON:
MOV SP,#STACKVAL
MOV P0,#0FFH
MOV P1,#0FFH
- 101 -
MOV P2,#0FFH
MOV P3,#0FFH
MOV IE,#00H
MOV IP,#00H
MOV DPTR,#CODETABLE
MOV UNIT,#00H
MOV TEN,#00H
MOV HUND,#00H
MOV KEYNO,#0FFH
MOV COUNT,#00H
CLR INTFLAG
ACALL DISPLAY
MAINLOOP:
ACALL KEYCHECK
JNB INTFLAG,MAINLOOP
MOV A,COUNT
MOV B,#10
DIV AB
MOV UNIT,B
MOV B,#10
- 102 -
103
MOV TEN,B
MOV B,#10
DIV AB
MOV HUND,B
ACALL DISPLAY
SJMP MAINLOOP
KEYCHECK:
CLR FLAG
LOOP1: JB SW1,CHECK_2
MOV R1,#255
SJMP DEB_LOOP1
CHECK_2: JB SW2,LOOP1
MOV R2,#255
SJMP DEB_LOOP2
DEB_LOOP1:JB SW1,LOOP1
DJNZ R1,DEB_LOOP1
MOV KEYNO,#01
- 103 -
L6:
104
JNB SW1,L6
RET
DEB_LOOP2:JB SW2,LOOP1
DJNZ R2,DEB_LOOP2
MOV KEYNO,#02
ACALL KEYACTION
KEYACTION:mov a,keyno
cjne a,#0ffh,k1
ret
k1:
cjne a,#01h,k2
jb flag,label
setb flag
SETB INTFLAG
MOV A,COUNT
ADD A,#10
MOV COUNT,A
CJNE A,#00,LEDON
- 104 -
105
SETB LED2
SETB LED3
SETB LED4
ret
k2:
cjne a,#02h,label
jb flag,label
setb flag
SETB INTFLAG
MOV A,COUNT
SUBB A,#10
MOV COUNT,A
CJNE A,#00,N2
SETB LED1
SETB LED2
SETB LED3
SETB LED4
RET
N2:
CJNE A,#40,LEDON
CLR LED1
CLR LED2
CLR LED3
CLR LED4
- 105 -
106
LEDON:
MOV B,#10
DIV AB
CJNE A,#01,NEXT1
CLR LED1
SETB LED2
SETB LED3
SETB LED4
RET
NEXT1:
CJNE A,#02,NEXT2
CLR LED1
CLR LED2
SETB LED3
SETB LED4
RET
NEXT2:
CJNE A,#03,NEXT3
- 106 -
107
CLR LED2
CLR LED3
SETB LED4
RET
NEXT3:
CJNE A,#04,LABEL
CLR LED1
CLR LED2
CLR LED3
CLR LED4
RET
LABEL: ret
display:
mov a,unit
MOVC A,@A+DPTR
mov segport1,a
ACALL DELAY
mov a,ten
MOVC A,@A+DPTR
- 107 -
mov segport2,a
ACALL DELAY
mov a,hund
MOVC A,@A+DPTR
mov segport3,a
ACALL DELAY
ret
delay:
mov r5,#20
lp1:
mov r6,#50
lp2:
mov r7,#50
lp3:
djnz r7,lp3
djnz r6,lp2
djnz r5,lp1
ret
CODETABLE:
db 3Fh ;0
db 06h ;1
db 5Bh ;2
- 108 -
109
db 66h ;4
db 6Dh ;5
db 7Dh ;6
db 07h ;7
db 7FH ;8
db 6Fh ;9
RET
end
- 109 -
- 110 -
CONCLUSION
The project was completed successfully with in the given time duration. it was learning
experience through which we gained invaluable on hand practical knowledge with project
enlightened us on the vastness and unique application of micro controller , which forms the basic
framework of our project.
Visitor counting is not limited to the entry/exit point of a company but has a wide range of
applications that provide information to management on the
volume and flow of people throughout a location.
Still the advantages of this projects are not negligible hence the it is very useful, considering the
evolution of new techniques in this field.
- 111 -
- 112 -
REFERENCES:
113
Kenneth J Ayala
Majidi
by Ramakant A. Gayakwad
Digital design
M.Morris Mano
WEBSITES
www.atmel.com
www.electronics-lab.com
www.alldatasheets.com
www.google.com
www.electroniccircuitschematic.com
www.datasheetcatalog.com
www.cetpaindia.com
www.futurlec.com
- 113 -