Beruflich Dokumente
Kultur Dokumente
SENSOR
CONTENTS
CHAPTER No
TITLE
ABSTRACT
INTRODUCTION
HARDWARE
BLOCK DIAGRAM
5.2
ULTRASONIC CIRCUIT
5.3
MICROCONTROLLER CIRCUIT
5.4
5.5 RELAY
6
PCB DESIGN
SOFTWARE
SOFTWARE TOOLS
PROGRAM
ADVANTAGES
10
APPLICATION
11
CONCLUSION
12
REFERENCES
ABSTRACT
This project is designed with
Ultrasonic transmitter
Ultrasonic receiver
Amplifier
Analog to Digital Converter
Microcontroller
LCD display
In this project the ultrasonic transmitter and receiver is placed in the
machine whose has to measure the distance of the target. The oscillator is used
to generate the 40KHZ frequency signal. Then the generated frequency signal is
given to ultrasonic transmitter.
The ultrasonic transmitter is constructed with two inverted buffer is
connected in parallel. Depending on the frequency the buffer on and off time is
varied due to this process 40KHZ ultrasonic wave is generated and transmitted.
Then the ultrasonic wave hits the nearest target and reflected from the
target. The ultrasonic receiver is used to receive the reflected wave. Depends
upon the distance of the object, the received wave strength is varied. Then the
received signal is given to amplifier unit in order to amplify the received signal.
The amplified signal is in the form of AC wave form so the signal is given to
signal conditioning unit. The signal conditioning unit consists of precision rectifier
and comparator. The precision rectifier is constructed with operational amplifier in
which the negative signals are rectified. Then the rectified signal is given to ADC.
ADC is nothing but analog to digital converter in which the incoming signal
from the amplifier is converted into corresponding digital signal. Then the
converted digital signal is given to microcontroller.
Here the microcontroller is the flash type reprogrammable microcontroller in
which we have already programmed height formula. The microcontroller received
the signal from ADC and process the signal. Then the corresponding result is
displayed in the LCD display which is equal to height of the target.
INTRODUCTION
The objective of this project is to measure the distance of the target
using ultrasonic wave. This project is very useful for the blind people to find the
distance of the objects.
3. BLOCK DIAGRAM
Ultrasonics refers to any study or application of sound waves that are higher
frequency than the human audible range. Music and common sounds that we
consider pleasant are typically 12 kHz or less, while some humans can hear
frequencies up to 20 kHz. Ultrasonic waves consist of frequencies greater than
20 kHz and exist in excess of 25 MHz. Ultrasonic waves are used in many
applications
including
plastic
welding,
medicine,
jewelry
cleaning,
and
affecting
the
material
in
an
adverse
manner.
severity
of
internal
defects
to
be
identified.
surfaces
and
internal
defects.
within the ultrasonic transducer and generate voltages that are measurable by
data acquisition hardware. When operating in through-transmission mode, two
ultrasonic transducers are used; one transducer generates the wave and the
other
receives
the
wave.
below
depicts
the
TOF
display
from
the
previous
example.
The x-axis on the A-scan is not typically units of time, but is converted to
distance. This conversion is accomplished by measuring, or looking up, the
speed of sound through the material that the ultrasonic wave is traveling and
performing the conversion. Although there are a few exceptions, the speed of
sound through a material is governed largely by the density and elasticity of the
material. For most materials, the speed of sound within homogenous material is
easy
to
research
and
find.
Most ultrasonic nondestructive test applications range from 400 kHz to 25 MHz.
The frequency of the ultrasonic sensor is chosen based on several factors
including detectable flaw size, depth of penetration, and grain size of the
material. Materials made up of fine grained material, such as metals, permit deep
penetration by ultrasonic waves of all frequencies. However, coarse-grained
material, including many plastics, scatter high frequency ultrasonic waves. The
higher the frequency, the smaller flaws the system will detect, but the depth of
penetration decreases.
8
or
both
waves
are
produced.
10
making
it
difficult
11
to
analyze
the
data.
Refraction and mode conversion occur because of the change in L-wave velocity
as it passes the boundary from one medium to another. The higher the difference
in the velocity of sound between two materials, the larger the resulting angle of
refraction. L-waves and S-waves have different angles of refraction because they
have
dissimilar
velocities
within
the
same
material.
12
look at surfaces that are not parallel to the front surface, such as welds.
1.1
Snells Law
L-wave and S-wave refraction angles are calculated using Snells Law. Snells
Law also can be used to determine the first critical angle for any combination of
materials.
13
Where:
R
I
VI
=
=
angle
incident
=
VR
of
angle
velocity
=
the
from
of
velocity
refracted
normal
incident
of
of
beam
refracted
beam
beam in
in
in
the
the
beam
the
wedge
liquid
in
UUT
or liquid
or
wedge
the
UUT
For example, calculate the first critical angle for a transducer on a plastic wedge
that
is
VI
0.267
VR
0.625
R
I
90
(angle
examining
cm/s
(for
cm/s
of
(for
L-wave
aluminum.
L-waves
L-waves
for
first
in
in
critical
plastic)
aluminum)
angle)
unknown
The plastic wedge must have a minimum angle of 25.29 degrees to transmit only
S-waves into the UUT. When the S-wave angle of refraction is greater than 90
degrees, all ultrasonic energy will be reflected by the UUT.
A common use of ultrasound is in range finding; this use is also called SONAR,
(sound navigation and ranging). This works similarly to RADAR (radio detection
and ranging): An ultrasonic pulse is generated in a particular direction. If there is
14
an object in the path of this pulse, part or all of the pulse will be reflected back to
the transmitter as an echo and can be detected through the receiver path. By
measuring the difference in time between the pulse being transmitted and the
echo being received, it is possible to determine how far away the object is.
The measured travel time of SONAR pulses in water is strongly dependent on
the temperature and the salinity of the water. Ultrasonic ranging is also applied
for measurement in air and for short distances. Such method is capable for easily
and rapidly measuring the layout of rooms.
Although range finding underwater is performed at both sub-audible and audible
frequencies for great distances (1 to several ten kilometers), ultrasonic range
finding is used when distances are shorter and the accuracy of the distance
measurement is desired to be finer. Ultrasonic measurements may be limited
through barrier layers with large salinity, temperature or vortex differentials.
Ranging in water varies from about hundreds to thousands of meters, but can be
performed with centimeters to meters accuracy.
Ultrasound when applied in specific configurations can produce short bursts of
light in exotic phenomena known as sonoluminescence. This phenomena is
being investigated partly because of the possibility of bubble fusion (a nuclear
fusion reaction hypothesized to occur during sonoluminescence).
Recently researchers at the University of Alberta in Canada have successfully
used ultrasound to regenerate dental material.
Ultrasound is used when characterizing particulates through the technique of
ultrasound attenuation spectroscopy or by observing electroacoustic phenomena.
In rheology, an acoustic rheometer relies on the principle of ultrasound. In fluid
mechanics, fluid flow can be measured using an ultrasound flow meter.
15
4.2 MICROCONTORLLER
INTRODUCTION
Microcontrollers are destined to play an increasingly important role in
revolutionizing various industries and influencing our day to day life more strongly
than one can imagine. Since its emergence in the early 1980's the
microcontroller has been recognized as a general purpose building block for
intelligent digital systems. It is finding using diverse area, starting from simple
children's toys to highly complex spacecraft. Because of its versatility and many
advantages, the application domain has spread in all conceivable directions,
making it ubiquitous. As a consequence, it has generate a great deal of interest
and enthusiasm among students, teachers and practicing engineers, creating an
acute education need for imparting the knowledge of microcontroller based
system design and development. It identifies the vital features responsible for
their tremendous impact, the acute educational need created by them and
provides a glimpse of the major application area.
16
MICROCONTROLLER
A microcontroller is a complete microprocessor system built on a single IC.
Microcontrollers were developed to meet a need for microprocessors to be put
into low cost products. Building a complete microprocessor system on a single
chip substantially reduces the cost of building simple products, which use the
microprocessor's power to implement their function, because the microprocessor
is a natural way to implement many products. This means the idea of using a
microprocessor for low cost products comes up often. But the typical 8-bit
microprocessor based system, such as one using a Z80 and 8085 is expensive.
Both 8085 and Z80 system need some additional circuits to make a
microprocessor system. Each part carries costs of money. Even though a product
design may requires only very simple system, the parts needed to make this
system as a low cost product.
To solve this problem microprocessor system is implemented with a single
chip microcontroller. This could be called microcomputer, as all the major parts
are in the IC. Most frequently they are called microcontroller because they are
used they are used to perform control functions.
The
microcontroller
contains
full
implementation
of
standard
17
18
Sl.N
Manufacture
Chip
Year
No.
RA
RO
Other
Designatio
of
Features
Pin
of
I/
64
1K
LED
O
4 Bit MC
1.
Texas
TMS 1000
Instruments
Mid
28
23
197
Display
0
2.
Hitachi
HMCS 40
28
10
32
512
10
bit
ROM
3.
Toshiba
TLCS 47
42
35
128
2K
Serial bit
I/O
8 bit MC
1.
Intel
8048
197
40
27
64
1K
External
Memory
8K
Intel
8051
198
40
32
128
4K
External
Memory
128 K
3.
Motorola
6081
197
31
128
2K
52
40
256
8K
7
4.
Motorola
68HC11
198
5
Serial
Port,
ADC,
5.
Zilog
Z8
40
32
128
2K
External
Memory
128K,
16 Bit MC
1.
Intel
80C196
68
40
232
8K
External
Memory
19
64K,
Serial
Port,
ADC,
WDT,
PWM
2.
Hitachi
H8/532
84
65
1K
32K
External
Memory
1M,
Serial
Port,
ADC,
PWM
3.
National
HPC16164
68
52
512
16K
External
Memory
64K,
ADC,
WDT,
PWM
32 Bit MC
1.
Intel
80960
132
APPLICATION
Microcontrollers did you use today?
A microcontroller is a kind of miniature computer that you can find in all
kinds of Gizmos. Some examples of common, every-day products that have
20
microcontrollers are built-in. If it has buttons and a digital display, chances are it
also has a programmable microcontroller brain.
Every-Day the devices used by ourselves that contain Microcontrollers.
Try to make a list and counting how many devices and the events with
microcontrollers you use in a typical day. Here are some examples: if your clock
radio goes off, and you hit the snooze button a few times in the morning, the first
thing you do in your day is interact with a microcontroller. Heating up some food
in the microwave oven and making a call on a cell phone also involve operating
microcontrollers. That's just the beginning. Here are a few more examples:
Turning on the Television with a handheld remote, playing a hand held game,
Using a calculator, and Checking your digital wrist watch. All those devices have
microcontrollers inside them, that interact with you. Consumer appliances aren't
the only things that contain microcontrollers. Robots, machinery, aerospace
designs and other high-tech devices are also built with microcontrollers.
21
22
PIN DIAGRAM
PIN DESCRIPTION
VCC
Supply voltage.
GND
Ground.
Port 0
Port 0 is an 8-bit open drain bidirectional 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 highimpedance inputs.
23
Port 1
Port 1 is an 8-bit bidirectional I/O port with internal pullups. 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 pullups 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 pullups. Port 1 also receives the low-order address bytes during
Flash programming and verification.
Port 2
Port 2 is an 8-bit bidirectional 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 pullups 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 use 16-bit addresses (MOVX @ DPTR). In this application it uses strong
internal pull-ups when emitting 1s. During accesses to external data memory
that use 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 bidirectional 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,
24
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 listed below:
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 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.
25
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 AT89C51 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.
EA/VPP
External Access Enable. EA must be strapped to GND in order to enable
the device to fetch code from external program memory locations starting at
0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be
internally latched on reset. EA should be strapped to VCC for internal program
executions.
This pin also receives the 12-volt programming enable voltage (VPP)
during Flash programming, for parts that require 12-volt VPP.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
XTAL2
Output from the inverting oscillator amplifier. It should be noted that when
idle is terminated by a hard ware reset, the device normally resumes program
execution, from where it left off, up to two machine cycles before the internal
reset algorithm takes control. On-chip hardware inhibits access to internal RAM
26
in this event, but access to the port pins is not inhibited. To eliminate the
possibility of an unexpected write to a port pin when Idle is terminated by reset,
the instruction following the one that invokes Idle should not be one that writes to
a port pin or to external memory.
ARCHITECTURE OF 89C51
27
ADVANTAGES OF MICROCONTROLLERS:
1.
go for external memory such as RAM, ROM or EPROM and peripherals and
hence the size of the PCB will be large enough to hold all the required
peripherals. But, the micro controller has got all these peripheral facilities on a
single chip so development of a similar system with a micro controller reduces
PCB size and cost of the design.
One of the major differences between a micro controller and a
microprocessor is that a controller often deals with bits , not bytes as in the real
world application, for example switch contacts can only be open or close,
indicators should be lit or dark and motors can be either turned on or off and so
forth.
INTRODUCTION TO ATMEL MICROCONTROLLER
SERIES: 89C51 Family, TECHNOLOGY: CMOS
The major Features of 8-bit Micro controller ATMEL 89C51:
8 Bit CPU optimized for control applications
Extensive Boolean processing (Single - bit Logic ) Capabilities.
On - Chip Flash Program Memory
On - Chip Data RAM
Bi-directional and Individually Addressable I/O Lines
28
29
When power is turned on, the circuit holds the RST pin high for an amount
of time that depends on the capacitor value and the rate at which it charges.
To ensure a valid reset, the RST pin must be held high long enough to
allow the oscillator to start up plus two machine cycles. On power up, Vcc should
rise within approximately 10ms. The oscillator start-up time depends on the
oscillator frequency. For a 10 Mhz crystal, the start-up time is typically 1ms.With
the given circuit, reducing Vcc quickly to 0 causes the RST pin voltage to
momentarily fall below 0V. How ever, this voltage is internally l limited and will not
harm the device.
MEMORY ORGANIZATION:
* Logical Separation of Program and Data Memory *
All Atmel Flash micro controllers have separate address spaces for
porgram and data memory as shown in Fig 1.The logical separation of program
and data memory allows the data memory to be accessed by 8 bit addresses .
Which can be more quickly stored and manipulated by an 8 bit CPU
Nevertheless 16 Bit data memory addresses can also be generated through the
DPTR register.
Program memory can only be read. There can be up to 64K bytes of
directly addressable program memory. The read strobe for external program
memory is the Program Store Enable Signal (PSEN) Data memory occupies a
separate address space from program memory. Up to
64K
bytes
of
external memory can be directly addressed in the external data memory space.
30
The CPU generates read and write signals, RD and WR, during external data
memory accesses. External program memory and external data memory can be
combined by an applying the RD and PSEN signals to the inputs of AND gate
and using the output of the fate as the read strobe to the external program/data
memory.
PROGRAM MEMORY:
The map of the lower part of the program memory, after reset, the CPU
begins execution from location 0000h. Each interrupt is assigned a fixed location
in program
31
internal Flash. Program fetches to addresses 1000h through FFFFh are directed
to external memory.
DATA MEMORY:
The Internal Data memory is dived into three blocks namely, Refer Fig
Internal Data memory Addresses are always 1 byte wide, which implies an
address space of only 256 bytes. However, the addressing modes for internal
RAM can in fact accommodate 384 bytes. Direct addresses higher than 7Fh
access one memory space, and indirect addresses higher than 7Fh access a
different Memory Space.
The lowest 32 bytes are grouped into 4 banks of 8 registers. Program
instructions call out these registers as R0 through R7. Two bits in the Program
Status Word (PSW) Select, which register bank, is in use. This architecture
allows more efficient use of code space, since register instructions are shorter
than instructions that use direct addressing.
The next 16-bytes above the register banks form a block of bit
addressable memory space. The micro controller instruction set includes a wide
selection of single - bit instructions and this instruction can directly address the
128 bytes in this area. These bit addresses are 00h through 7Fh. either direct or
indirect addressing can access all of the bytes in lower 128 bytes. Indirect
32
addressing can only access the upper 128. The upper 128 bytes of RAM are only
in the devices with 256 bytes of RAM.
The Special Function Register includes Ports latches, timers, peripheral
controls etc., direct addressing can only access these register. In general, all
Atmel micro controllers have the same SFRs at the same addresses in SFR
space as the AT89C51 and other compatible micro controllers. However,
upgrades to the AT89C51 have additional SFRs. Sixteen addresses in SFR
space are both byte and bit Addressable. The bit Addressable SFRs are those
whose address ends in 000B. The bit addresses in this area are 80h through
FFh.
ADDRESSING MODES:
DIRECT ADDRESSING:
In direct addressing, the operand specified by an 8-bit address field in the
instruction. Only internal data RAM and SFRs can be directly addressed.
INDIRECT ADDRESSING:
In Indirect addressing, the instruction specifies a register that contains the
address of the operand. Both internal and external RAM can indirectly address.
The address register for 8-bit addresses can be either the Stack Pointer or
R0 or R1 of the selected register Bank. The address register for 16-bit addresses
can be only the 16-bit data pointer register, DPTR.
INDEXED ADDRESSING:
33
34
IMMEDIATE CONSTANTS:
The value of a constant can follow the opcode in program memory For
example. MOV A, #100 loads the Accumulator with the decimal number 100.
The same number could be specified in hex digit as 64h.
PROGRAM STATUS WORD:
Program Status Word Register in Atmel Flash Micro controller:
CY
AC
F0
RS1
RS0
OV
PSW 7
---
P
PSW 0
PSW 6
PSW 1
PSW 5
PSW 2
PSW 4
PSW 3
PSW 0:
Parity of Accumulator Set By Hardware To 1 if it contains an Odd number
of 1s, Otherwise it is reset to 0.
PSW1:
User Definable Flag
PSW2:
Overflow Flag Set By Arithmetic Operations
PSW3:
35
The Parity bit reflect the Number of 1s in the Accumulator .P=1 if the
Accumulator contains an even number of 1s, and P=0 if the Accumulator
contains an even number of 1s. Thus, the number of 1s in the Accumulator plus
36
P is always even. Two bits in the PSW are uncommitted and can be used as
general-purpose status flags.
INTERRUPTS
The AT89C51 provides 5 interrupt sources: Two External interrupts, twotimer interrupts and a serial port interrupts. The External Interrupts INT0 and
INT1 can each either level activated or transistion - activated, depending on bits
IT0 and IT1 in Register TCON. The Flags that actually generate these interrupts
are the IE0 and IE1 bits in TCON. When the service routine is vectored to
hardware clears the flag that generated an external interrupt only if the interrupt
WA transition - activated. If the interrupt was level - activated, then the external
requesting source (rather than the on-chip hardware) controls the requested flag.
Tf0 and Tf1 generate the Timer 0 and Timer 1 Interrupts, which are set by a
rollover in their respective Timer/Counter Register (except for Timer 0 in Mode 3).
When a timer interrupt is generated, the on-chip hardware clears the flag that
generated it when the service routine is vectored to. The logical OR of RI and TI
generate the Serial Port Interrupt. Neither of these flag is cleared by hardware
when the service routine is vectored to. In fact, the service routine normally must
determine whether RI or TI generated the interrupt an the bit must be cleared in
software.
In the Serial Port Interrupt is generated by the logical OR of RI and TI.
Neither of these flag is cleared by hardware when the service routine is vectored
to. In fact, the service routine normally must determine whether RI to TI
generated the interrupt and the bit must be cleared in software.
37
EA
ET2
ES
ET1
EX1
ET0
EX0
Symbol
Position
Function
EA
IE.
IE.6
Undefined / reserved
ET2
IE.5
ES
IE.4
ET1
IE.3
EX1
IE.2
ET0
IE.1
EX0
IE.0
38
39
40
APPLICATIONS OF MICROCONTROLLERS
Microcontrollers are designed for use in sophisticated real time
applications such as
1. Industrial Control
2. Instrumentation and
3. Intelligent computer peripherals
They are used in industrial applications to control
Motor
Robotics
In medical instrumentation
Oscilloscopes
Telecommunication
Automobiles
Driving an LCD
41
Period Measurements
Alarms include:
Burglar alarms, designed to warn of intrusions; this is often a silent alarm: the
police or guards are warned without indication to the burglar, which increases the
chances of catching him or her.
Alarm clocks can produce an alarm at a given time
Distributed control manufacturing systems or DCSs, found in nuclear power
plants, refineries and chemical facilities also generate alarms to direct the
operator's attention to an important event that he or she needs to address.
Alarms in an Operation and Maintenance (O&M) Monitoring system, which
informs the bad working state of (a particular part of the) system under
monitoring.
Safety alarms, which go off if a dangerous condition occurs. Common public
safety alarms include:
Tornado sirens
Fire alarms
Car alarms
Community Alarm or Autodialer alarm (medical alarms)
Air raid sirens
Tocsins an historical method of raising an alarm
Alarms have the capability of causing a fight-or-flight response in humans; a
person under this mindset will panic and either flee the perceived danger or
42
attempt to eliminate it, often ignoring rational thought in either case. We can
characterize a person in such a state as "alarmed".
With any kind of alarm, the need exists to balance between on the one hand the
danger of false alarms (called "false positives") the signal going off in the
absence of a problem and on the other hand failing to signal an actual
problem (called a "false negative"). False alarms can waste resources
expensively and can even be dangerous.
For example, false alarms of a fire can waste firefighter manpower, making them
unavailable for a real fire, and risk injury to firefighters and others as the fire
engines race to the alleged fire's location. In addition, false alarms may
acclimatise people to ignore alarm signals, and thus possibly to ignore an actual
emergency: Aesop's fable of The Boy Who Cried Wolf exemplifies this problem
43
44
A regulator circuit removes the ripples and also remains the same dc
value even if the input dc voltage varies, or the load connected to the output dc
voltage changes. This voltage regulation is usually obtained using one of the
popular voltage regulator IC units.
TRANSFORMER
RECTIFIER
FILTER
45
IC REGULATOR
LOAD
Working principle
Transformer
The transformer will step down the power supply voltage (0-230V) to (0-6V) level.
Then the secondary of the potential transformer will be connected to the
precision rectifier, which is constructed with the help of opamp. The advantages
of using precision rectifier are it will give peak voltage output as DC; rest of the
circuits will give only RMS output.
Bridge rectifier
When four diodes are connected as shown in figure, the circuit is called as
bridge rectifier. The input to the circuit is applied to the diagonally opposite
corners of the network, and the output is taken from the remaining two corners.
Let us assume that the transformer is working properly and there is a
positive potential, at point A and a negative potential at point B. the positive
potential at point A will forward bias D3 and reverse bias D4.
The negative potential at point B will forward bias D1 and reverse D2. At
this time D3 and D1 are forward biased and will allow current flow to pass
through them; D4 and D2 are reverse biased and will block current flow.
The path for current flow is from point B through D1, up through RL,
through D3, through the secondary of the transformer back to point B. this path is
46
indicated by the solid arrows. Waveforms (1) and (2) can be observed across D1
and D3.
One-half cycle later the polarity across the secondary of the transformer
reverse, forward biasing D2 and D4 and reverse biasing D1 and D3. Current flow
will now be from point A through D4, up through RL, through D2, through the
secondary of T1, and back to point A. This path is indicated by the broken
arrows. Waveforms (3) and (4) can be observed across D2 and D4. The current
flow through RL is always in the same direction. In flowing through RL this
current develops a voltage corresponding to that shown waveform (5). Since
current flows through the load (RL) during both half cycles of the applied voltage,
this bridge rectifier is a full-wave rectifier.
One advantage of a bridge rectifier over a conventional full-wave rectifier
is that with a given transformer the bridge rectifier produces a voltage output that
is nearly twice that of the conventional full-wave circuit.
This may be shown by assigning values to some of the components
shown in views A and B. assume that the same transformer is used in both
circuits. The peak voltage developed between points X and y is 1000 volts in
both circuits. In the conventional full-wave circuit shownin view A, the peak
voltage from the center tap to either X or Y is 500 volts. Since only one diode can
conduct at any instant, the maximum voltage that can be rectified at any instant
is 500 volts.
The maximum voltage that appears across the load resistor is nearly-but
never exceeds-500 v0lts, as result of the small voltage drop across the diode. In
the bridge rectifier shown in view B, the maximum voltage that can be rectified is
the full secondary voltage, which is 1000 volts. Therefore, the peak output
voltage across the load resistor is nearly 1000 volts. With both circuits using the
same transformer, the bridge rectifier circuit produces a higher output voltage
than the conventional full-wave rectifier circuit.
47
IC voltage regulators
Voltage regulators comprise a class of widely used ICs. Regulator
IC units contain the circuitry for reference source, comparator amplifier, control
device, and overload protection all in a single IC. IC units provide regulation of
either a fixed positive voltage, a fixed negative voltage, or an adjustably set
voltage. The regulators can be selected for operation with load currents from
hundreds of milli amperes to tens of amperes, corresponding to power ratings
from milli watts to tens of watts.
48
49
Circuit Description:
This circuit is designed to measure the distance of the object with the help
of ultrasonic waves. The 12F675 microcontroller is used to generate the 40 KHz
frequency signal. This signal is given to level logic converter (MAX232) in order
to convert to TTL output pulse to +12v and -12v pulse. Then this pulse is
transmitted through ultrasonic transmitter.
The ultrasonic wave is spread in the air and hit the nearest object and
reflected from the object which is received by the ultrasonic receiver. The
received wave is given to amplifier in order to amplify the received weak signal.
After the amplification the amplified wave is given to zero adjustment amplifier
because the amplified wave is in the range of above 6v level. Then the output is
given to comparator in which the wave signal is converted into corresponding
square wave signal. Then the square wave signal is given to input of the
microcontroller. Now the microcontroller compares the time between the
transmitted signal and received signal and generates the corresponding pulse
output which is equal to distance of the object. Then the pulse signal is given to
input of BC547 transistor.
50
51
The microcontroller circuit is connected with reset circuit, crystal oscillator circuit,
lcd circuit the reset circuit is the one which is an external interrupt which is
designed to reset the program. And the crystal oscillator circuit is the one used to
generate the pulses to microcontroller and it also called as the heart of the
microcontroller here we have used 12mhz crystal which generates pulses upto
12000000 frequency which is converted into machine cycle frequency when
divided by 12 which is equal to 1000000hz i.e. about 10 lakhs frequency is
generated per second to find the time we have to invert the frequency so that we
get one micro second for the execution of a instruction.
Reset circuitry is used to reset the circuit.
(normally low). Upon applying a high pulse to this pin, the microcontroller will
reset and terminate all activities. This is often referred to as a power on reset.
Activating a power-on reset. Will cause all values in the registers to be lost
Notice that the values of the pc is 0 upon reset, forcing the cpu to fetch the first
opcode from ROM memory location 0000. This means that we must place the
first line of source code in rom location 0 because that is where the cpu wakes up
and expects to find the first instruction.
In order for the reset input to be effective it must have a minimum duration of 2
machine cycles. In other words, the high pulse must be high for a minimum of 2
machine cycles before it is allowed to go low
52
ALARM
Buzzer:
A buzzer or beeper is a signalling device, usually electronic, typically used
in automobiles, household appliances such as a microwave oven, or game
shows. It most commonly consists of a number of switches or sensors connected
53
to a control unit that determines if and which button was pushed or a preset time
has lapsed, and usually illuminates a light on the appropriate button or control
panel, and sounds a warning in the form of a continuous or intermittent buzzing
or beeping sound. Initially this device was based on an electromechanical system
which was identical to an electric bell without the metal gong (which makes the
ringing noise).
Often these units were anchored to a wall or ceiling and used the ceiling
or wall as a sounding board. Another implementation with some AC-connected
devices was to implement a circuit to make the AC current into a noise loud
enough to drive a loudspeaker and hook this circuit up to a cheap 8-ohm
speaker. Nowadays, it is more popular to use a ceramic-based piezoelectric
sounder like a Sonalert which makes a high-pitched tone. Usually these were
hooked up to "driver" circuits which varied the pitch of the sound or pulsed the
sound on and off.
Circuit description:
The circuit is designed to control the buzzer. The buzzer ON and OFF is
controlled by the pair of switching transistors (BC 547). The buzzer is connected
in the Q2 transistor collector terminal.
When high pulse signal is given to base of the Q1 transistors, the
transistor is conducting and close the collector and emitter terminal so zero
signals is given to base of the Q2 transistor. Hence Q2 transistor and buzzer is
turned OFF state.
When low pulse is given to base of transistor Q1 transistor, the
transistor is turned OFF. Now 12v is given to base of Q2 transistor so the
transistor is conducting and buzzer is energized and produces the sound signal.
54
Transistor Q1
Transistor
Q2
Buzzer
Microcontroller or PC
1
on
off
off
on
off
on
6.5 RELAY
55
Relay:
A relay is an electrically operated switch. Current flowing through the coil of the
relay creates a magnetic field which attracts a lever and changes the switch contacts. The
coil current can be on or off so relays have two switch positions and they are double
throw (changeover) switches. Relays allow one circuit to switch a second circuit which
can be completely separate from the first. For example a low voltage battery circuit can
use a relay to switch a 230V AC mains circuit. There is no electrical connection inside the
relay between the two circuits; the link is magnetic and mechanical.
The coil of a relay passes a relatively large current, typically 30mA for a 12V
relay, but it can be as much as 100mA for relays designed to operate from lower voltages.
Most ICs (chips) cannot provide this current and a transistor is usually used to amplify
the small IC current to the larger value required for the relay coil. The maximum output
current for the popular 555 timer IC is 200mA so these devices can supply relay coils
directly without amplification.
Relays are usually SPDT or DPDT but they can have many more sets of switch
contacts, for example relays with 4 sets of changeover contacts are readily available.
Most relays are designed for PCB mounting but you can solder wires directly to the pins
providing you take care to avoid melting the plastic case of the relay. The animated
picture shows a working relay with its coil and switch contacts. You can see a lever on
the left being attracted by magnetism when the coil is switched on. This lever moves the
switch contacts. There is one set of contacts (SPDT) in the foreground and another behind
them, making the relay DPDT.
56
The relay's switch connections are usually labeled COM, NC and NO:
COM = Common, always connect to this, it is the moving part of the switch.
NC = Normally Closed, COM is connected to this when the relay coil is off.
NO = Normally Open, COM is connected to this when the relay coil is on.
Circuit description:
This circuit is designed to control the load. The load may be motor or any other
load. The load is turned ON and OFF through relay. The relay ON and OFF is controlled
by the pair of switching transistors (BC 547). The relay is connected in the Q2 transistor
collector terminal. A Relay is nothing but electromagnetic switching device which
consists of three pins. They are Common, Normally close (NC) and Normally open (NO).
The relay common pin is connected to supply voltage. The normally open (NO)
pin connected to load. When high pulse signal is given to base of the Q1 transistors, the
transistor is conducting and shorts the collector and emitter terminal and zero signals is
given to base of the Q2 transistor. So the relay is turned OFF state.
When low pulse is given to base of transistor Q1 transistor, the transistor is
turned OFF. Now 12v is given to base of Q2 transistor so the transistor is conducting and
relay is turned ON. Hence the common terminal and NO terminal of relay are shorted.
Now load gets the supply voltage through relay.
Voltage Signal from
Microcontroller or PC
Transistor Q1
Transistor Q2
Relay
on
off
off
off
on
on
57
7. PCB DESIGN
INTRODUCTION:
Printed circuit boards, or PCBs, form the core of electronic equipment
domestic and industrial. Some of the areas where PCBs are intensively used are
computers, process control, telecommunications and instrumentation.
MANUFATCURING:
The manufacturing process consists of two methods; print and etch, and
print, plate and etch. The single sided PCBs are usually made using the print and
etch method. The double sided plate through hole (PTH) boards are made by
the print plate and etch method.
The production of multi layer boards uses both the methods. The inner
layers are printed and etch while the outer layers are produced by print, plate and
etch after pressing the inner layers.
SOFTWARE:
The software used in our project to obtain the schematic layout is
MICROSIM.
58
PANELISATION:
Here the schematic transformed in to the working positive/negative films. The
circuit is repeated conveniently to accommodate economically as many
circuits as possible in a panel, which can be operated in every sequence of
subsequent steps in the PCB process. This is called penalization. For the
PTH boards, the next operation is drilling.
DRILLING:
PCB drilling is a state of the art operation. Very small holes are drilled with
high speed CNC drilling machines, giving a wall finish with less or no smear or
epoxy, required for void free through hole plating.
PLATING:
The heart of the PCB manufacturing process. The holes drilled in the
board are treated both mechanically and chemically before depositing the copper
by the electro less copper platting process.
ETCHING:
Once a multiplayer board is drilled and electro less copper deposited, the
image available in the form of a film is transferred on to the out side by photo
printing using a dry film printing process. The boards are then electrolytic plated
on to the circuit pattern with copper and tin. The tin-plated deposit serves an etch
resist when copper in the unwanted area is removed by the conveyors spray
etching machines with chemical etch ants. The etching machines are attached to
an automatic dosing equipment, which analyses and controls etch ants
concentrations
59
SOLDERMASK:
Since a PCB design may call for very close spacing between conductors,
a solder mask has to be applied on the both sides of the circuitry to avoid the
bridging of conductors. The solder mask ink is applied by screening. The ink is
dried, exposed to UV, developed in a mild alkaline solution and finally cured by
both UV and thermal energy.
8 SOFTWARE TOOLS
8.1 KEIL C COMPILER:
60
Keil development tools for the 8051 Microcontroller Architecture support every
level of software developer from the professional applications engineer to the
student
just
learning
about
embedded
software
development.
The industry-standard Keil C Compilers, Macro Assemblers, Debuggers, Realtime Kernels, Single-board Computers, and Emulators support all 8051
derivatives and help you get your projects completed on schedule
The Keil 8051 Development Tools are designed to solve the complex problems
facing embedded software developers.
When starting a new project, simply select the microcontroller you use
from the Device Database and the Vision IDE sets all compiler, assembler,
linker, and memory options for you.
Numerous example programs are included to help you get started with the
most popular embedded 8051 devices.
When you are ready to begin testing your software application with target
hardware, use the MON51, MON390, MONADI, or FlashMON51 Target
61
It's been suggested that there are now as many embedded systems in everyday
use as there are people on planet Earth. Domestic appliances from washing
machines to TVs, video recorders and mobile phones, now include at least one
embedded processor. They are also vital components in a huge variety of
automotive, medical, aerospace and military systems. As a result, there is strong
demand for programmers with 'embedded' skills, and many desktop developers
are moving into this area.
Embedded C is designed for programmers with desktop experience in C, C++ or
Java who want to learn the skills required for the unique challenges of embedded
systems.
The book and CD-ROM include the following key features:
8.3 Simulator:
The Keil hardware simulator for the popular 8051 microcontroller is on the CDROM so that readers can try out examples from the book - and create new ones without requiring additional hardware.
Key techniques required in all embedded systems are covered in detail, including
the
control
of
port
pins
and
62
the
reading
of
switches.
PROGRAM
63
64
10. ADVANTAGES
LOW COST TO DESIGN THE CIRCUIT AND THE ULTRASONIC SENSOR IS
EAZILY AVALIBALE
MAINTAINENCE OF THE CIRCUIT IS GOOD
BY USING THIS MICROCONTROLER IC WE CAN CREATE MANY MORE
CONTROL TO THE APPLIANCES
REALIBILITY
COMPATIBILITY
EASY CONVEINENCE TO HANDLE
GOOD SECURITY FOR APPLIANCES
11. APPLICATIONS
65
The project done here is to explain the way of safety measures for the blind
people when nearing the objects. If so happens it automatically senses and turns
on the alarm.
needed to get rid off the accidents by using the wave generators both on forward
and reverse directions. For people dont have eyes it will be very much useful
because the sensor warns when the object is struck by the waves. These type of
waves are very much useful in the medical field for scanning etc,
66
13.
REFERENCES
MILL MAN J and HAWKIES C.C. INTEGRATED
ELECTRONICS MCGRAW HILL, 1972
ROY CHOUDHURY D, SHAIL JAIN, LINEAR INTEGRATED
CIRCUIT, New Age International Publishers, New Delhi,2000
THE 8051 MICROCONTROLLER AND EMBEDDED SYSTEM by
Mohammad Ali Mazidi.
http://www.atmel.com/
http://www.microchip.com/
www.8052.com
67
http://www.beyondlogic.org
http://www.ctv.es/pckits/home.html
http://www.aimglobal.org/
68