CHAPTER 1
INTRODUCTION
CHAPTER 1
INTRODUCTION
Ultrasound is used in many different fields. Ultrasonic devices are used to detect
objects and measure distances. Ultrasonic imaging (sonography) is used in
both veterinary medicine and human medicine. In the nondestructive testing of products
and structures, ultrasound is used to detect invisible flaws. Industrially, ultrasound is
used for cleaning and for mixing, and to accelerate chemical processes. Organisms such
as bats and porpoises use ultrasound for locating prey and obstacles.
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. For example hand-held ultrasonic measuring
tools can rapidly measure the layout of rooms.
common use today. Embedded systems contain processing cores that are tyPICally
either microcontrollers or digital signal processors (DSP).
For example, hand held computers share some elements with embedded
systems such as the operating systems and microprocessors that power them, but they
allow different applications to be loaded and peripherals to be connected.
Moreover, even systems that do not expose programmability as a primary feature
generally need to support software updates. On a continuum from "general purpose"
to "embedded", large system applications will have subcomponents at most points
even if the system as a whole is "designed to perform one or a few dedicated
functions", and is thus appropriate to call "embedded".
CHAPTER 2: In this chapter we are giving the detailed information of History and
principles of Ultrasonic’s
CHAPTER 2
HISTORY AND PRINCIPLES OF ULTRASONICS
CHAPTER 2
HISTORY AND PRINCIPLES OF ULTRASONICS
2.1 History of Ultrasonic’s
Acoustics is a branch of physics and is study of sound, mechanical waves in
gases, liquids, and solids. A scientist who works in the field of acoustics is an
acoustician. The application of acoustics in technology is called acoustical engineering.
There is often much overlap and interaction between the interests of acousticians and
acoustical engineers.
Galileo is said to have started to modern studies of acoustics. He elevated the study of
vibrations and the correlation between pitch and frequency of the sound source to scientific
standards. His interest in sound was inspired in part by his father, who was a mathematician,
musician, and composer. Following Galileo's foundation work, progress in acoustics came
relatively quickly. The French mathematician Marin Mersenne studied the vibration of
stretched strings; the results of these studies were summarized in the three Mersenne's laws.
Mersenne's Harmonicorum Libri (2636) provided the basis for modern musical acoustics.
Later in the century Robert Hooke, the English physicist, first produced a sound wave of
known frequency, using a rotating cog wheel as a measuring device.
Piezo-electric effect in certain crystals was discovered by Pierre Curie and his
brother Jacques Curie in Paris, France in 2880. It was then possible for the generation
and reception of 'ultrasound' that are in the frequency range of millions of cycles per
second (megahertz) which could be employed in echo sounding devices. The roots of
ultrasonic technology can be traced back to this research on the piezoelectric effect
conducted by Pierre Curie. It was found that asymmetrical crystals such as quartz and
Rochelle salt (potassium sodium tartrate) generate an electric charge when mechanical
pressure is applied. Conversely, mechanical vibrations are obtained by applying
electrical oscillations to the same crystals.
Investigations of high-frequency waves did not originate until the 29th century.
The era of modern ultrasonic’s started about 2927, with Langevin's use of high-
frequency acoustic waves and quartz resonators for submarine detection. Since that time,
the field has grown enormously, with applications found in science, industry, medicine
and other areas. Underwater detection systems were developed for the purpose of
underwater navigation by submarines in World war I and in particular after the Titanic
sank in 2922.
In the reflection technique, a pulsed sound wave is transmitted from one side of
the sample, reflected off the far side, and returned to a receiver located at the starting
point. Upon impinging on a flaw or crack in the material, the signal is reflected and its
traveling time altered. The actual delay becomes a measure of the flaw's location; a map
of the material can be generated to illustrate the location and geometry of the flaws. In
the through-transmission method, the transmitter and receiver are located on opposite
sides of the material. Interruptions in the passage of sound waves are used to locate and
measure flaws.
Sri Venkateswara Institute Of Science And Information Technology 9
Ultrasonic range finder using PIC microcontroller
The first practical RADAR system (Radio Detection and Ranging, and using
electromagnetic waves rather than ultrasonics) was produced in 2935 by another British
physicist Robert Watson-Watt. Such radar systems had been the direct precursors of
subsequent 2-dimensional sonars and medical ultrasonic systems that appeared in the late
2940s.
It was around similar times in the early 2940s that ultrasound was used
experimentally as a possible diagnostic tool in medicine. Karl Theodore Dussik, a
neurologist/psychiatrist from the University of Vienna, Austria was regarded as the first
physician to have employed ultrasound in medical diagnosis. Dussik, together with his
brother Friederich, a physicist, attempted to locate brain tumors and the cerebral
ventricles by measuring the transmission of ultrasound beam through the skull. The
Dussiks presented their experiments in their papers in 2942 and in 2947 introduced the
term "hyperphonography". They used a through-transmission technique with two
transducers placed on either side of the head, and producing what they called
"ventriculograms", or echo images of the ventricles of the brain.
1822 Colladen used underwater bell to calculate the speed of sound in waters of Lake
Geneva.
1830 Savart developed large, toothed wheel to generate very high frequencies.
1842 Magnetostrictive effect discovered by Joule.
1845 Stokes investigated effect of viscosity on attenuation.
1860 Tyndall developed the sensitive flame to detect high frequency waves.
1866 Kundt used dust figures in a tube to measure sound velocity.
1876 Galton invented the ultrasonic whistle.
1877 Rayleigh's "Theory of Sound" laid foundation for modern acoustics.
2944 Lynn and Putnam successfully used ultrasound waves to destroy brain tissue of
animals.
2945 Newer piezoelectric ceramics such as barium titanate discovered.
2945 Start of the development of power ultrasonic processes.
2948 Start of extensive study of ultrasonic medical imaging in the United States and
Japan.
2954 Jaffe discovered the new piezoelectric ceramics lead titanate-zirconate
The word Sonar is an American term first used in World War II, it is an acronym
for Sound, Navigation and Ranging. The British also call Sonar, ASDICS, which stands
for Anti-Submarine Detection Investigation Committee. Later developments of Sonar
included the echo sounder, or depth detector, rapid-scanning Sonar, side-scan Sonar, and
WPESS (within-pulse electronic-sector-scanning) Sonar. One of the first applications for
ultrasonic’s was sonar. It was employed on a large scale by the U.S. Navy during World
War II to detect enemy submarines.
Ultrasonics is the science of sound waves above the limits of human audibility. The
frequency of a sound wave determines its tone or pitch. Low frequencies produce low or
bass tones. High frequencies produce high or treble tones. Ultrasound is a sound with a
pitch so high that it can not be heard by the human ear. Frequencies above 28 Kilohertz
are usually considered to be ultrasonic. Higher frequencies have shorter wavelengths,
which allow them to reflect from objects more readily and to provide better information
about those objects. However, extremely high frequencies are difficult to generate and to
measure.
"Ultrasonics" should not be confused with the term "supersonics," which was
formerly applied to this field. Supersonics now refers to the study of phenomena arising
when the velocity of a solid body exceeds the speed of sound.
"Ultrasonics" should not be confused with the term "supersonics," which was
formerly applied to this field. Supersonics now refers to the study of phenomena arising
when the velocity of a solid body exceeds the speed of sound.
An electronic "power pack" generates very short bursts of electrical energy which
are sent to a transducer, which operates as a "loudspeaker" to convert those short bursts,
or pulses, of electrical energy into very short bursts of high frequency sound energy.
After sending out a single burst of this high frequency sound, the transducer is switched
over so that it now acts as a "microphone" to PICk up the sounds of the returning echoes
created when that pulse of sound hits an object. The returning echoes of this short pulse
of high frequency sound are received back by the transducer (operating as a microphone)
which converts sound energy into electrical energy. These tiny bursts of electrical
energy, now much weaker than the original signal, are then put through an amplifier
which increases their strength to the point that they can be used to light a neon bulb,
Light Emitting Diode, or to activate a pixel on an LCD.
When one signal is received back as an echo, another sound signal is sent out and
its echo is captured and amplified before the next sound signal is sent out. The time
between these short pulses of sound will vary from unit to unit, but must always be
sufficient to allow the returning echo to get back from the greatest depth range for which
the unit is set to read. Some units operate on a number of depth ranges, so have to vary
the timing of their sound pulses for each depth range accordingly. The short bursts or
pulses of sound last for only a tiny period of time, and are expressed in terms of
thousandths of a second (milliseconds).
Distance:
The distance to the target may be determined by measuring the delay time
between the probe and the echo.
Direction:
By using either a directional beacon or a directional detector, it is possible to
determine the vector direction to the target.
Velocity/Motion:
The frequency of the returned signal may undergo a frequency shift due to the
Doppler Effect which indicates the relative velocity of the target.All of these pieces of
information may be determined by careful measurement of the returned signal. The
accuracy of such determinations is affected by the quality of the probe signal as well as
the quality of the detector. Fluctuations in probe intensity or frequency can lead to errors
in the interpretation of the signal which are more significant than the errors induced by
the detector. In general, the performance of such systems may be limited by either
component.
Challenging problems remain but solutions are being found. New principles and
techniques are being discovered that will improve the use of ultrasound. Employing
tomo-holographic techniques to reduce ambiguity in probing three-dimensional objects,
near-field techniques to boost resolution and using limited-diffraction beams to provide
image construction with ultra high frame rates are cases in point.
All sensors which operate by probing the external environment with signals are
governed by some basic rules of wave propagation.
CHAPTER 3
HARDWARE COMPONENTS
CHAPTER 3
HARDWARE COMPONENTS
The hardware components we used in this project are given below
RESISTORS
CAPACITORS
LCD DISPLAY
PIC MICROCONTOLLER
ULTRASONIC SENSOR
CRYSTAL OSCILLATOR
POWER SUPPLY
BUZZER
PCB
3.1 Resistor
A resistor is a linear, passive two-terminal electrical component that implements
electrical resistance as a circuit element. The current through a resistor is in direct
proportion to the voltage across the resistor's terminals. Thus, the ratio of the voltage
applied across a resistor's terminals to the intensity of current through the circuit is called
resistance. The current through a resistor is in directly proportional to the voltage across
the resistor's terminals. This relationship is represented by Ohm’s law
Where I is the current through the conductor in units of amperes, V is the potential
difference measured across the conductor in units of volts, and R is the resistance of the
conductor in units of ohms
.
Resistors are common elements of electrical networks and electronic circuits and
are ubiquitous in most electronic equipment. Practical resistors can be made of various
compounds and films, as well as resistance wire (wire made of a high-resistivity alloy,
such as nickel-chrome). Resistors are also implemented within integrated circuits,
particularly analog devices, and can also be integrated into hybrid and printed circuits.
The farad (symbol: F) is the SI unit of capacitance. The unit is named after the
English physicist Michael Faraday.
Definition
F is the charge in coulombs which a capacitor will accept for the potential across
it to change 1 volt. A coulomb is 1 ampere second.
Example: A capacitor with capacitance of 47 mF (47 milli farads, more often expressed
as 47000 μF) will increase by 1 volt per second with a 47 m A input current values of
capacitors are usually specified in ranges of farads (F), microfarads (μF or MFD, one
millionth or 10-6 of a farad), nano farads (nF, 10-9 farad), or PICo farads (pF, 10-12 farad).
The important part for us is the signal conditioning of SRF04. We trigger the
sensor and then wait for echo pulse. Measuring echo pulse width is important for us
because 66.4 us means us 1 cm.
As seen from timing diagram of SRF04 after triggering sensor with TTL logic 1
(we use 5 V) at least 10 us, sonic burst module embedded in sensor makes 8 cycle sonic
burst at 40 kHz. After the last sonic burst go low our echo signal became high and stay
high until any reflected sound received by the sensor. Our initial objective is to trigger
the sensor and then read the echo signal and measure its pulse width.
3.3.1 Interface
availability of low cost or free development tools, and serial programming (and re-
programming with flash memory) capability. They are also commonly used in
educational programming as they often come with the easy to use 'PIC logicator'
software.
3.4.1 History of PIC
The original PIC was built to be used with General Instrument's new 16-bit CPU,
the CP1600. While generally a good CPU, the CP1600 had poor I/O performance, and
the 8-bit PIC was developed in 1975 to improve performance of the overall system by
offloading I/O tasks from the CPU. The PIC used simple microcode stored in ROM to
perform its tasks, and although the term was not used at the time, it shares some common
features with RISC designs.
In 1985, General Instrument spun off their microelectronics division and the new
ownership cancelled almost everything which by this time was mostly out-of-date. The
PIC, however, was upgraded with internal EPROM to produce a programmable channel
controller and today a huge variety of PICs are available with various on-board
peripherals (serial communication modules, UARTs, motor control kernels, etc.) and
program memory from 256 words to 64k words and more (a "word" is one assembly
language instruction, varying from 12, 14 or 16 bits depending on the specific PIC micro
family).
The Microchip 16C84 (PIC16x84), introduced in 1993, was the first Microchip
CPU with on-chip EEPROM memory. This electrically erasable memory made it cost
less than CPUs that required a quartz "erase window" for erasing EPROM.
There is no distinction between memory space and register space because the RAM
serves the job of both memory and registers, and the RAM is usually just referred to as
the register file or simply as the registers.
3.4.3 Data Space(Ram)
PICs have a set of registers that function as general purpose RAM. Special
purpose control registers for on-chip hardware resources are also mapped into the data
space. The addressability of memory varies depending on device series, and all PIC
devices have some banking mechanism to extend addressing to additional memory. Later
series of devices feature move instructions which can cover the whole addressable space,
independent of the selected bank. In earlier devices, any register move had to be
achieved via the accumulator.
To implement indirect addressing, a "file select register" (FSR) and "indirect
register" (INDF) are used. A register number is written to the FSR, after which reads
from or writes to INDF will actually be to or from the register pointed to by FSR. Later
devices extended this concept with post- and pre- increment/decrement for greater
efficiency in accessing sequentially stored data. This also allows FSR to be treated
almost like a stack pointer (SP).
External data memory is not directly addressable except in some high pin count
PIC18 devices.
Sri Venkateswara Institute Of Science And Information Technology 24
Ultrasonic range finder using PIC microcontroller
2. Operation with WREG and indexed register. The result can be written to either
the Working register (e.g. addwf reg,w). or the selected register (e.g. addwf
reg,f).
3. Bit operations. These take a register number and a bit number, and perform one
of 4 actions: set or clear a bit, and test and skip on set/clear. The latter are used to
perform conditional branches. The usual ALU status flags are available in a
numbered register so operations such as "branch on carry clear" are possible.
4. Control transfers. Other than the skip instructions previously mentioned, there are
only two: goto and call.
3.4.6 Performance
RISC (Reduced Instruction Set) architecture we can see Harvard architecture that means
the controller has got separate program memory which makes it faster than any other
controller. One of the most important works is to choose the correct model that will
support our project. For serial communication with PC we need Universal Synchronous
Asynchronous Receiver Transmitter (USART/SCI) property. So we choose 16F877
which has got these properties.
Our PIC has a 8K program memory which enables us write programs without
thinking the capacity. Also we can use 14 external interrupts with this model.
Additionally we have 5 ports (a, b, c ,d, e), 3 timers, 2 counters and only 35 instructions
to program.
Our connection diagram is shown below:
As shown we will use INIT1, INIT2, INIT3 to trigger the sensors and RC1 to
read the ECHO1, ECHO2, and ECHO measuring the pulse width and make necessary
operations we will send the data through MAX232 with TX/CK Pin (25) .
The alphanumeric 16character X 2line LCD requires 8data lines and also 3
control signals and they are interfaced to 3664.By using 2 ports, port 0&3 data pins are
connected to LCD as data bus. Port0 can be basically used as I/O port i.e. it can be
programmed as an input or as an output port.
Depending on the operation to be performed the control words are selected and
passes to the LCD. The data to be displayed on the LCD is to be sent in the ASCII
format. Thus all the character to be displayed are converted into ASCII form and then
sent to the LCD along with different control words. The control word differentiated the
various operations and is executed. It is also possible to read the LCD data if required.
The control signals to the LCD are also provided by the Micro controller. This is
also done through pins 3.5,3.6&3.7.Through program necessary control signals are
passed to the LCD by using the bits of the port. The remaining can be used for some
other purpose if there is a need. The software controls the necessary ports and performs
the task it is designed for. The soft ware and associated hardware perform the LCD
interface.
LCD Interface
LCD DISPLAY
A liquid crystal is a material (normally organic for LCDs) that will flow like a
liquid but whose molecular structure has some properties normally associated with
solids. The Liquid Crystal Display (LCD) is a low power device. The power requirement
is tyPICally in the order of microwatts for the LCD. However, an LCD requires an
external or internal light source. It is limited to a temperature range of about 0C to 60C
and lifetime is an area of concern, because LCDs can chemically degrade.
There are two major types of LCD s which are:
1) Dynamic-scattering LCD s
2) Field-effect LCD s
Field-effect LCD s are normally used in such applications where source of energy
is a prime factor (e.g., watches, portable instrumentation etc.).They absorb considerably
less power than the light-scattering type. However, the cost for field-effect units is
tyPICally higher, and their height is limited to 2 inches. On the other hand, light-
scattering units are available up to 8 inches in height. Field-effect LCD is used in the
project for displaying the appropriate information. The turn-on and turn-off time is an
important consideration in all displays. The response time of LCD s is in the range of
100 to 300ms.The lifetime of LCD s is steadily increasing beyond 10,000+hours limit.
Since the colour generated by LCD units is dependent on the source of illumination,
there is a wide range of colour choice.
3 V0 Contrast Adjust
6 E Enable Signal
This is the first interfacing example for the parallel port. We will star with
something simple. This example does not use the Bi-directional feature found on newer
ports, thus it should work with most, if no all Parallel Ports. It however does not show
the use of the status port as an input. So what are we interfacing? A 16 Character, 2 Line
LCD Module to the Parallel Port. These LCD Modules are very common these days, and
are quite simple to work with, as all the logic required running them is on board.
3.5.2 Features
The LM 78XXX series of the three terminal regulations is available with several
fixed output voltages making them useful in a wide range of applications. One of these
is local on card regulation. The voltages available allow these regulators to be used in
logic systems, instrumentation and other solid state electronic equipment. Although
designed primarily as fixed voltage regulators, these devices can be used with external
components to obtain adjustable voltages and currents. The LM78XX series is available
in aluminum to 3 packages which will allow over 1.5A load current if adequate heat
sinking is provided. Current limiting is included to limit the peak output current to a safe
value. The LM 78XX is available in the metal 3 leads to 5 and the plastic to 92. For this
type, with adequate heat sinking. The regulator can deliver 100mA output current. The
advantage of this type of regulator is, it is easy to use and minimize the number of
external components.
The positive voltage regulator has different features like Output current up to 1.5A
No external components
Internal thermal overload protection
High power dissipation capability
Internal short-circuit current limiting
Output transistor safe area compensation
Direct replacements for Fairchild microA7800 series
Nominal Output
Voltage Regulator
5V uA7805C
6V uA7806C
8V uA7808C
8.5V uA7885C
10V uA7810C
12V uA7812C
15V uA7815C
18V uA7818C
24V uA7824C
mains line. For this purpose centre tapped secondary of 12V-012V transformer is used.
From this transformer we getting 5V power supply. In this +5V output is a regulated
output and it is designed using 7805 positive voltage regulator. This is a 3 Pin voltage
regulator, can deliver current up to 800 milliamps.
3.7.1 Transformer
... (3.1)
So,
... (3.2)
Sri Venkateswara Institute Of Science And Information Technology 35
Ultrasonic range finder using PIC microcontroller
The secondary voltage of the transformer depends on the number of turns in the Primary as
Well as in the secondary.
... (3.3)
3.7.2 Rectifier
A rectifier is a device that converts an AC signal into DC signal. For rectification
purpose we use a diode, a diode is a device that allows current to pass only in one
direction i.e. when the anode of the diode is positive with respect to the cathode also
called as forward biased condition & blocks current in the reversed biased condition.
Rectifier can be classified as follows:
Half wave rectifier
Full wave rectifier
Bridge rectifier
This is the simplest type of rectifier as you can see in the diagram a half wave
rectifier consists of only one diode. When an AC signal is applied to it during the
positive half cycle the diode is forward biased & current flows through it. But during the
negative half cycle diode is reverse biased & no current flows through it. Since only one
half of the input reaches the output, it is very inefficient to be used in power supplies.
Half wave rectifier is quite simple but it is very inefficient, for greater efficiency
we would like to use both the half cycles of the AC signal. This can be achieved by using
a centre tapped transformer i.e. we would have to double the size of secondary winding
& provide connection to the centre. So during the positive half cycle diode D1 conducts
& D2 is in reverse biased condition. During the negative half cycle diode D2 conducts &
D1 is reverse biased. Thus we get both the half cycles across the load.
One of the disadvantages of Full Wave Rectifier design is the necessity of using a centre
tapped transformer, thus increasing the size & cost of the circuit. This can be avoided by
using the Full Wave Bridge Rectifier.
3) Bridge Rectifier:
As the name suggests it converts the full wave i.e. both the positive & the
negative half cycle into DC thus it is much more efficient than Half Wave Rectifier &
that too without using a centre tapped transformer thus much more cost effective than
Full Wave Rectifier.
Full Bridge Wave Rectifier consists of four diodes namely D1, D2, D3 and D4.
During the positive half cycle diodes D1 & D4 conduct whereas in the negative half
cycle diodes D2 & D3 conduct thus the diodes keep switching the transformer
connections so we get positive half cycles in the output.
If we use a center tapped transformer for a bridge rectifier we can get both
positive & negative half cycles which can thus be used for generating fixed positive &
fixed negative voltages.
Even though half wave & full wave rectifier give DC output, none of them
provides a constant output voltage. For this we require to smoothen the waveform
received from the rectifier. This can be done by using a capacitor at the output of the
rectifier this capacitor is also called as “FILTER CAPACITOR” or “SMOOTHING
CAPACITOR” or “RESERVOIR CAPACITOR”. Even after using this capacitor a small
amount of ripple will remain.
... (3.4)
Where,
Vr = accepted ripple voltage.( should not be more than 10% of the voltage)
I = current consumed by the circuit in Amperes.
F = frequency of the waveform. A half wave rectifier has only one peak in one cycle
So F=25 Hz
Whereas a full wave rectifier has Two peaks in one cycle so F=100 Hz.
efficiency as compared to linear voltage regulators. But they are more complex &
generate high noise due to their switching action. For low level of output power
switching regulators tend to be costly but for higher output wattage they are much
cheaper than linear regulators.
The most commonly available Linear Positive Voltage Regulators are the 78XX
series where the XX indicates the output voltage. And 79XX series is for Negative
Voltage Regulators.
After filtering the rectifier output the signal is given to a voltage regulator. The
maximum input voltage that can be applied at the input is 35V.Normally there is a 2-3
Volts drop across the regulator so the input voltage should be at least 2-3 Volts higher
than the output voltage. If the input voltage gets below the Vmin of the regulator due to
the ripple voltage or due to any other reason the voltage regulator will not be able to
produce the correct regulated voltage.
IC 7805
7805 is an integrated three-terminal positive fixed linear voltage regulator. It
supports an input voltage of 10 volts to 35 volts and output voltage of 5 volts. It has a
current rating of 1 amp although lower current models are available. Its output voltage is
fixed at 5.0V. The 7805 also has a built-in current limiter as a safety feature. 7805 is
manufactured by many companies, including National Semiconductors and Fairchild
Semiconductors.
The 7805 will automatically reduce output current if it gets too hot. The last two
digits represent the voltage; for instance, the 7812 is a 12-volt regulator. The 78xx series
of regulators is designed to work in complement with the 79xx series of negative voltage
regulators in systems that provide both positive and negative regulated voltages, since
the 78xx series can't regulate negative voltages in such a system.
The 7805 & 78 is one of the most common and well-known of the 78xx series
regulators, as it's small component count and medium-power regulated 5V make it useful
for powering TTL devices.
SPECIFICATIONS IC 7805
Vout 5V
Vein - Vout Difference 5V - 20V
Operation Ambient Temp 0 - 125°C
Output Imax 1A
When a voltage source is applied to a small thin piece of quartz crystal, it begins
to change shape producing a characteristic known as the Piezo-electric effect. This
Piezo-electric effect is the property of a crystal by which an electrical charge produces a
mechanical force by changing the shape of the crystal and vice versa, a mechanical force
applied to the crystal produces an electrical charge.
3.9 Buzzer
3.10.1 Introduction
One of the most discouraging things about making a hardware project is building
the printed circuit board-PCB.it is sometimes possible to use strip board or some other
pre-fabricated board but more often than not the circuit complexity and performance
requires a proper PCB to be made . The good news is that due to improvements in
printing and processing technologies it is now relatively easy to make inexpensive high
quality PCB’s at home.
Warning- Making PCB’s requires the use of Ferric Chloride(FeCi3) which is corrosive
so avoid skin and eye contact .Remember safety-first so, use glasses, gloves and
protective overalls .Ferric Chloride is also very good at distorting cloths weeks after you
think you have washed it off. If you do get any on your skin then wash it off immediately
with lots of water and soap.
Clean the copper board very well with the PCB cleaning rubber.
Heat the cloths iron to 300 deg F.
Hole the film with the print in contact to the copper and smoothly iron the film
down until the print appears black through the film (about 1min).
Allow 5min to cool down (or speed up this with water) then peel the film off.
This should produce a clean black print on to the copper. If you let the film move
or overheat then you will find that the tracks and writing will be smeared and out of
focus also the film may be wrinkled up. If you don’t use enough heat or heat unevenly
then the film may not stick or to be dark enough. In either case clean off the PCB and try
again, you should get it right after a couple of goes.
Dilute the concentrated Ferric Chloride fluid with water (1:1) and pour into the
one liter glass jar.
Put the PCB copper side up on the top tray and pour all Ferric Chloride on top.
Gently rock the top tray to keep the etch fluid moving avoiding spillage.
After about 15min all of the unwanted copper disappears.
3.10.4 Drilling
Drilling with 0.8mm drill bits can be bit tricky as it is easy to break the drill bits.
Always hold the drill straight and do not bend it when the hole has started .Using a
0.8mm PCB drill bit, drill out all of the component holes that are required. So, now the
PCB is finished and it is ready to solder.
CHAPTER-4
BLOCK DIAGRAM AND CIRCUIT DESCRIPTION
CHAPTER-4
BLOCK DIAGRAM AND CIRCUIT DESCRIPTION
The project uses 5 standard transistors to receive and transmit the ultrasound and
a comparator to set the threshold echo detection level - so there are no special
components other than the microcontroller. The ultrasonic transducers are standard
40kHz types.
Note that the internal oscillator of the PIC micro is used and this saves two pins
that can be used for normal I/O.You can recompile the PIC sonar project files if you
want examine code operation (using the built in simulator) or change the source code.
Note the hex file is contained in the download).
You need to divide by 2 as the distance is the round trip distance i.e. from
transmitter to object and back again.
Where:
Note: The speed of sound in air is more or less constant at 330m/s (@ 0ºC) - it
varies mainly with temperature (~340m/s @ 20ºC). In this project I am using a value of
340m/s i.e. it is assumed that the project is used indoors. You can change it to whatever
you like by modifying the code.
You can get ultrasonic transducers optimized for 25 kHz, 32 kHz, 40 kHz or wide
bandwidth transducers. This project uses a 40 kHz transducer but it will still work with
the others if you make simple changes to the software (where it generates the 40kz
signal). The receiver and generator circuits will work as they are.
Note: If you use a different transducer you must change the software to generate
the correct frequency for the transducer as they only work at their specific operating
frequency. The 40kz signal is easily generated by the microcontroller but detection
requires a sensitive amplifier. I have used a three transistor amplifier for the receiver.
This is followed by a peak detector and comparator which sets the sensitivity threshold
so that false reflections (weaker signals) are ignored.
4.5 CCP - Capture Mode
This project makes use of the CCP module (in its capture mode) to accurately
measure the signal reception time at the CCP port pin. When a signal triggers the CCP
module the value of timer 1 is stored in a CCP register (or captured).
If you store the value of timer 1 and then enable the CCP after transmitting an
ultrasound pulse the CCP will trigger when the comparator activates i.e. as soon as an
ultrasonic echo is received. Subtracting the stored value from the CCP register value
gives the time delay in machine cycles. Since the project uses a 4MHz main clock then
the time delay will be measured in micro-seconds.
The minimum distance of this scheme is about 5cm. Looking at the output of the
first receiver amplifier shows a it should be more accurate at lower distances - it is
inaccurate by about 2cm which is still quite good. Probably the addition of amplifiers for
the longer range stops accurate short range operation. The maximum distance is limited
by the sensitivity, gain and noise performance of the receive amplifier and also the
transmit power and duration of transmission. For this circuit the maximum distance is
about 112cm.
Set the output of the comparator (RB0) low by turning preset VR2 fully in one
direction. Point the transducers at an object at about 1 meters away and turn the preset
until the display generates '100' (approx).
Move the board back and forwards to check that it displays a larger and then
smaller number. Check the longer distance e.g. points at the ceiling and then a closer
object e.g. a wall 20-50cm away. Adjust the preset as necessary
4.9 Process
At the beginning of semester we try to decide which type of hardware to buy.
Initially we want to use Polaroid 6500 ultrasonic module which exist in laboratory. Also
Sri Venkateswara Institute Of Science And Information Technology 49
Ultrasonic range finder using PIC microcontroller
one advantage of Polaroid is we make it work and search on how it works. After that we
see that there will be lots of problems while using Polaroid. First one is its power
problem. It requires 2A current which is very high for electronic applications. Also it has
got serious connector problems between transducer-driver circuit and between control
pins –power circuit. Than we search on and try to find another ultrasonic sensor module.
After searching we find SRF04 which is economical in power consumption also smaller
in size and easily controllable. We buy sensors via visa card from internet site
www.robotelectronics.co.uk.
Next stage for us is deciding on what kind of microcontroller we use. You can
think of why we use microcontroller instead of directly connecting SRF04 to PC that
contains A/D card. We use microcontroller because in timing measurements we need
66us sensitivity that cannot be provided high-level languages. We initially think of Intel
8051 microprocessor. Again we search and find that PIC 16F877 microcontroller is
much more suitable for our application. After we got sensors and our 16F877 we start on
working. Initially we test sensors. We test how they work, and apply signals that are at
different frequency. We find at what frequency we need to trigger sensors. Apart from
this we test ECHO signal and find sensitivity approximately. Our test data is shown
below.
In software part we try to develop algorithms for both triggering sensor via PIC
and reading echo signal with PIC. After making PIC work we try to develop algorithm
on PIC-PC serial communication. And lastly we develop codes for data processing on
PC that converts time data to distance and map position on the screen. The diagram
below shows us the general working principle of our system as schematic.
PC PIC SRFO4
CHAPTER 5
SOFTWARE DEVELOPMENT
CHAPTER 5
SOFTWARE DEVELOPMENT
5.1. Introduction
In this chapter the software used and the language in which the program code is
defined was mentioned and a program code dumping tools are explained. The chapter
also documents the development of the program for the application. This program has
been termed as “Source code”.
It's much easier working with a high level language (such as C or BASIC)
because it uses words that are easily recognized by humans. This typically results in a
program that is much easier to write and understand. In fact I would say that it takes
about 1/10th the time to write a high level language program compared to writing the
same program in assembler. This is because the complier hides the low level detail
letting you get on with solving the problem.
With a PIC compiler you can visually describe the program flow using tabs and
spaces making it easy to see how a program works. A good PIC compiler also includes
a help system for looking up elements of the language and a simulator which makes
debugging the code easy.
The one advantage that the interpreted system has is that since the memory
device is separate it can be made as large as required - so you can create big programs.
The fact that the interpreted language is slow is not advertised and you can tell the
difference as a compiler will work with any chip but for an interpreted system you must
buy a ready programmed chip - probably on a PCB. Compilers will work with any chip
as long as you have a programmer.
And this brings us to the next point - If you want to create lots of projects then for
a compiler you have a onetime non recurring cost - the compiler itself. But for an
interpreted system you must keep buying the PCB and support chips - so your projects
will cost a lot more to make
A PIC compiler (or any compiler) is a program that translates one computer
program into another. Source code written in a high level language is translated into
machine code that the microcontroller understands. This simplifies the task since you do
not have to write assembler - you are only concentrating on the high level language.
5.3. Dumper
We can obtain the hex file from the compiler and it is to be dumped in to the PIC
16F877A (decision making device) to perform the desired task.
There are two main languages used for PIC microcontroller programming BASIC
and C. These are by far the most popular languages and there are many compilers with
varying cost/performance ratios. Other less popular PIC compilers are PASCAL,
FORTH and JAL.
1. ANSI Standardized
Having an ANSI standard associated with a language means that any PIC
compiler can be used to compile the source code - and the compiler will accept
that source code regardless of the target micro family. Note you may have to make some
adjustments e.g. register names hardware operation etc. It is a problem for BASIC as
there is no standard - so if you write basic source code using one compiler it most likely
will not work if you use a different compiler
2. Ease of use
C easy - difficult.
PASCAL easy - difficult.
FORTH very difficult.
BASIC easy.
JAL easy.
3. Main benefit:
CHAPTER 6
RESULTS
CHAPTER 6
RESULTS
6.1 Snapshots
The kit consists of hardware of ultra sonic range finder using PIC microcontroller
used to measure the distance which is displayed on the LCD screen
The above figure is the snapshot of ultrasonic range finder final proto type
CHAPTER 7
ADVANTAGES AND APPLICATIONS
CHAPTER 7
ADVANTAGES AND APPLICATIONS
7.1 Advantages
CONCLUSION
CONCLUSION
So by this we can conclude that using this we can find the distance of an object in
mediums like air and water accurately with in short range
FUTURE SCOPE
FUTURE SCOPE
Further Improvements
Range Improvement
When the time of the pulse is long, the energy of the ultrasonic is big and the
long-range measurement becomes possible. However, when making a transmission
pulse long, the signal which influences a receiver increases. Therefore, the guard time
must be made long and it becomes not possible to do the measurement of the short
distance. The shortest measurement distance is decided by total value of guard time
and the pulse sending-out time.
BIBILOGRAPHY
BIBILOGRAPHY
[1] Muhammad Ali Mazzidi, Janice Gillispie Mazidi-The 8051 Micro Controller And
Embedded Systems-Phi-2000.
[2] Douglas V-Hall - Microprocessors And Interfacing - Tata Mc Graw Hill Publishing
Company Limited - 1999 ,2nd Edition.
[6] www.Bestmicrocontrollers.Com
[7] www.Alldatasheets.Com
[8] www.Datasheetarchive.Com
[9] www.Projectguidance.Com