Top Banner
11/10/2008 Instrumentation - II | Er. Sharib Ali ER. SHARIB ALI INSTRUMENTATION SYSTEM-II
89

Instrumentation

Nov 22, 2014

Download

Engineering

Sharib Ali

Bio-medical basics, sensor studies, micro-controller designs, industrial case studies
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Instrumentation

1.

11/10/2008

Instrumentation - II | Er. Sharib Ali

ER. SHARIB ALI INSTRUMENTATION SYSTEM-II

Page 2: Instrumentation

INSTRUMENTATION-II

2 BY: Er. Sharib Ali

From the Author

“A complete manual on INSTRUMENTATION-II” has been written with the motive of making the students of Engineering build a concept on different areas of the electronics based instrumentation systems vastly used in medical instruments and industrial instruments. The concept of manual is also to emphasis on the various sensors and transducers, amplifiers, interfacing devices like ADC, DAC, multiplexers, decoders etc which are essential in the design of any microprocessor based instrumentation. It also covers the several algorithms, flow charts and software concepts used in the programming of the microprocessor based instrumentation system. The manual is divided into three parts-

I. Biomedical Instrumentation II. Microprocessor Based Instrumentation and its components and III. Various case studies related to the Industrial troubleshooting, case study

preparation and techniques to implement advanced system for better results both economically and technically.

The manual is concise in itself covering the syllabus of Instrumentation II (BEG 434EC) of VIIIth semester of Purvanchal University. I am highly obliged to Er. Ashok Yadav (Principal of Eastern College of Engineering), Er. Ghanshyam Pathak (Head of Electronics Department), Er. B.M. Singh (Program co-coordinator of EASCOLL) and all my students of VIIIth semester especially Mr. Arjun Bhandary, Mr. Robin Pokhrel, Mr. Sunil Singh, Mr. Gyannath Sapkota, Mr. Bhupal Khatiwada, Miss. Kamu Aryal, Mr. Jayendra Mehta and all others who encouraged me to compile this manual. I want to thank my family members who have supported me during my late works. I look forward to your kind suggestion towards improvement. Er. Sharib Ali

Page 3: Instrumentation

INSTRUMENTATION-II

3 BY: Er. Sharib Ali

What is a biomedical instrument? To many it’s an EKG machine, to others it’s a chemical biosensor, and to some it’s a medical imaging system. There are a lot of instruments that qualify as biomedical instruments. Current estimates of the worldwide market in biomedical instruments is over $200 billion. Even though there is a wide variety of instruments, almost all of them can be modeled using the simple diagram below.

Biomedical Instrumentation System

All biomedical instruments must interface with biological materials. That interface can by direct contact or by indirect contact (e.g., induced fields). A sensor must:

i. detect biochemical, bioelectrical, or biophysical parameters ii. reproduce the physiologic time response of these parameters iii. provide a safe interface with biological materials

An actuator must:

i. deliver external agents via direct or indirect contact ii. control biochemical, bioelectrical, or biophysical parameters iii. provide a safe interface with biologic materials

The electronics interface must:

i. match electrical characteristics of the sensor/actuator with computation unit ii. preserve signal to noise ratio of sensor iii. preserve efficiency of actuator iv. preserve bandwidth (i.e., time response) of sensor/actuator v. provide a safe interface with the sensor/actuator vi. provide a safe interface with the computation unit vii. provide secondary signal processing functions for the system

Page 4: Instrumentation

INSTRUMENTATION-II

4 BY: Er. Sharib Ali

The computation unit must: i. provide primary user interface; ii. provide primary control for the overall system ii. data storage for the system; provide primary signal processing functions for the

system; iii. maintain safe operation of the overall system

Types of Biomedical Instruments Types of Biomedical Instrumentation Systems • Direct / Indirect

• Invasive / Noninvasive

• Contact / Remote

• Sense / Actuate

• Real-time / Static

Direct/Indirect - The sensing system measure a physiologic parameter directly, such as the average volume blood flow in an artery, or measures a parameter related to the physiologic parameter of interest (e.g., EKG recording at the body surface is related to propagation of the action potential in the heart but is not a measurement of the propagation waveform). Invasive/Noninvasive - Direct electrical recording of the action potential in nerve fibers using an implantable electrode system is an example of an invasive sensor. An imaging system measuring blood flow dynamics in an artery (e.g., ultrasound color flow imaging of the carotid artery) is an example of a noninvasive sensor. Contact/Remote - A strain gauge sensor attached to a muscle fiber can record deformations and forces in the muscle. An MRI or ultrasound imaging system can measure internal deformations and forces without contacting the tissue. Sense/Actuate - A sensor detects biochemical, bioelectrical, or biophysical parameters. An actuator delivers external agents via direct or indirect contact and/or controls biochemical, bioelectrical, or biophysical parameters. An automated insulin delivery pump is an example of a direct, contact actuator. Noninvasive surgery with high intensity, focused ultrasound (HIFU) is an example of a remote, noninvasive actuator. Real-time/Static - Static instruments measure temporal averages of physiologic parameters. Real-time instruments have a time response faster than or equal to the physiologic time constants of the sensed parameter. For example a real-time, ultrasound Doppler system can measure changes in arterial blood velocity over a cardiac cycle.

Page 5: Instrumentation

INSTRUMENTATION-II

5 BY: Er. Sharib Ali

Testing Instrumentation

Chapter-1 1.0Factors to be considered in the design or specification of medical instrumentation system-

The branch of science that includes the measurement of physiological variables and parameters is known as biometrics. Biomedical instrumentation provides the tools by which these measurements can be achieved. In the design or specification of medical instrumentation systems, each of the following factors should be considered.

i) Range: The range of an instrument is generally considered to include all the levels of input amplitude and frequency over which the device is expected to operate.

ii) Sensitivity: The sensitivity of an instrument determines how small variation of a variable or parameter can be reliably measured. The sensitivity is concerned with the minute changes that can be detected. Too high sensitivity often results in nonlinearities or instability. Thus, the optimum sensitivity must be determined for any given type of measurement.

iii) Linearity: The degree to which variations in the o/p of an instrument follow i/p variations is referred to as the linearity of the device. In a linear system the sensitivity would be the same for all absolute levels of i/p whether in the high, middle or low portion of the range. Linearity should be obtained over the most important segments even if it is impossible to achieve it over the entire range.

iv) Hysteresis: Hysteresis is a characteristic of some instruments whereby a given value of the measured variable results in a different reading when reached in an ascending direction from that obtained when it is reached in a descending direction.

v) Frequency Response: The frequency response of an instrument is its variation in sensitivity over the frequency range of the measurement. It is important to display a wave shape that is a faithful reproduction of the original physiological signal.

vi) Accuracy: Accuracy is a measure of systemic error. Accuracy is the difference between true value and measured value divided by true value.

vii) Signal to noise ratio (SNR): It is important that the SNR be as high as possible. It is also important to know and control the SNR in the actual environment in which the measurements are to be made.

viii) Stability: In control engineering, stability is the ability of a system to resume a steady state condition following a disturbance of the i/p rather than a driven uncontrollable oscillation.

ix) Isolation: Often measurements must be made on patients or experimental animals in such a way that the instrument does not produce a direct electrical connection between the subject and ground.

x) Simplicity: All systems and instruments should be as simple as possible to eliminate the change of component or human error.

Page 6: Instrumentation

INSTRUMENTATION-II

6 BY: Er. Sharib Ali

1.1 Microprocessors in Biomedical Instrumentation The first biomedical instruments incorporating microprocessors began to appear on the market around 1975 while the first devices were mainly laboratory type instruments, microprocessors are now used in all areas of biomedical instrumentation. Following are some examples of the ways in which microprocessors are employed in contemporary medical instruments.

i) Calibration: Many instruments require zeroing and recalibration at certain time intervals, sometime every few hours. A software or hardware timer in a microprocessor system can initiate a calibration cycle. Microprocessor equipped devices usually perform the calibration in digital form. During the calibration, offset and gain correction factors are determined and stored in memory to be applied to the measured data during the measurement.

ii) Table lookup: In analog systems, non-linear functions are usually implemented by straight line approximations. In microprocessor equipped systems, table lookup with interpolation can be used. This procedure is less limited and more accurate and also permits the determination of parameters that are dependent on more than one variable.

iii) Averaging: Microprocessor can easily average data over time or over successive measurements and can thus decrease statistical variations.

iv) Formatting and printout: Because medical equipment using microprocessor usually processes data in digital form, the microprocessor can be utilized to format the data, convert the raw data into physical units and print out the results in a form that does not require further transcribing or processing.

1.1.1 Introduction to infrared, Ultraviolet and X-ray

Infrared (IR) radiation is electromagnetic radiation whose wavelength is longer than that of visible light, but shorter than that of terahertz radiation and microwaves. The name means "below red" (from the Latin infra, "below"), red being the color of visible light with the longest wavelength. Infrared radiation has wavelengths between about 750 nm and 1 mm, spanning three orders of magnitude. Humans at normal body temperature can radiate at a wavelength of 10 microns.

Ultraviolet (UV) light is electromagnetic radiation with a wavelength shorter than that of visible light, but longer than X-rays. It is named because the spectrum consists of refrangible electromagnetic waves with frequencies higher than those that humans identify as the color violet.

UV light is typically found as part of the radiation received by the Earth from the Sun. Most humans are aware of the effects of UV through the painful condition of sunburn. The UV spectrum has many other effects, including both beneficial and damaging changes to human health.

Page 7: Instrumentation

INSTRUMENTATION-II

7 BY: Er. Sharib Ali

An X-ray (or Röntgen ray) is a form of electromagnetic radiation with a wavelength in the range of 10 to 0.01 nanometers, corresponding to frequencies in the range 30 petahertz to 30 exahertz (30×1015Hz to 30×1018Hz) and energies in the range 120 eV to 120 keV. They are longer than gamma rays but shorter than UV rays. X-rays are primarily used for diagnostic radiography and crystallography. X-rays are a form of ionizing radiation and as such can be dangerous. In many languages it is called Röntgen radiation after one of the first investigators of the X-rays, Wilhelm Conrad Röntgen.

1.1.2 Application of IR, UV and X-rays

Applications of IR

1. Infrared Filters

Infrared (IR) filters can be made from many different materials. Infrared filters allow a maximum of infrared output while maintaining extreme covertness. Currently in use around the world, infrared filters are used in Military, Law Enforcement, Industrial and Commercial applications. All generations of night vision devices are greatly enhanced with the use of IR filters.

2. Night Vision Equipment

Infrared is used in night vision equipment when there is insufficient visible light to see. Night vision devices operate through a process involving the conversion of ambient light photons into electrons which are then amplified by a chemical and electrical process and then converted back into visible light. Infrared light sources can be used to augment the available ambient light for conversion by night vision devices, increasing in-the-dark visibility without actually using a visible light source.

3. Thermography

Infrared radiation can be used to remotely determine the temperature of objects (if the emissivity is known). This is termed thermography. Thermography (thermal imaging) is mainly used in military and industrial applications but the technology is reaching the public market in the form of infrared cameras on cars due to the massively reduced production costs.

4. Communications

IR does not penetrate walls and so does not interfere with other devices in adjoining rooms. Infrared is the most common way for remote controls to command appliances. Free space optical communication using infrared lasers can be a relatively inexpensive way to install a communications link in an urban area operating at up to 4 gigabit/s, compared to the cost of burying fiber optic cable.

Infrared lasers are used to provide the light for optical fiber communications systems. Infrared light with a wavelength around 1,330 nm (least dispersion) or 1,550 nm (best transmission) are the best choices for standard silica fibers.

Page 8: Instrumentation

INSTRUMENTATION-II

8 BY: Er. Sharib Ali

5. Meteorology

Weather satellites equipped with scanning radiometers produce thermal or infrared images which can then enable a trained analyst to determine cloud heights and types, to calculate land and surface water temperatures, and to locate ocean surface features. The scanning is typically in the range 10.3-12.5 µm (IR4 and IR5 channels).

Applications of UV

1. Security

To help thwart counterfeiters, sensitive documents (e.g. credit cards, driver's licenses, passports) may also include a UV watermark that can only be seen when viewed under a UV-emitting light. Passports issued by most countries usually contain UV sensitive inks and security threads. Visa stamps and stickers on passports of visitors contain large and detailed seals invisible to the naked eye under normal lights, but strongly visible under UV illumination.

2. Fluorescent lamps

Fluorescent lamps produce UV radiation by ionising low-pressure mercury vapour. A phosphorescent coating on the inside of the tubes absorbs the UV and converts it to visible light.

3. Spectrophotometry

UV/VIS spectroscopy is widely used as a technique in chemistry, to analyze chemical structure, most notably conjugated systems. UV radiation is often used in visible spectrophotometry to determine the existence of fluorescence in a given sample.

4. Sterilization

A low pressure mercury vapor discharge tube floods the inside of a hood with shortwave UV light when not in use, sterilizing microbiological contaminants from irradiated surfaces.

Ultraviolet lamps are used to sterilize workspaces and tools used in biology laboratories and medical facilities.

5. Lasers

Ultraviolet lasers have applications in industry (laser engraving), medicine (dermatology and keratectomy), free air secure communications and computing (optical storage). They can be made by applying frequency conversion to lower-frequency lasers, or from Ce:LiSAF crystals (cerium doped with lithium strontium aluminum fluoride).

Page 9: Instrumentation

INSTRUMENTATION-II

9 BY: Er. Sharib Ali

Applications of X-Ray

• Medical diagnosis: Since Röntgen's discovery that X-rays can identify bony structures, X-rays have been developed for their use in medical imaging. Radiology is a specialized field of medicine. Radiographers employ radiography and other techniques for diagnostic imaging. This is probably the most common use of X-ray technology.

• X-ray crystallography - in which the pattern produced by the diffraction of X-rays through the closely spaced lattice of atoms in a crystal is recorded and then analyzed to reveal the nature of that lattice. A related technique, fiber diffraction, was used by Rosalind Franklin to discover the double helical structure of DNA.

• X-ray astronomy, which is an observational branch of astronomy, which deals with the study of X-ray emission from celestial objects.

• X-ray microscopic analysis, which uses electromagnetic radiation in the soft X-ray band to produce images of very small objects.

• X-ray fluorescence, a technique in which X-rays are generated within a specimen and detected. The outgoing energy of the X-ray can be used to identify the composition of the sample.

• Industrial radiography uses x-rays for inspection of industrial parts, particularly welds.

• Paintings are often X-rayed to reveal the underdrawing and pentimenti or alterations in the course of painting, or by later restorers. Many pigments such as lead white show well in X-ray photographs.

• Airport security luggage scanners use x-rays for inspecting the interior of luggage for security threats before loading on aircraft.

1.1 X-RAY Basis of Diagnostic Radiology:

A radiological examination is one of the most important diagnostic aids in the medical practice. It is based on the fact that various anatomical structures of the body have different densities for the X-rays.

When X-rays from a point source penetrate a section of the body, the internal body structures absorb varying amount of the radiation. The radiation that leaves the body has a spatial intensity variation i.e. an image of the internal structure of the body. The commonly used arrangement for diagnostic radiology is shown in figure.

Page 10: Instrumentation

INSTRUMENTATION-II

10 BY: Er. Sharib Ali

The X-ray intensity distribution is visualized by a suitable device like a photographic film. A shadow image is generated that corresponds to the X-ray density of the organs in the body section.

The main properties of X-rays, which make them suitable for the purpose of medical diagnosis are their-

• Capability to penetrate matter coupled with different absorption observed in various material

• Ability to produce luminescence and its effect on the photographic emulsions.

The X-ray picture is called a radiograph, which is a shadow picture produced by X-rays emanating from a point source. The X-ray picture is usually obtained on photographic film placed in the image plane.

Nature of X-rays

X-rays are electromagnetic radiation located at the low wavelength end of the electromagnetic spectrum. The X-rays in the medical diagnostic region have wavelength of the order of 10-10m. They propagate with a speed of 3 x 108 m/s and are unaffected by electric and magnetic fields. According to the quantum theory, electromagnetic radiation consists of photons, which are conceived as ‘Packets’ of energy. Their interaction with matter involves an energy exchange and the relation between the wavelength and the photon is given by,

E = νh = λhc

, where

h = Plank’s constant = 6.32 x 10-34 Js c = velocity of propagation of photons = 3 x 108 m/s ν = frequency of radiation λ = wavelength

Page 11: Instrumentation

INSTRUMENTATION-II

11 BY: Er. Sharib Ali

A vibration can be characterized either by its frequency or by its wavelength. In the case of X-rays, the wavelength is directly dependent on the voltage with which the radiation is produced.

Properties of X-rays

They travel in straight line. Because of short wavelength and extremely high energy, X-rays are able to penetrate

through materials which readily absorb and reflect visible light. Not deflected by electric or magnetic field. X-rays produce ionization in gases and influence the electric properties of liquids

and solids. Cause certain substances to fluorescence helping them to emit light , e.g. Barium

platinocyanide. Affect a photographic emulsion in a similar manner to light.

Unit of X-ray

The International Commission on Radiological units and Measurement has adapted Rontgen as a measure of the quantity of X-ray radiation. This unit is based on the ability of radiation to produce ionization and is abbreviated ‘R’.

1.1.3 Principle of operation of X-ray tube

X-Rays are produced by energy conversions when fast moving electrons from the filament of the X-Ray tube interact with the tungsten anode (target). X-rays are generated by two different processes:-

General radiation (Bremsstrahlung) Characteristic radiation (K-Shell)

Fig.a X-ray tube Fig.b Typical spectrum of X-ray produced

Page 12: Instrumentation

INSTRUMENTATION-II

12 BY: Er. Sharib Ali

Electrons are emitted from the heated cathode (Thermionic effect). The electrons are accelerated through a large potential difference (20kV to 100 kV for diagnosis) before bombarding a metal anode. X-rays are generated when fast moving electrons are suddenly decelerated by impinging on a target metal of high melting point and high atomic weight (like tungsten, molybdenum). These X-rays produced leave the tube via a ‘window’. An X-ray tube is basically a high vaccum diode with a heated cathode located opposite a target anode as shown in figure. This diode is operated in the saturated mode with a fairly low cathode temperature so that the current through the tube does not depend on the applied anode high voltage. Since the majority of the energy of the electrons is transferred to thermal energy in the metal anode, the anode is either water cooled or is made to spin rapidly so that the target area is increased. The anode is held at earth potential.

The intensity of the X-rays depends on the current through the tube. This current can be varied by varying the heater current which in turn controls the cathode temperature. The wavelength of the X-rays depends on the target material and the velocity of the electrons hitting the target. It can be varied by varying the target voltage of the tube. The electron beam is concentrated to form a small spot on the target. The X-rays emerge in all directions from this spot, which therefore can be considered a point source for the radiation.

The hardness of the X-ray beam (i.e. penetration of the X-rays) is controlled by the accelerating voltage between the cathode and anode. More penetrating X-rays have higher photon energies and thus a larger accelerating potential is required. Referring fig.b it can be seen that longer wavelength X-rays (‘Softer’ X-rays) are always also produced. Indeed some X-ray photons are of such low energy that they would be not able to pass through the patient. These ‘soft’ X-rays would contribute to the total radiation dose without any useful purpose. Consequently, an aluminium filter is frequently fitted across the window of the X-ray tube to absorb the soft X-ray photons.

1.1.4 Instrumentation for Diagnostic X-rays

Fig. Instrumentation for diagnostic X-ray (Chest X-ray)

The use of X-rays as a diagnostic tool is based on the fact that various anatomical structrures of the body have different densities for the X-rays. When X-rays from a point source

Page 13: Instrumentation

INSTRUMENTATION-II

13 BY: Er. Sharib Ali

penetrate a body section, the internal structure of the body absorbs varying amount of the radiation. The radiation that leaves the body, therefore, has a spatial intensity variation that is an image of the internal structure of the body. When this intensity distribution is visualized by a suitable device, a shadow image is generated that corresponds to the X-ray density of the organs in the body section. If a picture is required of bones, this is relatively simple since the absorption by bone of X-ray photons is considerably greater than the absorption by surrounding muscles and tissues. X-ray pictures of other parts of the body may be obtained if there is sufficient difference between the absorption properties of the organ under review and the surrounding tissues.

The quality of the shadow picture produced on the photographic plate depends on its sharpness and contrast. Sharpness is concerned with the ease with which the edges of structures can be determined. A sharp image implies that the edges of organs are clearly defined. An image may be sharp but, unless there is a marked difference in the degree of blackening of the image between one organ and another, the information that can be gained is limited. An X-ray plate with a wide range of exposures, having areas showing little or no blackening as well as areas of heavy blackening is said to have good contrast.

In order to achieve as sharp an image as possible, the X-ray tube is designed to generate a beam of X-rays with minimum width. Factors in the design of the X-ray instrumentation for diagnosis that may affect sharpness include-

• the area of the target anode • the size of the aperture, produced by overlapping metal plates, through which the X-

ray beam passes after leaving the tube • the use of a lead grid in front of the photographic film to absorb scattering X-ray

photons

1.1.5 Introduction to X-ray Machine

X-ray Machine consists of following -

Fig. X-ray Machine

Cathode is the negative terminal of the X-Ray tube. It consists of:-

A filament-source of electrons A Metallic Focusing cup

Glass enclosure Cathode Anode

Stationary

anode Rotating anode

Page 14: Instrumentation

INSTRUMENTATION-II

14 BY: Er. Sharib Ali

Connecting wires to supply voltage and ampere to heat the filament

Filament is made up of tungsten wires(0.2mm dia) coiled to form a vertical spiral ,0.2cm in dia. and 1cm in length. Tungsten - high melting point (33700C) and strong. Current heats the filament as a result electrons are emitted due to thermionic emission. This process of formation of electron cloud is called Edison effect.

Anode is the positive electrode of the tube. It is of two types-

Stationary anode Rotating anode

Stationary anode

Small plate of tungsten(2-3mm thick) embedded in large mass of copper Square or rectangular in shape Anode angle 15-200 Tungsten –

High atomic no.-more electrons for X-Ray production High melting point (33700C) Good material for absorption and dissipation of heat

Large copper portion of the anode facilitates heat dissipation as Cu is a better conductor of heat

Rotating anode

Large disc of tungsten rotates at a speed of 3600rpm Tungsten disc has a beveled edge- angle 6-200 Purpose-spread the heat produced during an exposure over a large area of anode Disc diameter-75,100 or 125mm

Mechanical problems

Power to effect rotation Friction- Lubrication

Oil vaporizes-destroy tube Graphite wear off-destroy tube Metallic lubricants suitable e.g. silver

Heat dissipation-absorption of heat by anode assembly is undesirable-malfunctioning of bearings. Stem- molybdenum (bad conductor/high M.P)

Tube shielding

Lined with lead Absorbs primary and scattered X-Rays-reduces needless exposure & film

fogging To provide shielding for high voltages required to produce X-Rays. To prevent short circuiting between the grounding wires & the tube the space

between them is filled with thick mineral oil. Oil has good electrical insulating & thermal cooling properties.

Page 15: Instrumentation

INSTRUMENTATION-II

15 BY: Er. Sharib Ali

1.2 Mass Spectrometry

1.2.1 Definition, purpose and Application

Definition:

Mass spectrometry is a powerful analytical technique that is used to identify unknown compounds(both qualitative and quantitative), to quantify known compounds and to elucidate the structure and chemical properties of molecules.

It measures the masses of individual molecules that have been converted into ions, i.e., molecules that have been electrically charged.

This unit of mass is often referred to by chemists and biochemists as the dalton (Da for short), and is defined as follows: 1 Da=(1/12) of the mass of a single atom of the isotope of carbon-12(12C).

Compounds can be identified at very low concentration (1 part in 1E12) in chemically complex mixtures.

Purpose:

To detect and identify the use of steroid in the athelets To monitor the breath of the anesthesiologists during surgery To determine the composition of molecular species found in space To determine whether honey is adulterated with corn syrup To detect the dioxins in contaminated fish To monitor the fermentation processes for the biotechnology industry To determine gene damage from environmental causes To locate oil deposits by measuring petroleum precursors in rock To establish the elemental composition of semiconductor materials

Application:

Identify the structures of biomolecules ( carbohydrate, nucleic acid, steroid) Sequence Biopolymers such as proteins and oligosaccharides Pharmacokinetics is often studied using mass spectrometry because of the complex

nature of the matrix (often blood or urine) and the need for high sensitivity to observe low dose and long time point data.

Perform Forensic analysis such as conformation and quantitation of drugs of abuse Analyze environmental pollutants Determining the age and origins of specimens in geochemistry and archaeology Identify and quantitate compouds of complex organic mixtures Perform ultrasensitive multielement inorganic analysis

Page 16: Instrumentation

INSTRUMENTATION-II

16 BY: Er. Sharib Ali

1.2.2 Simple Block Diagram

1.2.3 Principle of operation

The different functional units of a mass Spectrometer are represented conceptually in the block diagram as shown in the figure. However, the four major steps are illustrated in brief below which are very essential in it.

Stage 1: Ionization The atom is ionized by knocking one or more electrons off to give a positive ion. Mass spectrometers always work with positive ions.

Stage 2: Acceleration The ions are accelerated so that they all have the same kinetic energy.

Page 17: Instrumentation

INSTRUMENTATION-II

17 BY: Er. Sharib Ali

Stage 3: Deflection The ions are then deflected by a magnetic field according to their masses. The lighter they are, the more they are deflected. The more the ion is charged, the more it gets deflected.

Stage 4: Detection The beam of ions passing through the machine is detected electrically

Fig. Principle of operation

Mass spectrometers can be divided into three fundamental parts, namely the ionisation source , the analyser , and the detector.

The sample has to be introduced into the ionisation source of the instrument. Once inside the ionisation source, the sample molecules are ionised, because ions are easier to manipulate than neutral molecules. These ions are extracted into the analyser region of the mass spectrometer where they are separated according to their mass (m) -to-charge (z) ratios (m/z) . The separated ions are detected where the ion flux is converted to a proportional electrical current and this signal sent to a data system where the m/z ratios are stored together with their relative abundance for presentation in the format of a m/z spectrum .

The analyser and detector of the mass spectrometer, and often the ionisation source too, are maintained under high vacuum to give the ions a reasonable chance of travelling from one end of the instrument to the other without any hindrance from air molecules. The entire operation of the mass spectrometer, and often the sample introduction process also, is under complete data system control on modern mass spectrometers.

Simplified schematic of a mass spectrometer

Page 18: Instrumentation

INSTRUMENTATION-II

18 BY: Er. Sharib Ali

1.3 Nuclear Magnetic Resonance Instruments

1.3.1 Definition, purposes, Application areas

Definition

Nuclear magnetic resonance tomography has emerged as a powerful imaging technique in the medical field because of its high resolution capability and potential for chemical specific imaging.

It uses magnetic fields and radio frequency signals to obtain anatomical information about the human body as cross sectional images in any desired direction and can be easily discriminated between healthy and diseased tissue.

MR has much greater soft tissue contrast than Computed tomography (CT) making it especially useful in neurological, musculoskeletal, cardiovascular and oncological diseases

NMR images are essentially a map of the distribution density of hydrogen nuclei and parameters reflecting their motion, in cellular water and lipids.

Application Areas

Diagnosing tumors of the pituitary gland and brain Diagnosing infections in the brain, spine or joints Diagnosing multiple sclerosis (MS) Visualizing torn ligaments in the wrist, knee and ankle Visualizing shoulder injuries Diagnosing tendonitis Evaluating masses in the soft tissues of the body Evaluating bone tumors, cysts and bulging or herniated discs in the spine Diagnosing strokes in their earliest stages MR Angiography

Advantages of NMR imaging System

The advantages of the NMR imaging system are

It provides image between soft tissues that are nearly identical. Cross-sectional images with any orientation are possible NMR imaging parameters areaffected by chemical bonding and therefore offer

potential for physiological imaging NMR uses no ionizing radiation NMR imaging requires no moving parts, gantries or sophisticated crystal detectors. NMR permits imaging of entire 3D volumes simultaneously instead of slice by slice.

Biological Effects of NMR imaging

The three aspects of NMR imaging which could cause potential health hazar are-

Heating due to the rf power Static magnetic field

Page 19: Instrumentation

INSTRUMENTATION-II

19 BY: Er. Sharib Ali

Electric current induction to rapid change in magnetic field

1.3.2 Principle of operation

Many atomic nuclei behave as if they possess a ‘spin’. Such nuclei have an odd number of protons and/or an odd number of neutrons. Their ‘spin’ causes the nuclei of these atoms to behave as tiny magnets. If an external magnetic field is applied to these atoms, they will tend to line up in the magnetic field. This alignment is not perfect and the nuclei rotate about the direction of the field as they spin. This type of motion is referred to as precession. The motion is similar to the motion of a top spinning in a gravitational field.

The frequency of precession (the Lamour frequency) depends on the nature of the nucleus and the strength of the magnetic field. The Lamour frequency is found to lie in the radio-frequency (RF) region of the electromagnetic spectrum. If a short pulse of radio waves of frequency equal to the Lamour frequency is applied, the atoms will resonate, absorbing energy. When the pulse ends, the atoms will return to their original equilibrium state after a short period of time, called the relaxation time. In so doing, RF radiation is emitted by the atoms. There are, in fact, two relaxation processes and it is the times between these that forms the basis of magnetic resonance imaging (MRI).

Examples of nuclei that show this effect include hydrogen, carbon and phosphorus. Because of its abundance in body tissue and fluids, hydrogen is the atom used in this scanning tehnique. A schematic diagram of a magnetic resonance (MR) scanner is shown in Fig.

The person under investigation is placed between the poles of a very large magnet that produces a uniform magnetic field in excess of 1 tesla. All the hydrogen nuclei within the person would have the same Lamour frequency because this frequency is dependent on the magnetic field strength. In order to locate a particular position of hydrogen atoms within the person, a non-uniform magnetic field is also applied. This non-uniform field is accurately calibrated so that there is a unique value of magnetic field

Page 20: Instrumentation

INSTRUMENTATION-II

20 BY: Er. Sharib Ali

strength at each point in the person. This value, coupled with the particular value of the Lamour frequency, enables the hydrogen nuclei to be located.

Radio-frequency pulses are transmitted to the person by means of suitable coils. These coils are also used to detect the RF emissions from the patient. The received emissions are processed in order to construct an image of the number density of hydrogen atoms in the patient. As the non-uniform magnetic field is changed, then atoms in different parts of the person will be detected.

Fig. a) Random alignment of magnetic moments of nuclei

b) Alignment in Uniform strong magnetic field B0

1.3.3 Simple Block Diagram

Basic NMR Components

Fig. Block Diagram of a NMRI System

Page 21: Instrumentation

INSTRUMENTATION-II

21 BY: Er. Sharib Ali

The basic components of an NMR imaging system are shown in figure. These are

i) A magnet, which provides a strong uniform, steady, magnetic field B0. ii) An RF transmitter, which delivers radio-frequency magnetic field to the sample. iii) A gradient system, which produces time varying magnetic fields of controlled spatial

non-uniformity. iv) A detection system, which yields the output signal and v) An imager system, including the computer, which reconstructs and displays the

images.

Detailed overview:

i) Magnet: In magnetic resonance tomography, the base field must be extremely uniform in space and constant in time as its purpose is to align the nuclear magnets parallel to each other in the volume to be examined.

ii) RF transmitter System: In order to activate the nuclei so that they emit a useful signal, energy must be transmitted into the sample. This is what the transmitter does. The system consists of an RF transmitter, RF power amplifier and RF transmitting coils. The RF voltage is gated with the pulse envelops from the computer interface to generate RF pulses that excite the resonance. These pulses are amplified to levels varying from 100w to several kW depending on the imaging method and are fed to the transmitter coil.

iii) Detection System: The function of the detection system (receiver) is to detect the nuclear magnetization and generate an output signal for the processing by the computer. The receiver coil usually surrounds the sample and acts as an antenna to pick up the fluctuating nuclear magnetization of the sample and converts it to a fluctuating output voltage v(t).

Some of the commonly available coils are-

• Body coils • Head coils • Surface coils • Organ enclosing coils

iv) Gradient system for spatial coding: It is done for the spatial information. It produces the time varying magnetic field which produces resonance with the uniform field produced by permanent magnet.

v) Imager system: The imager system includes the computer for image processing, display system and control console. The computer system collects the nuclear magnetic resonant signal after A/D conversion, corrects, re-composes, displays and store it. 2D images are typically displayed as 256x256 or 512x512 pixel array. For 3D, personal computer requires more processing power. It uses 32 bit machines upto 4Mb memory.

Page 22: Instrumentation

INSTRUMENTATION-II

22 BY: Er. Sharib Ali

1.4 Radiation

1.4.1 Generation of Ionizing Radiation

Fig. Modern X-ray Tube

X-rays are generated when fast moving electrons are suddenly decelerated by impinging on target. An X-ray tube is a high vaccum diode with heated cathode located opposite the target anode as shown in figure. This diode is operated in the saturated mode with a fairly low cathode temperature so that the current through the tube does not depend on the applied anode voltage.

The intensity of X-rays depends on the tube current which can be varied by varying heater current, which in turn controls the cathode temperature. Wavelength depends on target material and velocity of electrons hitting target. It can be varied by varying the target voltage (30-100kV) of the tube.

Electron beam is concentrated to form a spot on the target- act as point source for the radiation. Therapeutic X-ray equipment uses even higher radiation energies which require linear or circular particle accelerators.

1.4.2 Nuclear Radiation

Radioactive decay is one of the source of Nuclear Radiation Artificial radioactivity is done by exposing them to neutrons generated with a

cyclotron or in an atomic reactor At the moment of disintegration radiation is emitted Radioactive element has half life from few seconds to thousands of years The radioactivity can be detected by three physical effects

Page 23: Instrumentation

INSTRUMENTATION-II

23 BY: Er. Sharib Ali

Activation on photographic emulsions Ionization of gases Light flashes the radiation causes when striking certain minerals

When radioactive material is introduced into human body for diagnostic purposes radiation dose must be at a safe level. Since biological decay is slow so isotopes of short half life must be used.

1.4.3 Instrumentation for medical use of radioisotope

Fig. Block Diagram of an instrumentation system for radioisotope

In diagnostic methods involving introduction of radioisotopes into the body / exposure for long time – radiation intensity must be a safe dose. It is based on counting number of nuclear disintegration. Because of random nature of radioactive decay the procedure is afflicted with an unavoidable statistical error.

As in the block diagram of an instrumentation system for radioisotope procedures, the sample is injected with some radioactive elements. The radioactive element has its half life time and during which it emits the radiation. These light flashes are detected by the detector. However, the basic steps are written in point below:-

Page 24: Instrumentation

INSTRUMENTATION-II

24 BY: Er. Sharib Ali

Most nuclear radiation detectors used for medical applications utilize the light flashes caused by radiation ---- scintillation detectors (crystal of thallium activated sodium iodide

Each radiation quantum passes --- causes output pulse --- proportion to energy of radiation

Pulses from photomultiplier tube are amplified and shortened before they pass through the pulse-height analyzer

Timer and gate allows the pulse in a set of time interval to be counted by scaler Rate meter shows the rate of the pulses

1.4.4 Radiation Therapy

The ionizing effects of radiation are used for treatment of diseases like cancer is called radiation therapy. In dermatology very soft X-rays that do not have enough penetration power to enter more deeply into body are used for skin treatment. Grenz rays (spectrum between X-ray and UV)

• In deep seated tumors, very hard X-rays are used– linear accelerators/ betatrons are used to obtain electrons with a very high voltage

• Changing direction of entry of beam in successive therapy sessions by rotating patients----to reduce damage to unaffected body parts

1.5 Non-invasive Techniques

1.5.1 Non- Invasive Diagnostic Instrumentation

Historically, diagnosis consisted of two techniques- observing the patient outwardly for signs of fever, vomiting, changed breathing rate etc, and observing the patient inwardly by surgery. The first technique depended greatly on experience but was still blind to detailed internal conditions. The second quite often led to trauma and sometimes death of the patient.

Modern diagnostic techniques have concentrated on using externally placed devices to obtain information from underneath the skin about the internal structures. This is achieved without the need of investigative surgery and is described as a non-invasive technique. Non-invasive techniques are designed to present a much smaller risk than surgery and are, in general, far less traumatic for the patient.

1.5.2 Temperature Measurements of Body

Body temperature is one of the oldest known indicators of the general well-being of a person. Two basic types of temperature measurements can be obtained from the human body : systematic and skin measurements. Both provide valuable diagnostic information, although the systematic temperature measurement is much more commonly used.

I) Systematic Temperature:

Page 25: Instrumentation

INSTRUMENTATION-II

25 BY: Er. Sharib Ali

It is the temperature of the internal regions of the body. This temperature is maintained through a carefully controlled balance between the heat generated by the active tissues of the body, mainly the muscles and the lever, and the heat lost by the body to the environment. Measurement of the systematic temperature is accomplished by the temperature sensing devices placed in the mouth, under the armpits or in the rectum. The normal oral (mouth) temperature of a healthy person is about 370C (98.50F). The underarm temperature is about 1 degree lower, whereas the rectal temperature is about 1 degree higher than the oral reading.

II) Surface or Skin temperature:

This temperature is also a result of balance, but here the balance is between the heat supplied by the blood circulation in a local area and the cooling of that area by conduction, radiation, convection and evaporation. Thus, skin temperature is a function of the surface circulation, environmental temperature, air circulation around the area from which the measurement is to be taken, and perspiration. To obtain a meaningful skin temperature measurement, it is usually necessary to have the subject remain, with no clothing covering the region of measurement in a fairly cool ambient temperature (approx. 210C/ 700F).

1.5.3 Ultrasonic Measurement

Principles of ultrasonic measurement

In order to be able to explain the principles of the use of ultrasound in diagnosis, it is necessary to have an understanding of the reflection of ultrasound at boundaries and its absorption in media. Ultrasound obeys the same laws of reflection and refraction at boundaries as audible sound and light. When an ultrasound wave meets the boundary between two media, some of the wave energy is reflected and some is transmitted, as illustrated

Page 26: Instrumentation

INSTRUMENTATION-II

26 BY: Er. Sharib Ali

For an incident intensity I, reflected intensity IR and transmitted intensity IT, then from energy considerations,

I = IR + IT. The relative magnitudes of the reflected and transmitted intensities depend not only on the angle of incidence but also on the two media themselves. When a wave is incident normally on a boundary between two media having specific acoustic impedances of Z1 and Z2, the ratio IR / I of the reflected intensity to the incident intensity is given by the expression,

The ratio IR / I is known as the intensity reflection coefficient for the boundary and is usually given the symbol α. Clearly, the value of α depends on the difference between the specific acoustic impedances of the media on each side of the boundary. It can be seen that the intensity reflection coefficient is very large for ultrasound entering or leaving the human body (a boundary between air and soft tissue). In order that ultrasound waves may be transmitted from the transducer into the body (and also return to the transducer after reflection from the boundaries of body structures), it is important to ensure that there is no air trapped between the transducer and the skin. This is achieved by means of a coupling medium such as a gel that fills any spaces between the transducer and the skin.

A second factor that affects the intensity of ultrasonic waves passing through a medium is absorption. As a wave travels through a medium, energy is absorbed by the medium and the intensity of a parallel beam decreases exponentially.

Ultrasound works in the principle of Doppler’s effect, in which the frequency of the reflected ultrasonic energy is increased or decreased by a moving interface. The change in frequency according to this principle is given by,

λvf 2

=∆ , ∆ƒ = change in frequency;V = velocity of the interface

λ = wavelength of the transmitted ultrasound

The frequency increases when the interface moves towards the transducer and decreases when it moves away.

Ultrasonic frequencies employed for medical applications range from 1 – 15 MHz which are transmitted as a mechanical vibrations. The speed of ultrasound in various biological materials is different. If the time taken by the ultrasonic wave to move from its source through a medium, reflect from an interface and return to the source can be measured, the depth of penetration is given by,

Depth of penetration 2ν

≅ , v = velocity of sound in medium transmitted

Page 27: Instrumentation

INSTRUMENTATION-II

27 BY: Er. Sharib Ali

The physical mechanism normally used to generate and detect ultrasonic waves is the piezoelectric effect exhibited by certain crystalline materials which have the property to develop electrical potentials on definite crystal surfaces when subjected to mechanical strain.

Piezo-electric crystals are available in several shapes and the selection of a particular shape depends upon the application to which it is to be put. There are three parameters in optimizing transducers for various types of applications. These are frequency, active element diameter and focusing.

Properties of Ultrasound

1. Ultrasonic waves are sound waves associated with frequencies above the audible range and generally extend upward from 20 kHz.

2. Transmission of ultrasonic wave motion can take place in different modes. The wave motion may be longitudinal, transverse or shear.

3. Ultrasonic waves can be easily focused i.e. they are directional and beams can be obtained with very little spreading.

4. They are inaudible and are suitable for applications where it is not advantageous to employ audible frequencies.

5. By using high frequency ultrasonic waves which are associated with shorter wavelength, it is possible to investigate the properties of very small structures.

6. Information obtained by ultrasound, particularly in dynamic studies, cannot be acquired by any other more convenient technique.

7. Ultrasound is not only non-invasive, externally applied and non-traumatic but also apparently safe at the acoustical intensities and duty cycle presently used in diagnostic equipment.

Attenuation constant and Equation

As the ultrasound travels through the material some energy is absorbed and the wave is attenuated a certain amount for each centimeter through which it travels. The amount of attenuation is a function of both the frequency of the ultrasound and the characteristics of the material. The attenuation constant, α, is defined by the following equation-

β=

distanceunit 1+Xpoint at amplitudeXpoint at amplitude

α (per cm) = cƒβ, where c = proportionality constant

ƒ = ultrasound frequency

β = exponential term determined by the properties of the material

This formula shows that attenuation increases with some power of frequency, which means that the higher the frequency the less distance it can penetrate into the body with a

Page 28: Instrumentation

INSTRUMENTATION-II

28 BY: Er. Sharib Ali

given amount of ultrasonic energy. For this reason, lower ultrasound frequencies are used for deeper penetration.

EXERCISE

Past questions

1. Explain how microprocessors can be used in Biomedical Instrumentation. (6)

2. What do you understand by infrared ray, ultraviolet ray and X-ray? Explain the applications in brief. (8)

3. Describe the X-ray as basis of diagnostic radiology. Also mention the properties of X-rays. (4+2)

4. Define Mass Spectrometry. What are its purpose and explain the application area of mass spectrometry. (8)

5. With simple block diagram describe the components of mass spectrometry. (6)

6. Explain the simple block diagram of NMRI. (8)

7. What do you mean by NMRI? Explain basic NMR components along with simple block diagram. (2+4)

8. What do you understand by Radiation Therapy? Explain in brief. (8)

9. What is the basic principle of ultrasonic measurements? Explain the properties of ultrasound. (8) ***END OF CHAPTER-1***

Page 29: Instrumentation

INSTRUMENTATION-II

29 BY: Er. Sharib Ali

PART II- MICROPROCESS INSTRUMENTATION CHAPTER-2

MICROPROCESSOR BASED INSTRUMENTATION SYSTEM

Block Diagram of Instrumentation System

Fig. Functional Elements of an Instrumentation System

The output of the transducer contains information needed for further processing by the system and the output signal is usually a voltage or some other form of electrical signals. The signal cannot be directly transmitted to next stage without removing the interfering sources, as otherwise highly distorted results may be obtained. It becomes necessary to perform certain operations on the signal before it is transmitted further. These processes may be linear like amplification, attenuation, integration, differentiation, addition and subtraction. Some non-linear processes like modulation, detection, sampling, filtering, chopping etc. are also performed on the signal to bring it to the desired form to be accepted by the next stage of measurement system. This process of conversion is called signal conditioning. Signal conditioning or data acquisition equipment in many a situation is an excitation and amplification system for passive transducers. It may be an amplification system for the active transducers. The transducer output is brought up to a sufficient level to make it useful for conversion, processing, indicating and recording.

Data Conditioning Element

Page 30: Instrumentation

INSTRUMENTATION-II

30 BY: Er. Sharib Ali

When the elements of an instrument are physically separated, it becomes necessary to transmit data from one to another. The element that performs this function is called data transmission element. The signal conditioning and transmission stage is commonly known as Intermediate stage. The information about the quantity under measurement has to be conveyed to the personnel handling the instrument or the system monitoring, control or analysis purpose. 2.1 Basic Components Involved in Designing a Microprocessor Based System A measurement system consists of-

1. Basic Functional Elements 2. Auxiliary Functional Elements 1. Basic Functional Elements: They form integral parts of all instrumentation

systems. They include- a. Transducer Element: It senses and converts the desired input to a more

convenient and practicable form to be handled by the measurement system. b. Signal Conditioning/ Intermediate Element: It does data manipulation or

the processing of the output of the transducer in a suitable form. It is Analog to digital converter in microprocessor based system.

c. Data Presentation Element: In order to give the information about the measurand or measured variable in quantitative form, data presentation is required. Eg. Data logging, data display, data communication etc.

2. Auxiliary Functional Element: It is incorporated in a particular system depending on the type of requirement, the nature of measurement technique etc. They include-

a. Calibration Element b. External Power Element c. Feedback Element d. Microprocessor Element

Microprocessor Based System In microprocessor based system, microprocessor forms one of the auxiliary functional elements of the instrument. It has vast potential to perform complex computations at fantastically high speeds, together with pre-programmed logic/ software which enhance significantly the capabilities and effectiveness of the instruments. Microprocessor based instruments are commonly called as smart or intelligent instruments. Some eg are pocket size thermometer, thermocouple sensor of digital type, portable velocity meter, micro size pressure pick ups etc. Microprocessor itself is an operational computer. It is incorporated with additional circuits for memory and input and output devices to shape it in the form of a digital computer.

INPUT DEVICES

MEMORY CONTROL UNIT A.L.U

OUTPUT DEVICES

Page 31: Instrumentation

INSTRUMENTATION-II

31 BY: Er. Sharib Ali

Fig. Digital Computer System Input devices include keyboards, floppy diskettes, CDs, mouse, scanners etc.

Further, output devices include printers, plotters or VDU etc.

Fig. A typical block diagram of digital computer

Computer processed outputs

DATA LOGGING Eg. Magnetic tape, Print out

DATA DISPLAY Eg. VDU, X-Y plotter

DATA COMMUNICATION eg. Remote indication

PROCESS / PLANT/ SYSTEM

ANALOG TRANSDUCERS

MULTIPLEXERS (To sequentially feed outputs, one at a time)

SIGNAL CONDITIONER +

A/D

DIGITAL COMPUTER

Sequential digital o/p

Operator commands through I/O

Software

Page 32: Instrumentation

INSTRUMENTATION-II

32 BY: Er. Sharib Ali

2.2 COMPONENTS

a. OPERATIONAL AMPLIFIER CHARACTERISTICS AND CIRCUITS

Basic Op-Amp characteristics:

a) Comparator

b) Comparator with Hysteresis

The pins labeled +V and –V represent the power-supply connections. The voltages applied to these pins usually be +15V and -15V or +12V and -12V. The op-amp also has two signal inputs. The input labeled with a – sign is called the inverting input and the input labeled + sign is called the non-inverting input. If the inverting input is made more positive than the non inverting input, the o/p signal will be inverted or 1800 out of phase with the input signal. The ratio of the voltage out from an amplifier circuit to the input voltage is called voltage gain “Av”. The Av for an op-amp is typically 100,000 or more.

In this circuit the op-amp effectively compares the input voltage with the voltage on the inverting input and gives a high or low output, depending on the result of the comparison. If the input is more than a few microvolts above the reference voltage on the inverting input, the output will be high (goes into saturation of +12V). If the input voltage is few microvolts more negative than the reference voltage, the output will be low (goes into saturation at -12V). An op-amp used in this way is called a comparator.

O/P = +V-1V If Vin < Vref O/P = -V +1V If Vin > Vref

In this circuit reference signal is applied to the non-inverting input and input voltage is applied to the inverting input. The positive feedback resistor from the output to the non-inverting input is applied. This feedback gives the comparator a characteristic called hysteresis.

Page 33: Instrumentation

INSTRUMENTATION-II

33 BY: Er. Sharib Ali

Hysteresis means that the output voltage changes at a different input voltage when the input is going in the positive direction than it does when the input voltage is going in the negative direction. Hysteresis prevents the noise from causing the comparator output to oscillate as the input signal gets close to the reference voltage.

c) Non-inverting Amplifier

d) Inverting Amplifier

V hysteresis = Vref x R1/(R1+R2)

The input signal is applied to the non-inverting input, so the output will be in phase with the input. A fraction of the output signal is fed back to the inverting input. The voltage gain of a circuit with feedback is called its closed-loop gain ‘AVCL’ which is equal to simple resistor ratio.

In this circuit non-inverting input is tied to ground with a resistor. Since, the signal is applied to the inverting input; the output signal will be 1800 out of phase with the input signal. For this circuit R2 supplies the negative feedback which keeps the two inputs at nearly the same voltage. Since, the non-inverting input is tied to ground; the op amp will sink or source whatever current is needed to hold the inverting input also at zero volts this node is referred to as a virtual ground.

Page 34: Instrumentation

INSTRUMENTATION-II

34 BY: Er. Sharib Ali

e) Differential Amplifier

f) Summing/ Adder Amplifier

Here, the resistors on the non-inverting input hold this input at a voltage near the common mode dc voltage. The amplifier holds the inverting input at the same voltage. If the resistors are matched carefully, the result is that only the difference in voltage between V2 and V1 will be amplified. The output signal will consist of only the amplified difference in voltage between the input signals.

In fig. input voltage V1 produces a current through R1 to this point and input voltage V2 causes a current through R2 and similar for V3. The three currents add together at the virtual ground. The virtual ground is often called the summing point. The op amp pulls the sum of two currents through resistor R4 to hold the inverting input at 0V. The left end of R4 is at 0V, so the output voltage is the voltage across R4. This to the sum of the current times the value of R4

Page 35: Instrumentation

INSTRUMENTATION-II

35 BY: Er. Sharib Ali

g) Integrator

h) Differentiator

An op-amp circuit shown can be used to produce linear voltage ramps. A dc voltage applied to input of this circuit will cause a constant current of VIN/R1 to flow into the virtual-ground point. This current flows onto one plate of the capacitor. In order to hold the inverting input at ground, the op-amp output must pull the same current from the other plate of the capacitor. The capacitor then is getting charged by the constant current VIN/ R1 which gives a linear ramp. Since, the inverting amplifier connection, a positive voltage will cause the output to ramp negative. The circuit is called an integrator because it produces an output voltage proportional to the integral of the current produced by an output voltage over a period of time.

The right-hand side of the capacitor is held to a voltage of 0 volts, due to the "virtual ground" effect. Therefore, current "through" the capacitor is solely due to change in the input voltage. A steady input voltage won't cause a current through C, but a changing input voltage will. Capacitor current moves through the feedback resistor, producing a drop across it, which is the same as the output voltage. A linear, positive rate of input voltage change will result in a steady negative voltage at the output of the op-amp. Conversely, a linear, negative rate of input voltage change will result in a steady positive voltage at the output of the op-amp. This polarity inversion from input to output is due to the fact that the input signal is being sent (essentially) to the inverting input of the op-amp, so it acts like the inverting amplifier mentioned previously. The faster the rate of voltage change at the input (either positive or negative), the greater the voltage at the output.

Page 36: Instrumentation

INSTRUMENTATION-II

36 BY: Er. Sharib Ali

g) Instrumentation Amplifier

SIGNAL GAIN

The instrumentation amp offers two useful functions: amplify the difference between inputs and reject the signal that’s common to the inputs. The latter is called Common Mode Rejection (CMR). The signal gain is accomplished by XOP1 and XOP2 while XOP3 typically forms a differential gain of 1. You can calculate the overall gain by

Where, R1=R3 and R5/R4 = R7/R6.

b) Sensors and Transducers

Light Sensors

Fig. shows an op-amp circuit used in applications that need a greater rejection of common mode signal than is provided by the simple differential circuit. The first two op-amps in this circuit buffer the differential signals and give some amplification. The output op-amp removes the common mode voltage and provides further amplification.

One of simple light sensors is a light dependent resistor(LDR) such as Clairex CL905 shown in figure. A glass window allows light to fall on a zigzag pattern of cadmium sulfide or cadmium selenide whose resistance depends on the amount of light present. The resistance of the CL905 varies from about 15Mῼ ῼ when in the dark to about 15K when in a bright light.

Page 37: Instrumentation

INSTRUMENTATION-II

37 BY: Er. Sharib Ali

Simple Light Controller relay circuit using a photocell

Fig. Light-controller relay circuit using a photocell

Above figure shows the circuit diagram containing a photoresistor, a

transistor driver (darlington) and a mechanical relay. When it gets dark, the resistance of the photoresistor goes high. This increases to voltage on the base of the transistor until, at some point, it turns on. This turns on the transistor driving the relay, which in turn turn swicthes on the lamp.

In fig. BC547 (npn transistor) is used in darlington mode to switch the 200mA relay coil. As, the saturation of BC547 is ~ 100mA so inorder to increase effective hfe (~ 1000) we use the darlington pair. A freewheeling diode which is essential when driving any sort of inductive load is used. A small capacitor (0.1µF) is also placed to help absorb the initial back EMF spike generated, as diode cannot turn instantaneously. Principle of operation of photodiode circuitry to measure light intensity: If light is allowed to fall on junction, the reverse leakage current of the diode increases linearly as the amount of light falling on it increases. The circuit shown can be used to convert this small leakage current to a proportional voltage. In this circuit a negative reference voltage is applied to the non-inverting i/p of the op-amp. The op-amp will produce this same voltage on its inverting input, reverse biasing the photodiode. The op-amp pulls leakage current through Rf to produce proportional voltage on the output of the amplifier.

Page 38: Instrumentation

INSTRUMENTATION-II

38 BY: Er. Sharib Ali

Example 1: A photodiode circuit such as this might be used to determine the amount of smoke being emitted from a smokestack. Since smoke absorbs light, the amount of light arriving at the photodetector is a measure of the amount of smoke present. An infrared LED is used here because the photodiode is most sensitive to light wavelengths in the infrared region.

#Solar Cell: Solar cells are large, very heavily doped silicon PN junctions. Light shining on the solar cell causes a reverse current to flow, just as in the photodiode. Because of the large area and heavy doping in the solar cell, however, the current produced is milliamperes rather than microamperes. The cell functions as a light powered battery. Solar cells can be connected in a series-parallel array to produce a solar power supply.

Page 39: Instrumentation

INSTRUMENTATION-II

39 BY: Er. Sharib Ali

c.Temperature Sensors Temperature sensor perceives the real world environment temperature and gives the corresponding analog voltage or current. The four types pf temperature sensors are-

I. Semiconductor Temperature Sensors II. Thermocouples

III. RTDs (Resistance Temperature Detectors) IV. Thermistors

I. Semiconductor Temperature Sensors

The two main types of semiconductor temperature sensors are- a. Temperature sensitive voltage sources and b. Temperature sensitive current sources.

Characteristics include • moderate temperature range (up to about 150°C), • low cost, excellent linearity, and additional features like signal

conditioning, comparators, and digital interfaces. eg. LM35, AD590 (discussed in detail)

a. Temperature sensitive voltage sources: An example of this type is the National LM35. Circuit connection is shown in fig a. The voltage output from this circuit increases by 10mV for each degree Celsius that its temperature is increased. The LM35 does not require any external calibration or trimming to provide typical accuracies of ±1⁄4˚C at room temperature and ±3⁄4˚C over a full −55 to +150˚C temperature range. The output is adjusted to 0V for 00C.

Fig. (a) LM35 temperature dependent voltage source

b. Temperature sensitive current sources: AD590 produces a current of 1µA/K. Figure b shows a circuit which converts this current to a proportional voltage. In this circuit the current from the sensor, IT, is passed through an approximately 1KΩ resistor to ground. This produces a voltage which changes by 1mV/K. The AD580 in the circuit is a precision voltage reference used to produce a reference

Vout = +1500mV AT 1500C +250 mV at 250C -550 mV at -550C

AV

R sf µ50

−=

Page 40: Instrumentation

INSTRUMENTATION-II

40 BY: Er. Sharib Ali

voltage of 273.3 mV. With this voltage applied to the inverting input of the amplifier, the amplifier output will be zero volts for 00C. The advantage of a current source sensor is that voltage drops in long connecting wires do not have any effect on the output value. If the gain and offset are carefully adjusted, the accuracy of the circuit is ± 10C.

Fig(b). AD590 temperature dependent current source

II. Thermocouples: Whenever two different metals are put in contact, a small voltage is produced between them. The voltage developed depends on the type of metals used and the temperature. Depending on the metals, the developed voltage increases between 7 and 25 µV for each degree Celsius increase in temperature. Different combinations of metals are useful for measuring different temperature ranges. A thermocouple junction made of iron and constantan, commonly called a type J thermocouple, has a useful temperature range of about -184 to +7600C. A junction of platinum and an alloy of platinum and 13 % rhodium has a range of 0 to about 16000C. Thermocouples can be made small, rugged and stable. However, they have three major problems which must be overcome.

i. the output is very small and must be amplified before the signal conversion

ii. a reference junction made of same metals must be connected in series in the reverse direction as in fig. This is done so that the output connecting wires are both constantan. The thermocouples formed by connecting these wires to the copper wires going to the amplifierwill then cancel out. The input voltage to the amplifier will be difference between the voltages across the two thermocouples. If we simply amplify this voltage, there is problem if the temperature of both thermocouples is changing.Thus, it is impossible to tell which thermocouple caused the change in the output voltage.

iii. The third problem is that their output voltages do not change linearly with temperature. This can however be corrected with analog

Offset Reference

+2.5V

Instrumentation Amplifier Gain of 10, 0.00 V to 1.00 FS 10mV/0C

1 KΩ 0.1% LOW TCR METERING RESISTOR, 1mV/µA = 1mV/K

Remote Temperature to current transducer, 1µA/K

Measured temp 0 to 1000C

Page 41: Instrumentation

INSTRUMENTATION-II

41 BY: Er. Sharib Ali

circuitry which changes the gain of an amplifier according to the value of the signal.

Characteristics include • wide temperature range (up to 1250°C), • low-cost, very low output voltage (on the order of 40µV per °C for

type K), • reasonable linearity, and moderately complex signal conditioning

(cold-junction compensation and amplification). Eg, J type(to be discussed), K-type

Fig©. Circuit showing amplification and cold junction

Compensation for thermocouple

III. RTDS: Resistance temperature detectors are resistors which change value with a change in temperature. RTDs consists of a wire or a thin film platinum or a nickel wire. The response of RTDs is nonlinear, but they have excellent stability and repeatability. Therefore, they are often used in applications where very precise temperature measurement is needed. RTDs are useful for measures in the range of -250 to +8500C. Characteristics include

• wide temperature range (up to 750°C), excellent accuracy and repeatability,

• Reasonable linearity, and the need for signal conditioning. • Signal conditioning for an RTD usually consists of a precision

current source and a high-resolution ADC.

150C<Ta<350C

R E0 = Vt-Va+

R

VI a

Ω+

+Ω3.521

5.23.52- 2.5V ≈ Vt

Va

Page 42: Instrumentation

INSTRUMENTATION-II

42 BY: Er. Sharib Ali

A circuit diagram such as that in fig. d can be used to convert the change in resistance of the RTD to a proportional voltage. Op-amp A1 in the circuit produces a precise reference voltage of -6.25V. This voltage produces a precise current at inverting input of A2. Op-amp A2 pulls this current through the RTD to produce a voltage proportional to the resistance of the RTD. The resistance of an RTD increases with an increase in temperature.

Fig.(d) 100Ω RTD connected to perform temperature

Measurements in the range 00C to 2660C.

IV. Thermistors: They consist of semiconductor material whose resistance decreases

nonlinearly with temperature. They are relatively inexpensive, have very fast response times, and are useful in applications where precise measurement is not required. Characteristics include

• moderate temperature range (up to 150°C), • low-to-moderate cost (depending on accuracy), • poor but predictable linearity, and the need for some signal

conditioning. A circuit similar to fig.d can be used to produce a voltage proportional to the resistance of the thermistor.

Eout 0 TO 1.8v FOR 0 TO 2660C

Vref

Page 43: Instrumentation

INSTRUMENTATION-II

43 BY: Er. Sharib Ali

d.Force and Pressure Objective: Principle of operation: Introduction to strain gages and load cells, simple circuit connection diagram; Uses of Strain gages in various forms; Introduction of LVDTs with simple structure diagram STRAIN GAGES AND LOAD CELLS

They change resistance at their output terminals when stretched or compressed. It may be made of thin wire, thin foil or semiconductor material. Because of this characteristic, the gages are typically bonded to the surface of a solid material and measure its minute dimensional changes when put in compression or tension. Strain gages and strain gage principles are often used in devices for measuring acceleration, pressure, tension, and force. Strain is a dimensionless unit, defined as a change in length per unit length. For example, if a 1-m long bar stretches to 1.000002 m, the strain is defined as 2 microstrains. Strain gages have a characteristic gage factor, defined as the fractional change in resistance divided by the strain.

Figure (a) shows a simple setup for measuring force or weight. A strain gage is glued on the top of the flexible bar. The force or weight to be measured is applied to the unattached end of the bar. The applied force bends the bar, the strain gage is stretched, increasing its resistance. Since the amount that the bar is bent is directly proportional to the applied force, the change in resistance(∆R) will be proportional to the applied force. If a current is passed through the strain gage, then the change in voltage across the strain gage will be proportional to the applied force.

STRAIN GAGES

Fig.(a) Strain gages used to measure force Limitation: ∆R changes with temperature Removal: Two strain gage elements are mounted at right angles. In doing so, both change resistance with temperature but only one will change R with the applied force. Connection in balanced bridge Here in balanced bridge circuit as in figure (b), any change in resistance (∆R) due to temperature will not cause change in differential output of the bridge. Thus only the force applied cause change in the resistance and produce a small differential output voltage.

WEIGTH

Page 44: Instrumentation

INSTRUMENTATION-II

44 BY: Er. Sharib Ali

Fig(b) Circuit connection

Pressure Measurement: A strain gage mounted on a movable diaphragm in a threaded housing gives a output

proportional to pressure applied to the diaphragm. If vaccum on one side of diaphragm then it gives measure of absolute pressure and

if open on one side of the diaphragm then it gives measure of atmospheric pressure. If two sides of the diaphragm are connected to two different pressure sources, then

the output will be a measure of the differential pressure between the two sides. LINEAR VARIABLE DIFFERENTIAL TRANSFORMERS A linear variable differential transformer (LVDT) is a position sensor, consisting of a primary coil, two secondary coils and a displaceable iron core (Figure 1). An AC voltage is supplied to the primary coil. The two secondary coils are connected in anti-series. When the core is positioned in the centre of the coil arrangement, the two secondary signals have the same magnitude, so the output from the anti-serial connection is zero.

If the core is displaced from the centre position, one secondary produces a higher output voltage and the other a lower output voltage. The output from the anti-serial connection will thus increase proportional to the displacement from the centre position.

Fig.(c) LVDT s

100K

Ω Ω

Page 45: Instrumentation

INSTRUMENTATION-II

45 BY: Er. Sharib Ali

If a spring is added so that a force is required to move the core, then the voltage out of the LVDT will be proportional to the force applied to the core. Similarly, if a spring is added and the core is attached to a diaphragm in a threaded housing, the output from the LVDT will be proportional to the pressure exerted on the diaphragm.

e. Flow Sensors Objective: Principle of operation- Types of flow sensor;

4to 20 mA current loop

a) Paddle Wheel The rate at which paddle wheel turns is proportional to the rate of the flow of liquid or gas. An optical encoder can be attached to the shaft of the paddle wheel to produce digital information as to how fast the paddle wheel is turning.

b) Differential Pressure Transducer

It gives an output proportional to the difference in pressure between the two sides of the resistance.

4 to 20 mA Current loop In industrial application, where sensor is at a long distance from

ADC’s the signals from sensors are converted to current instead of voltages. In doing so, the signal amplitude is not affected by resistance or induced voltage or voltage drops.

4mA represents open circuit i.e. 0 output while 20mA represents the full-scale value. At receiving end, a resistor or op-amp is used to convert it into useful voltage to be applied to the input of the A/D converter.

FLOW

Resistance

Differential Pressure Transducer

Page 46: Instrumentation

INSTRUMENTATION-II

46 BY: Er. Sharib Ali

2.3 Interfacing Between Analog Devices a.Use of analog devices

In order to control the machines in our electronics industries, medical instruments or automobiles with microprocessor, we have to determine the values of variables such as pressure, temperature and flow. There are many ways to get electrical signals which represent the values of these variables and converting electrical signals to digital forms the microcomputer can work with.

When we talk of analog device, the first step of design involves a sensor, which converts the physical variables like pressure, temperature, humidity etc. to a proportional voltage or current. We know the electrical signals from the sensors are quite small, so they must next be amplified and perhaps filtered. This is generally done with the help of op-amp circuit. The final step that we can use is to convert to the digital form which can be done by an analog to digital (A/D) converter. So, here we will discuss the basic operations, interfacing with the microprocessor of both A/D converters and D/A converters.

While talking of the interfacing we must also deal with 8255A. b.Operation of Comparator The most elementary form of communication between the analog and digital device is a device called comparator. This device is shown schematically below, which compares two analog voltages on its input terminals. Depending on which voltage is larger, the output will be a 1(high) or a 0(low) digital signal. The comparator is extensively used for alarm signals to computers or digital processing systems. This element is also an integral part of the analog to digital and digital to analog converter.

One of the voltages on the comparator inputs, Va or Vb will be the variable input, and the other a fixed value called a trip, trigger or reference voltage. The reference value is computed from the specifications of the problem and then applied to the appropriate comparator input terminal as shown below;

Fig.

Va

Vb

1 if Vb > Va

0 if Vb< Va

2.2mV/0C Temp. (T)

0.2V/kPa Presure(P)

Page 47: Instrumentation

INSTRUMENTATION-II

47 BY: Er. Sharib Ali

The reference voltage may be provided from a divider using available power supplies. Example: A process control system specifies that the temperature should never exceed 10Kpa. Design an alarm system to detect this condition, using temperature and pressure transducers with the transfer functions of 2.2mV/0C and 0.2V/kPa respectively. Solution: Alarm condition will be a temperature of 1600C which gives 2.2mV/0C × 1600C=0.352V which will be coincident with a pressure signal of 0.2V/kPA × 10kPa=2.0V So, the above circuit shows how this alarm can be implemented with comparators and one AND gate. The reference voltage could be provided from dividers. c.Open –Collector Comparator If the output terminal of the comparator is connected internally to the collector of a transistor in a comparator and nowhere else, then it is called open collector comparator. Even if there is base emitter current in the transistor, no voltage will show up on the collector until it is connected to a supply through some collector resistor. It is shown below-

The following figure below shows that an external resistor is connected from the output to an appropriate power supply. This is called a collector pull-up resistor.

Now, the output terminal will show either a 0 (0V) if the internal transistor is ON or 1 (+Vs) if the internal transistor is OFF.

Page 48: Instrumentation

INSTRUMENTATION-II

48 BY: Er. Sharib Ali

Advantages

I. It is possible to use a different power supply source for the output. For example, suppose you want to activate a +12V relay with the output of a comparator that operates on +5V. By using an open collector model, you can connect the pull-up resistor to a +12V supply and power the relay directly from the output.

II. It is possible to or together several comparators outputs by connecting all open collector outputs together and then using a common pull-up resistor. If any one of the comparator’s output transistor is turned ON, the common output will go LOW.

Hysteresis Comparator To solve the problem of voltage fluctuations, it is used.

Feedback resistor Rf is provided between the output and one of the inputs of the comparator, and that input is separated from the signal by another resistor R. Under the condition that Rf>>R, the response of the comparator is shown above. Te condition for which the output will go high(V0) is defined by,

Vin ≥ Vref Once having been driven high, the condition for which the output to drop back to low(0V) state is given by the relation

Vin≤ Vref - ⎟⎟⎠

⎞⎜⎜⎝

fRR V0

Where, R/Rf × V0 is called dead band or hysteresis Example A sensor converts the liquid level in a tank to voltage according to the transfer function (20mV/cm). A comparator is supplied to go high (5V0 whenever the level becomes 50cm. Splashing causes the level to fluctuate by ±3cm. Develop a hysteresis comparator to protect against the effect of splashing.

Page 49: Instrumentation

INSTRUMENTATION-II

49 BY: Er. Sharib Ali

Nominal reference voltage for comparator at 50cm; Vref = (20mV/cm) × 50cm=1V Splashing causes “noise” of (20mV/cm) × (±3cm) = ±60mV This is a total range of 120mV So, we need a deadband of 120mV, but let us make it 150mV for security. Thus,

⎟⎟⎠

⎞⎜⎜⎝

fRR

×(5V) = 150mV

⎟⎟⎠

⎞⎜⎜⎝

fRR = 0.03

If we make Rf = 100KΩ, then R = 3KΩ. Thus, the use of these resistors with ref. voltage of 1V will meet the above requirement. c) DIGITAL TO ANALOG CONVERTER(DAC) Objective: The digital-to-analog converter, known as the D/A converter (read as D-to-A Converter) or the DAC is a major interface circuit that forms the bridge between the analog and digital worlds. DACs are the core of many circuits and instruments, including digital voltmeters, plotters, oscilloscope displays, and many computer-controlled devices. Here we will examine the basis of digital-to-analog conversion, interfacing, and how it is used for waveform generation.

What is a DAC? A DAC is an electronic component that converts digital logic levels into an analog voltage. When DAC is used in connection with a computer, this binary number or digital input is called a binary word or computer word. The digits are called bits of the word. Convert Signal

Fig. Block Diagram of basic digital-to-analog converter (DAC) There are basically two types of DAC:

1. Unipolar DAC: It converts a digital word into an analog voltage by scaling the analog output to be zero when all bits are zero and some maximum value when all

RESISTIVE SUMMING NETWORK

Digital Input

Reference Voltage Source

VOLTAGE SWITCHES Amplifier

REGISTER

Analog output

RESISTIVE SUMMING NETWORK

Page 50: Instrumentation

INSTRUMENTATION-II

50 BY: Er. Sharib Ali

bits are one. This can be mathematically represented by treating the binary number that the word represents as a fractional number. The output of DAC is defined as

Vout = VR [ b12-1+ b22-2+b32-3+----------+bn2-n] Where, Vout = analog voltage ouput VR = reference voltage B1, b2, b3…….bn = n-bit binary word The output of a DAC is just the sum of all the input bits weighted in a particular manner:

Where, wi is a weighting factor, bi is the bit value (1 or 0), and i is the index of the

bit number. In the case of a binary weighting scheme, wi = 2i, the complete expression for

an 8-bit DAC is written as,

DAC = 128 b7 + 64 b6 + 32 b5 + 16 b4 + 8 b3 + 4 b2 + 2 b1+ 1 b0 So,

Vout= VR[128 b7 + 64 b6 + 32 b5 + 16 b4 + 8 b3 + 4 b2 + 2 b1+ 1 b0] Now, maximum voltage for 8-bit word is thus when b0b1b2b3b4b5b6b7 = 1111111 (Vout)max = 0.9961 VR

Alternatively,

Vout = Rn VN×

2, where N = base 10 whole number equivalent of DAC input

Fig.4-bit DAC

Relationship formulas for o/p voltage with i/p binary word

Page 51: Instrumentation

INSTRUMENTATION-II

51 BY: Er. Sharib Ali

N(decimal number) = bn2n + bn-12n-1+ ….............+ b121+ b020 N = (2n-1) , when all bits are high, n refer to no. of bits Weight of MSB = ½ Vref Weight of LSB = 1/2n Vref Vout = VR [ b12-1+ b22-2+b32-3+----------+bn2-n]

Vout = Rn VN×

2,

Conversion Resolution(∆Vout) is the increament in each step of bit combination

(∆Vout) = nrefV

2

Full scale voltage (Vfs)

Vfs = )12(2 1 −−

nfnref

RRV

P.U. 2006. A 6-bit DAC has an i/p of (100101)2 and uses a 10.0 V reference. Then, a) Find the o/p voltage produced b) specify the conversion resolution c) the DAC must have 8.00 V o/p when all input are high find the reference voltage. [3+3+4] Solution:

a) n = 6, Vref = 10.0 V N= 1×25+0 ×24+0×23+1×22+0×21+1×20= 37,

Vout = Rn VN×

2 = 62

37× 10 = 5.78125V

b) ∆Vout = 10/26 = 0.15625 V c) When all bits high N = 2n-1 = 26-1 = 63

62638 =∴ ×Vref

i.e. Vref = 8.12698V

2. Bipolar DAC : It is designed to output a voltage that ranges from plus to minus maximum value when the input binary ranges over the counting stated. Although computer frequently uses 2’s complement to represent negative number, this is not common with the DAC. Instead, a simple offset binary is frequently used, wherein output is simply biased by half the reference voltage. So, the bipolar DAC relationship is given by,

Page 52: Instrumentation

INSTRUMENTATION-II

52 BY: Er. Sharib Ali

Vout = Rn VN×

2 -

2RV

If N=0, Vout will be minimum value, Vout(min)= - RV21

However, the maximum value for N is equal to (2n-1), so that the max. value of output voltage will be

Vout(max) = RRn

n

VV21

212

−−

i.e. Vout(max) = nRV

2V

21

R −

Example: A bipolar DAC has 10 bits and a reference of 5V. What outputs will result from inputs of 04FH and 2A4H? What digital input gives a zero output voltage? Solution: 04FH and 2A4H converted to base 10 numbers (79)10 and (676)10 From equation,

Vout = Rn VN×

2 -

2RV

Or, Vout = 51024

79× -

25

= - 2.1142578V

Vout = 51024676

× - 25

= 0.80078V

The zero occurs when the equation equals zero. Solving for N gives,

0 = 510

×N -

25

N = (512)12 = 200H = (10000000000)2 `DAC CHARACTERISTICS

I. Digital Input: Digital input is a parallel binary word formed by a number of bits specified by the device specification sheet. Generally TTL logic levels are required.

II. Power supply: The power supply is bipolar at the level of ±12 to ±18V as required for internal amplifiers. Some DACs operate from a single supply.

III. Reference Supply: A reference supply is required to establish the range of output voltage and resolution of converter. This must be a stable, low ripple source. In some units an internal reference is provided.

IV. Output: The output is a voltage representing the digital input. This voltage changes in steps as the digital input changes by bits, with the steps determined by the resolution equation.

Page 53: Instrumentation

INSTRUMENTATION-II

53 BY: Er. Sharib Ali

V. Offset: The DAC is usually implemented with op-amps so there may be the typical output offset voltage with a zero input. Typically, connections will be provided to facilitate a zeroing of DAC output with a zero input word.

VI. Data Latch: Many DACs have a data latch built into their inputs. When a logic command is given to latch data, whatever data are on the input bus will be latched into the DAC, and the analog output will be updated for that input data. The output will stay at that value until new digital data are latched into the input. In this way, the input of the DAC can be connected directly onto the databus of a computer , but it will be updated only when a latch command is given by the computer.

VII. Conversion Time: A DAC performs the conversion of digital input to analog output virtually instantaneously. From the moment that the digital signal is placed on the output voltage is simply the propagation time of the signal through the internal amplifiers. Typically, settling time of the internal amplifiers will be a few microseconds.

INTERFACING AN 8 BIT DAC WITH 8085 MICROPROCESSOR Problems Specifications

I. Design an output port with the address FFH to interface the 1408 DAC that is calibrated for a 0 to 10 V range

II. Write a program to generate a continous ramp waveform III. Explain the operation of the 1408 which is calibrated for a abipolar range ±5V.

Calculate the output Vout if the input is (10000000)2

I. Hardware Description: a. The address lines are decoded by using an 8-input NAND gate. When

address lines A7 – A0 are high (FFH), the output of NAND gate goes low and is combined with the control signal IOW in NOR gate (negative AND)

b. The digital component 74LS373 is used as a latch. c. Industry standard 1408 DAC is used. d. Operational amplifier 741. e. 8085 µP with power supply and other accessories are used.

Fig: Interfacing Circuit in Unipolar Range

5K

2.5K

2.5

Page 54: Instrumentation

INSTRUMENTATION-II

54 BY: Er. Sharib Ali

The Motorola MC1408 is an 8-bit digital-to-analog converter that provides an output current, i, directly proportional to the digital input. The transfer function found in the DAC specifications is;

i = K A1/2+A2/4+A3/8+A4/16+A5/32+A6/64+A7/128+A8/256 where, the digital inputs Ai = 0 or 1, and here A1 is the most significant bit. A8 is the least significant bit, and the proportionality constant ,K = Vref / R14.

The reference voltage taken here as +5 V supplies a reference current of 5 V/2.5 kΩ, which equals 2 ma through the resister R14. The maximum current produced when all input bits are high is

0.996 * 2 ma = 1.992 ma The output voltage Vout for full scale is ; Vo = 2mA × (255/256) × Rf = 1.992 × 5 K = 9.961 V

II. Program to generate a continuous waveform

NOTE: O/p’s 00 to FF continuously to DAC Analog o/p DAC starts at 0 to 10V as ramp When accumulator content go to 0 next cycle begins Delay required because –a) µP needs time to execute an o/p loop which is

less than the settling time of DAC b) slope of ramp can be varied by changing the delay

CODING MVI A, 00H DATAO: OUT FFH ; O/P DATA TO DAC MVI B, COUNT ; SETUP REGISTER B FOR DELAY DELAY: DCR B JNZ DELAY INR A ; LOAD NEXT I/P JMP DTAO ; GO BACK TO O/P

III. Operating DAC in a Bipolar Range

Page 55: Instrumentation

INSTRUMENTATION-II

55 BY: Er. Sharib Ali

1408 DAC is calibrated for bipolar range ±5V by adding a resistor RB (5K) between the reference voltage VRef and the output pin 4. The resistor RB supplies 1mA ( Vref/RB) current to the output in opposite direction of current generated by input signal, so

I01= I0 –

B

ref

RV

=KA1/2+A2/4+A3/8+A4/16+A5/32+A6/64+A7/128+A8/256- B

ref

RV

When input signal is zero,

Vo = I01 Rf = (I0-

B

ref

RV

) Rr = (0-K55 ) × 5K

= -5V When input is (10000000)2

Vout = Rn VN×

2 -

2RV

= 52

1288 × -

25

= 0V

Microprocessor Compatible DACs The AD558 consists of four major functional blocks, fabricated on a single monolithic chip (see Figure 2). The main D-to-A converter section uses eight equally-weighted laser-trimmed current sources switched into a silicon-chromium thin-film R/2R resistor ladder network to give a direct but unbuffered 0 mV to 400 mV output range. The transistors that form the DAC switches are PNPs; this allows direct positive-voltage logic interface and a zero-based output range.

5K

5K

2.5K

2.5K

Page 56: Instrumentation

INSTRUMENTATION-II

56 BY: Er. Sharib Ali

The high speed output buffer amplifier is operated in the noninverting mode with gain determined by the user-connections at the output range select pin. The gain-setting application resistors are thin-film laser-trimmed to match and track the DAC resistors and to assure precise initial calibration of the two output ranges, 0 V to 2.56 V and 0 V to 10 V. The amplifier output stage is an NPN transistor with passive pull-down for zero-based output capability with a single power supply. The internal precision voltage reference is of the patented bandgap type. This design produces a reference voltage of 1.2 volts and thus, unlike 6.3 volt temperature compensated Zeners, may be operated from a single, low voltage logic power supply. The microprocessor interface logic consists of an 8-bit data latch and control circuitry. Low power, small geometry and high speed are advantages of the I2L design as applied to this section. I2L is bipolar process compatible so that the performance of the analog sections need not be compromised to provide on-chip logic capabilities. The control logic allows the latches to be operated from a decoded microprocessor address and write signal. If the application does not involve a mP or data bus, wiring CS and CE to ground renders the latches “transparent” for direct DAC access. TIMING AND CONTROL The AD558 has data input latches that simplify interface to 8- and 16-bit data buses. These latches are controlled by Chip Enable (CE) and Chip Select (CS) inputs. CE and CS are internally “NORed” so that the latches transmit input data to the DAC section when both CE and CS are at Logic “0”. If the application does not involve a data bus, a “00” condition allows for direct operation of the DAC. When either CE or CS go to Logic “1”, the input data is latched into the registers and held until both CE and CS return to “0”. (Unused CE or CS inputs should be tied to ground.) The truth table is given in Table I. The logic function is also shown in Figure 6.

Page 57: Instrumentation

INSTRUMENTATION-II

57 BY: Er. Sharib Ali

d. ANALOG TO DIGITAL CONVERTERS (ADC’S) The ADCs are a quantizing process whereby an analog signal is represented by equivalent binary states. This is opposite to DAC process. ADCs can be classified into 2 general groups based on the conversion methods- one method involves comparing a given analog signal

Page 58: Instrumentation

INSTRUMENTATION-II

58 BY: Er. Sharib Ali

with the internally generated equivalent signal. This group encloses successive approximation, counters and flash type converters. The second method involves changing analog signal into time or frequency and compairing these new parameters to known values. This group includes integrator, converters and voltage to frequency converters. The tradeoff between these two methods is based on accuracy Vs speed. The successive approximation and flash method type are faster but generally less accurate than the integrator and the voltage to frequency type converters. The output binary number from ADC is given by,

b12-1 + b22-2+…………+bn2-n≤R

in

VV

where, b1,b2, ……,bn = n –bit digital output Vin= analog input voltage VR = analog reference voltage We use an inequality because the fraction on the right side can change continuously overall values. But, the fraction derived from the binary number on the left can change only in fixe increments of ∆n = 2-n. In other words, the only way the left side can change is if the LSB changes from 1 to 0 or from 0 to 1. In either case, the fraction changes by only 2-n and nothing in between. So, there is an inherent uncertainty in the input voltage producing a given ADC output and that uncertainty is given by

∆V=VR 2-n

Minimum and maximum Voltages:

The equation for ADC; b12-1+b22-2+…………+bn2-n≤R

in

VV

Shows that if the ratio of input voltage to reference is less than ∆V then the digital o/p will be all 0s, (i.e. 00000…..000)2

R

in

VV

< ∆V

The LSB will not change until ip voltages becomes atleast equal to ∆V. (Vin≠∆V), then the output will be (00000…..0001)2. If the ADC o/p is all 0s and Vin<VR2-n , it could be even be a negative voltage. If MSB changes from 0 to 1 than the input voltage becomes equal or greater than (VR-∆V). Therefore if the ADC o/p is all 1’s (1111……1111)2 then Vin is greater than (VR- VR2-n). Successive Approximation ADCs The function of the successive approximation register, or SAR, is to make a digital estimate of the analog input based on the 1-bit output of the comparator. The current SAR estimate is then converted back to analog by the DAC and compared with the input. The cycle repeats until the \best" estimate is achieved. When that occurs, this present best estimate is latched

Page 59: Instrumentation

INSTRUMENTATION-II

59 BY: Er. Sharib Ali

into the output register (written into memory). By far the most common algorithm employed by SARs is the binary search algorithm.

Comparator 311 is used to compare the input voltage, Vx, to a feedback voltage, VF, that comes from DAC as shown above. The comparator output signal drives a logic network that steps the digital output (and hence DAC input) until the comparator indicates the two signals are the same within the resolution of the converter. The most common parallel feedback converter is successive approximation registers (SAR) device. The logic circuitry is such that it successively sets and resets each bit, starting with the most significant bit of the word. We start with all bits zero. Thus, the first operation will be to set b1=1 and test VF = VR2-1 against Vx through the comparator. If Vx > VR2-1 then b1 will be 1, b2 is set to 1 and a test is made for Vx versus VF = VR(2-1+2-2) and so on. If Vx is less than VF ( VR2-1) then b1 is reset to zero, b2 is set to 1 and a test is made for Vx versus VR(0×2-1+1×2-2). This process is repeated to the LSB of the word. Example: (PU) Find the successive approximation of Analog to Digital output for 5 bit ADC to a 3.127 V input if the reference is 5V. [11] Solution: Here, n=5, VR = 5V, Vin= 3.127V, b4b3b2b1b0- MSB(b4) and LSB is (b0) Step 1: Set b4 (MSB) =1 Input will be 10000. So, output of DAC (VF) = VR 2-1= 5/2 = 2.5V Vin>VF, so keep b4=1 Step 2: Set b3 =1 Input will be 11000. So, output of DAC (VF) = VR2-1+ VR 2-2 = 5/2 + 5/4 = 2.5+1.25 = 3.75V Vin < VF so clear, b3=0 Step 3: Set next bit, b2=1

Vx

VF

Page 60: Instrumentation

INSTRUMENTATION-II

60 BY: Er. Sharib Ali

Input will be 10100. So, output of DAC (VF) =VR2-1+0+ VR2-3

=2.5 +0.625 = 3.125V Vin>VF so keep, b2=1 Step 4: Set next bit, b1=1 Input will be 10110, output of DAC (VF) = VR2-1+0+VR2-3+ VR2-4 = 2.5 + 0 + 0.625+0.3125 = 3.4375V Vin < VF so clear, b1=0 Step 5: Set LSB b0=1 Input will be 10101, output of DAC (VF) = VR [1×2-1+0+1×2-3+ 0×2-4+1×2-5] = 2.5+0+0.625+0+0.15625 = 3.28125 Vin < VF so clear, b0=0 Thus, the required output is (10100)2 Alternative Method:

N = INT ⎟⎟⎠

⎞⎜⎜⎝

⎛× n

R

in

VV

2

The base 10 number N is then converted to HEX and /or binary to demonstrate the ADC output.

N = INT ⎟⎠⎞

⎜⎝⎛ × 52

5127.3 = INT (20.0128) = (20)10= 14H

= (10100)2 Bipolar operation of ADC A bipolar ADC is one that accepts bipolar input voltage for conversion into appropriate digital output. The most common bipolar ADCs provide an output called offset binary. This means that the normal output is shifted by half the scale. So, that all zero corresponds to the negative maximum input voltage instead of zero In equation form, the relationship is written as,

N= INT [ n

R

in

VV

221

⎟⎟⎠

⎞⎜⎜⎝

⎛+ ]

If Vin = -VR/2 , output =0, N=0 If Vin = 0, output is half of 2n

The output will be the maximum count when the input is ⎟⎠⎞

⎜⎝⎛ − n

RR VV 2

2

Page 61: Instrumentation

INSTRUMENTATION-II

61 BY: Er. Sharib Ali

ADC CHARACTERISTICS +Vs -Vs VL EOC bn

bn-1

Vin

b2

VR

b 1

RD ALE SC

1. Analog Voltage Input: This is for connection of the voltage be constant during the conversion process.

2. Power Supplies: Generally ADC requires bipolar supply voltages for internal op-amp and a digital logic supply connection.

3. Reference Voltage: the reference voltage must be from a stable, well regulated source.

4. Digital outputs: the converter will have n output lines for connection to digital interface circuitry.

5. Control Lines: The ADC has a number of control lines that are single bit digital inputs and outputs designed to control operation of the ADC and allow for interface to a computer. The most common lines are

a. SC ( Start Convert) – This is a digital input to the ADC that starts the converter on the process of finding the correct digital outputs for the given analog voltage input. Typically, conversion starts at the falling edge.

b. EOC ( End of Conversion) – This is a digital output from the ADC to the receiving equipment such as a computer. Typically, this line will be high during the conversion process. When the conversion is complete the line will go low. Thus, the falling edge indicates that the conversion is complete.

c. RD(Read Data) – Since the output is typically buffered with tri-states even though the conversion is complete, the correct digital results do not appear on the output lines. The receiving equipments must take the RD line low to enable the tri-state and place the data on the output lines.

6. Conversion time: This is not an input or an output but a very important characteristic of ADCs. A typical ADC does not produce the digital output instantaneously when the analog voltage is applied to its input terminal. The ADC must sequence through a process to find the appropriate digital output, and this process time which is called conversion time.

ADC

Conversion Time

Page 62: Instrumentation

INSTRUMENTATION-II

62 BY: Er. Sharib Ali

Interfacing an 8-bit ADC using status check HARD WARE REQUIREMENT

1. 3 to 8 decoder 74LS138 – It is used to decode the address for identifying a register for a given address. Features

• Active low output and three extra NOT gates connected at the three inputs to reduce the 4 unit load to a single unit load.

• Three enable inputs, E1,E2,E3 all must be activated for decoder to work.

2. ADC for converting analog input to digital output START = LOW DR (Data Read) = LOW

3. Digital output of ADC is interfaced with a tri-state buffer 74LS244 (Low signal output enable)

4. Digital data input to databus of µP 8085

Operation Typically it has two control lines start (or convert and dat ready or busy. It is TTL-compatible and can be active low or high depending upon the design. A pulse to the start pin begins the conversion process and disables the tri-state output buffer. At the EOC period DR becomes active and the digital output is made available at the o/p buffer. To interface an ADC with the µP the µP should-

I. Send a pulse to the start pin. This can be derived from a control signal such as write(WR)

II. Wait until the EOC. The EOC period can be verified either by the status checking(polling) or by using the interrupt

III. Read the digital signal at the input port

Page 63: Instrumentation

INSTRUMENTATION-II

63 BY: Er. Sharib Ali

Flowchart: e.The 74XX138 3-to-8 Decoder The 3-to-8, 74XX138 Decoder is also commonly used in logical circuits. Similar, to the 2-to-4 Decoder, the 3-to-8 Decoder has active-low outputs and three extra NOT gates connected at the three inputs to reduce the four unit load to a single unit load. The 3-to-8 Decoder has three enable inputs, one of the three enable inputs is active-high and the remaining two are active-low. All three enable inputs have to be activated for the Decoder to work. The function table of the 3-to-8 decoder is presented.

A/D

Send Start Pulse

Read status: Data Ready line

Is data Ready High?

Read Data

Return

Yes

No

Program: OUT 82H ; Start conversion TEST: IN 80H ; Read data status

RAR ;Rotate D0 in carry

JC TEST ; if D0 =1 ; conversion is not

; complete go back ; and check

IN 81H ; read output

; and save

RET

3-to-8 Decoder

Page 64: Instrumentation

INSTRUMENTATION-II

64 BY: Er. Sharib Ali

f.Encoder An Encoder functional device performs an operation which is the opposite of the Decoder function. The Encoder accepts an active level at one of its inputs and at its output generates a BCD or Binary output representing the selected input. There are various types of Encoders that are used in Combinational Logic Circuits.

g.Multiplexer Multiplexer is a digital switch that has several inputs and a single output. The Multiplexer also has select inputs that allow any one of the multiple inputs can be selected to be connected to the output. Multiplexers are also known as Data Selectors. The main use of the Multiplexer is to select data from multiple sources and to route it to a single Destination. In a computer, the ALU combinational circuit has two inputs to allow arithmetic operations to be performed on two quantities. The two quantities are usually stored in different set of registers. The inputs of the two multiplexers are connected to the output of each of the multiple registers. The outputs of the two multiplexers are connected to the two inputs of the ALUs. The Multiplexers are used to route the contents of any two registers to the ALU inputs. Multiplexers are available in different configurations.

Function Table for 4-to-1 Mux

Function Table of 8-to-3 Encoder

Page 65: Instrumentation

INSTRUMENTATION-II

65 BY: Er. Sharib Ali

h.Latches (DM74LS373) Latches are simple logic elements used to store binary information .A typical latch stores 1

bit of information .We have used DM74LS373 .These 8-bit registers feature totem-pole 3

–STATE outputs designed specifically for driving highly capacitive or relatively low –

impedance loads .The high –impedance state and increased high logic

Level drive provides these registers with the capability of being connected directly to and

driving the bus lines in a bus organized system without need for inter-face or pull-up

components. They are particularly attractive for implementing buffer registers, I/O ports,

bi-directional bus drivers ,and working registers. The eight latches of the DM74LS373 are

transparent D-type latches meaning that while the enable (G) is HIGH the Q outputs will

follow the data (D) inputs.

When the enable is taken LOW, the output will be latched at the level of the data that was

set up. The eight flip-flops of the DM74LS374 are edge –triggered D-type flip-flop .on the

positive transition of the clock, the Q outputs will be set to the logic states that were set up

at the D inputs. A buffered output control input can be used to place the eight outputs in

either a normal logic state (HIGH or LOW logic levels) or a high-impedance state .In the

high –impedance state the outputs neither load nor drive the bus lines significantly .The

output control does not affect the internal operation of the latches or flip-flops. That is, the

old data can be retained or new data can be entered even while the outputs are OFF.

Features

Choice of 8 –bit D-flip-flops in a single package

3-state bus-driving outputs

full parallel –access for loading

Buffered control inputs

Page 66: Instrumentation

INSTRUMENTATION-II

66 BY: Er. Sharib Ali

Fig. 8 bit output port using 74LS373 Latch

i.TRI- STATE BUFFER (74LS244) 74LS244 is simply 8 tri-state buffer in single chip. A tri-state buffer has a single input, single output and the enable control input. By activating the enable, data at the input is transferred to the output. The enable can be an active low or an active high but for 74LS244 enable inout is an active low.

Fig. Adding 8-bit Input Port Using 74LS244

Page 67: Instrumentation

INSTRUMENTATION-II

67 BY: Er. Sharib Ali

j.Parallel Peripheral Interface Device (8255A) The 8255A is a widely used programmable parallel I/O device. It is programmed to

transfer data under various conditions from simple I/O to interrupt I/O. It is an interrupt

general purpose I/O devices that can be used with almost any microprocessor. The 8255A

has 24 I/O pins that can be grouped in two 8-bit parallel ports: A and B, with the

remaining eight bits as port C. The eight bits of port C can be grouped in two 4-bit ports:

C upper and C lower as shown in fig. below.

8255 generally more flexible and more economical than using 74LS373s and 74LS244s Port A can be programmed as input or output port. It can also be an 8-bit bidirectional port. Port B also can be programmed as in input or output port. It cannot be used as an 8-bit bi-directional port. Port C can also be either an input or an output port. Can be be split into two 4 bit ports. Each 4 bit port can be either an input or an output port. Also, bits of C port can be outputs and individually programmed. FUNCTION OF 8255

All the functions of the 8255A, classified according to two modes:

Bitset/Reset(BSR)mode and I/O mode.

a. The BSR mode is used to set or reset the bits in port C.

b. I/O mode is divided into further three modes: Mode 0, Mode 1 and Mode 2.

i. In Mode 0, all ports function as simple I/O port.

Page 68: Instrumentation

INSTRUMENTATION-II

68 BY: Er. Sharib Ali

ii. Mode 1 is a handshake mode where ports A and / or B use bits from port C as

handshake signals.

iii. Mode 2; port A can be set up for bidirectional data transfer using handshake signals

from port C and port B can be set up either in Mode 0 or Mode 1.

8255 Control Word

Page 69: Instrumentation

INSTRUMENTATION-II

69 BY: Er. Sharib Ali

EXAMPLES

Page 70: Instrumentation

INSTRUMENTATION-II

70 BY: Er. Sharib Ali

BSR MODE(BIT SET/RESET MODE)

Page 71: Instrumentation

INSTRUMENTATION-II

71 BY: Er. Sharib Ali

HANDSHAKING MODE

Page 72: Instrumentation

INSTRUMENTATION-II

72 BY: Er. Sharib Ali

TALKING TO PRINTER (AN EXAMPLE OF HANDSHAKING MODE)

Page 73: Instrumentation

INSTRUMENTATION-II

73 BY: Er. Sharib Ali

INTERFACING DAC TO 8255

Page 74: Instrumentation

INSTRUMENTATION-II

74 BY: Er. Sharib Ali

Digital Data Transmission If all the bits that makes up a digital word are transmitted simultaneously, this is known as parallel transmission. In parallel transmission, each bit of the data word requires its own data line, and together with the control lines, appears as the interface. Parallel interfacing can be efficient method of transmitting digital data if the pieces of equipment are in proximity. However, for long distances a method that requires only one data path, and on which data are transmitted serially(i.e. one bit at a time) is used. Synchronous and asynchronous data transmission Synchronous transmission means that the data being transferred are in synchronization with a timing or control pulse. In parallel synchronous systems, a clock (or strobe) pulse is also transmitted in parallel with the data. The clock pulse notifies the receiving device that valid data have arrived. Parallel synchronous transmission rates can be very high. For synchronous serial data transmission, data is sent in blocks at a constant rate. The start and end of a block are identified with specific bytes or bit patterns. Asynchronous data transmission is performed without the use of synchronizing clock pulses. Instead, it (either serial or parallel) requires handshake between transmitting and receiving devices to ensure that valid data transfers are made. Handshaking is a technique in which the transmitting device sends a pulse that says “data ready”. In response the receiving device replies “acknowledged”. Upon receipt of the “acknowledged” signal, the transmitting device is sure that the receiver is in a state ready to accept data, so the data word can be transferred. For asynchronous serial data transfer each data character has a bit which identifies its start and 1 or 2 bits which identify its end. The term baud rate is used to indicate the rate at which serial data transferred. Baud rate is defined as 1/(the time between signal transmissions). If the signal is changing every 3.33 ms, for example, the baud rate is 1/(3.33ms) or 300 Bd. Common baud rates are 300, 600, 1200, 2400, 4800, 9600, and 19,200. Serial Interfacing Serial transmission interfaces can be built to operate in either simplex, half-duplex, or full –duplex modes. Simplex transmission is unidirectional. A system designed to operate in a simplex mode has only a single transmitter at one end and a receiver at the other. In half duplex mode, information can be sent in one direction at a time in either direction but not both directions at once. In full duplex mode of transmission both transmitters can simultaneously and independently transmit data on the path. To interface a µController with serial data lines, the data lines must be converted to and from serial form. A parallel-in-serial-out shift register and a serial-in-parallel out shift register can be used to do this. Also needed for some cases of serial data transfer is handshaking circuitry to make sure that a transmitter does not send data faster than it can be read in by the receiving system. There are available several programmable LSI devices which contain most of the circuitry needed for serial communication e.g. are UART (Universal asynchronous receiver-transmitter) and USART (Universal synchronous-asynchronous receiver-transmitter) used to do either synchronous or asynchronous communication.

Page 75: Instrumentation

INSTRUMENTATION-II

75 BY: Er. Sharib Ali

Once the data is converted to serial form, it must in some way be sent from the transmitting UART to the receiving UART. There are several ways in which serial data is commonly sent. One method is to use a current to represent a 1 in the signal line and no current to represent a 0. Another approach is to add line drivers on the output of the UART to produce a sturdy voltage signal. The range of these methods are however limited to a few thousand feet. For sending serial data over long distances, the standard telephone system is a convenient path, because the wiring and connections are already in place. Phone lines capable of carrying digital data directly can be leased, but these are somewhat costly and are limited to the specific destination of the line. The solution to this problem is to convert the digital signals to audio-frequency tones, which are in the frequency range that the phone lines can transmit. The device used to do this conversion and to convert transmitted tones back to digital information is called a modem. Modems and other equipment used to send serial data over long distances are known as data communication equipment or DCE. The terminals and computers that are sending or receiving the serial data are referred to as data terminal equipment or DTE. Serial –Data Transmission Methods and Standards I RS-232C Serial Data Standard RS-232C specifies 25 signal pins, and it specifies that the DTE sonnector should be a male and the DCE connector should be a female. The voltage levels for all RS-232C signals are as follows. A logic high, or mark, is a voltage between -3V and -15V under load (-25V no load). A logic low or space is a voltage between +3V and +15V under load (+25V no load). Voltages such as ±12V are commonly used. Connecting RS-232C compatible Equipment If you want to connect the terminal directly to the terminal rather than through modem-modem link, the terminal and the computer probably both DB25-type connectors so that other than a possible male-female mismatch may not occur. The connection should not be made direct because both the terminal and computer are trying to output or input data (TxD/RxD) from their pins (2/3). The same problem exists with the handshake signals. RS-232C drivers are designed so that connecting the lines together in this way will not destroy anything. An adapter with two connectors must be used so that the signals cross over as in figure. This crossover connection is often called a null modem. As in figure, we can see that the TxD from the terminal now sends data to the RxD input of the computer and vice-versa. The handshake signals also are crossed over so that each handshake output signal is connected to the corresponding input signal.

Fig. Non modem RS-232C Connections

Page 76: Instrumentation

INSTRUMENTATION-II

76 BY: Er. Sharib Ali

II Modems When digital data must be transmitted over distances that exceed the distance limits of direct serial transmission methods like RS-232C with line drivers, telephone lines with a modem at each end become the data link over which digital information can be sent. Such use of the phone lines allow data to be transmitted over essentially unlimited distances. The digital data originate in a digital device (i.e., an instrument, computer, or computer peripheral) and is output according to the RS-232C standard to the input of the modem. The modem accepts and converts the digital pulses into audible tones suitable for transmission over the telephone network and then another modem does the reverse at the other end. That is, modem perform the functions of data communications equipment (DCE) devices. Since, the transmitting end modulates the digital data into audio tone suitable for transmission over a voice-channel communications facility, while the receiving modem at the other end demodulates the audio tone back into digital form, hence the name “modem” (modulator/demodulator). What is parity? Briefly explain types of parity. In order to detect possible errors in these alphanumeric codes , an additional bit, called a parity, is often added as the most significant bit. Parity is a term used to identify whether a data word has an odd or even number of 1’s.

a. If a data word contains an odd number of 1’s, the word is said to have odd parity. The binary word 0110111 with five 1’s has odd parity.

b. If a data word contains an even number of 1’s, the word is said to have even parity. The binary word 0110000 has an even number of 1’s, so it has even parity.

The system sending a data word checks the parity of the word. If the parity of the data word is odd, the system will set the parity bit to a 1. This makes the parity of the data word plus parity even. The receiving system checks the parity of the data word plus parity bit that it receives. If the receiving system detects odd parity in the received data word plus parity, it assumes an error has occurred and tells the sending system to send the data again. The system is then said to be using even parity. Questions Related to Digital data communication : Q. 1. Is it possible to connect two computers without modems, if so describe how will you do this? [6] Q.2. What is the difference between synchronous and asynchronous data transfer? Briefly explain types of parity. [2+4]

Page 77: Instrumentation

INSTRUMENTATION-II

77 BY: Er. Sharib Ali

Software Development Methods

The General Model

Software life cycle models describe phases of the software cycle and the order in which those phases are executed. There are tons of models, and many companies adopt their own, but all have very similar patterns. The general, basic model is shown below:

General Life Cycle Model

Each phase produces deliverables required by the next phase in the life cycle. Requirements are translated into design. Code is produced during implementation that is driven by the design. Testing verifies the deliverable of the implementation phase against requirements.

Requirements

Business requirements are gathered in this phase. This phase is the main focus of the project managers and stake holders. Meetings with managers, stake holders and users are held in order to determine the requirements. Who is going to use the system? How will they use the system? What data should be input into the system? What data should be output by the system? These are general questions that get answered during a requirements gathering phase. This produces a nice big list of functionality that the system should provide, which describes functions the system should perform, business logic that processes data, what data is stored and used by the system, and how the user interface should work. The overall result is the system as a whole and how it performs, not how it is actually going to do it.

Design

The software system design is produced from the results of the requirements phase. Architects have the ball in their court during this phase and this is the phase in which their focus lies. This is where the details on how the system will work is produced. Architecture, including hardware and software, communication, software design (UML is produced here) are all part of the deliverables of a design phase.

Implementation

Code is produced from the deliverables of the design phase during implementation, and this is the longest phase of the software development life cycle. For a developer, this is the main focus of the life cycle because this is where the code is produced. Implementation my overlap with both the design and testing phases. Many tools exists (CASE tools) to actually automate the production of code using information gathered and produced during the design phase.

Page 78: Instrumentation

INSTRUMENTATION-II

78 BY: Er. Sharib Ali

Testing

During testing, the implementation is tested against the requirements to make sure that the product is actually solving the needs addressed and gathered during the requirements phase. Unit tests and system/acceptance tests are done during this phase. Unit tests act on a specific component of the system, while system tests act on the system as a whole.

So in a nutshell, that is a very basic overview of the general software development life cycle model. Now lets delve into some of the traditional and widely used variations.

Waterfall Model

This is the most common and classic of life cycle models, also referred to as a linear-sequential life cycle model. It is very simple to understand and use. In a waterfall model, each phase must be completed in its entirety before the next phase can begin. At the end of each phase, a review takes place to determine if the project is on the right path and whether or not to continue or discard the project. Unlike what I mentioned in the general model, phases do not overlap in a waterfall model.

Waterfall Life Cycle Model

Advantages

• Simple and easy to use. • Easy to manage due to the rigidity of the model – each phase has specific

deliverables and a review process. • Phases are processed and completed one at a time. • Works well for smaller projects where requirements are very well understood.

Disadvantages

• Adjusting scope during the life cycle can kill a project

Page 79: Instrumentation

INSTRUMENTATION-II

79 BY: Er. Sharib Ali

• No working software is produced until late during the life cycle. • High amounts of risk and uncertainty. • Poor model for complex and object-oriented projects. • Poor model for long and ongoing projects. • Poor model where requirements are at a moderate to high risk of changing.

V-Shaped Model

Just like the waterfall model, the V-Shaped life cycle is a sequential path of execution of processes. Each phase must be completed before the next phase begins. Testing is emphasized in this model more so than the waterfall model though. The testing procedures are developed early in the life cycle before any coding is done, during each of the phases preceding implementation.

Requirements begin the life cycle model just like the waterfall model. Before development is started, a system test plan is created. The test plan focuses on meeting the functionality specified in the requirements gathering.

The high-level design phase focuses on system architecture and design. An integration test plan is created in this phase as well in order to test the pieces of the software systems ability to work together.

The low-level design phase is where the actual software components are designed, and unit tests are created in this phase as well.

The implementation phase is, again, where all coding takes place. Once coding is complete, the path of execution continues up the right side of the V where the test plans developed earlier are now put to use.

V-Shaped Life Cycle Model

Advantages

• Simple and easy to use. • Each phase has specific deliverables.

Page 80: Instrumentation

INSTRUMENTATION-II

80 BY: Er. Sharib Ali

• Higher chance of success over the waterfall model due to the development of test plans early on during the life cycle.

• Works well for small projects where requirements are easily understood.

Disadvantages

• Very rigid, like the waterfall model. • Little flexibility and adjusting scope is difficult and expensive. • Software is developed during the implementation phase, so no early prototypes of

the software are produced. • Model doesn’t provide a clear path for problems found during testing phases.

Incremental Model

The incremental model is an intuitive approach to the waterfall model. Multiple development cycles take place here, making the life cycle a “multi-waterfall” cycle. Cycles are divided up into smaller, more easily managed iterations. Each iteration passes through the requirements, design, implementation and testing phases.

A working version of software is produced during the first iteration, so you have working software early on during the software life cycle. Subsequent iterations build on the initial software produced during the first iteration.

Incremental Life Cycle Model

Advantages

• Generates working software quickly and early during the software life cycle. • More flexible – less costly to change scope and requirements. • Easier to test and debug during a smaller iteration. • Easier to manage risk because risky pieces are identified and handled during its

iteration. • Each iteration is an easily managed milestone.

Disadvantages

• Each phase of an iteration is rigid and do not overlap each other. • Problems may arise pertaining to system architecture because not all requirements

are gathered up front for the entire software life cycle.

Page 81: Instrumentation

INSTRUMENTATION-II

81 BY: Er. Sharib Ali

Spiral Model

The spiral model is similar to the incremental model, with more emphases placed on risk analysis. The spiral model has four phases: Planning, Risk Analysis, Engineering and Evaluation. A software project repeatedly passes through these phases in iterations (called Spirals in this model). The baseline spiral, starting in the planning phase, requirements are gathered and risk is assessed. Each subsequent spirals builds on the baseline spiral.

Requirements are gathered during the planning phase. In the risk analysis phase, a process is undertaken to identify risk and alternate solutions. A prototype is produced at the end of the risk analysis phase.

Software is produced in the engineering phase, along with testing at the end of the phase. The evaluation phase allows the customer to evaluate the output of the project to date before the project continues to the next spiral.

In the spiral model, the angular component represents progress, and the radius of the spiral represents cost.

Spiral Life Cycle Model

Page 82: Instrumentation

INSTRUMENTATION-II

82 BY: Er. Sharib Ali

Advantages

• High amount of risk analysis • Good for large and mission-critical projects. • Software is produced early in the software life cycle.

Disadvantages

• Can be a costly model to use. • Risk analysis requires highly specific expertise. • Project’s success is highly dependent on the risk analysis phase. • Doesn’t work well for smaller projects.

Related Questions to software development:

1. “ The programming language used in instrumentation depends on particular application” do you agree with this statement? [5]

2. Explain why waterfall model of software development is inadequate for software development. Describe the best model for software development. [2+4]

Page 83: Instrumentation

INSTRUMENTATION-II

83 BY: Er. Sharib Ali

A Microprocessor Based Data Logger A typical data logging system can use many types of signal conditioners, amplifiers, and output devices. A printer is most commonly used in logging of slowly varying data. A part of processing of data may be involved in linearization of the thermocouple output, computation of the average value of the certain sets of input data or conversion to engineering units. Besides, the comparison of the major data with the preset minimum and maximum limits and actuation of out of limit, indicators or initiation of alarms can also be carried out. The system can also be made to sequentially shutdown energization systems, when maximum tolerable limits of working systems are recharged. Requirements of a data logging system which is to collect data periodically from 100 locations can be as follows:

1. The provision to collect load information from 60 locations. Transducer used -load cell. The load cell information from each individual station is to be measured at least once in every 5 seconds. The measured data with the time at which measurement is made should be printed out as well as stored in digital cassette for analysis later.

2. The provision to monitor temperature at 20 points. The temperature range – 0 to 10000C. Transducer used is K-type thermocouple. Output data are to be linearized to provide direct display of temperature to with-in ± 0.1% to ±10%. Visual indicators are to be actuated when the set temperature limits (settable for each station) are exceeded. Reading rate- once in every 5 minutes.

3. The provision to monitor 20 control point voltages. Actual alarms are to be set when any of them falls out of the range of the ±5V. Simultaneous visual indication of the particular station where the voltage is out of range to be displayed.

Tele Type writer

Cassette d

M

ICR

OPR

OC

ESS OR

INPU

T

OU

TPUT

MU

LTIPLEXER

PRO

GR

AM

MA

BLE G

AIN

DA

TA

SAM

PLE AN

D H

OLD

& A

DC

LOAD

LOAD

LOAD

THERMOCOUPLE 1

THERMOCOUPLE 2

THERMOCOUPLE 20

V.CONTROL POINT 1

V.CONTROL POINT20

Real Time

Ch.no Load

Temp

Control point

Ch.no.

Ch.no.

Over Load & over Limit Indicator

Page 84: Instrumentation

INSTRUMENTATION-II

84 BY: Er. Sharib Ali

A data logger of this nature is efficiently handled by a µP-based system. The system can be designed in such a way that a built –in clock is used to function as a real time clock so that each measurement is logged along with the time at which it is done. Invariably, the channel number identifying the channel on which measurement is made can also be logged. In the case of load cell measurement, balancing of the individual strain gauge can also be done by the processor. The processor can do this by calling sub-routines at the start of logging by noting the outputs of the load cells when no load is applied and storing these for latter subtraction from individual measurement (all to zero).The rate of reading (necessity to take readings of the load in every 5seconds) can be tailored to the requirement. The processor can command low-level or high-level multiplexers at appropriate times to access data from a desired channel, convert the data into digital value, store these into RAMs within the system and proceed to log data from other locations. It can efficiently utilize the time available to it for doing the various functions by commanding the RAM data to be stored in cassette in a serial form after adding parity and synchronization. For the monitoring and display of temperature, the thermocouple output will be amplified and linearized by look-up tables stored within the system in RAM chips. The linearized output can be transferred to output ports that control the display digits. Constant comparison can be made of the temperature with the limit values set in the operating console or fed to the microprocessor system at the start of process. Visual annunciators (indicator that announces which electrical circuit has been active) can be actuated based on this comparison, when the limits are exceeded. The monitoring of the other 20 voltage levels corresponding to the control functions can also be carried out in the same way. This data logging system can have incorporated within it programmable data amplifiers and multiplexers to handle the inputs. It can also have a fast ADC for conversion of analog inputs. Its output device can be teleprinter or line printer that will provide the printout of data. It can have an operating console with a keyboard for the entry of necessary data commands, a panel display that displays the temperature of various station monitored by it, visual and other alarms. It can also have a cassette interface for reading the load cell data from 60 stations. While the µP has to operate on instructions sequentially, the fast speed at which it operates it to enable access, convert, compute, display and record information from various stations. It is thus suited for logging of many parameters and to take intelligent decision based on computations carried out. Exercise:

FIG. Block diagram of µP based data

Q.1 You are required to design a microprocessor based instrumentation system for monitoring the humidity and temperature records of six places. What would be the most basic components involved in the design of this system? Explain these basic components briefly with the help of a block diagram.

Page 85: Instrumentation

INSTRUMENTATION-II

85 BY: Er. Sharib Ali

II. BASIC COMPONENTS INVOLVED IN DESIGNING MICROPROCESSOR BASED SYSTEM

1. Define problem – system specification 2. Hardware –software Trade-offs- Initial System Design 3. Preliminary Hardware Design 4. Preliminary Software Design 5. Modify Hardware/ Software Design and Trade-offs 6. Build Prototype 7. Write Software 8. Debug Hardware and Software 9. Final System Check

Block Diagram

IC TESTER MACHINE Basic Principle:

System Specification (Define Problem)

Initial System Design Hardware/Software Trade-offs

Preliminary Hardware Design

Preliminary Software Design

Modify Hardware / software Design & Trade offs

Build Prototype Write Software

Debug Hardware/ software

Final System Check

Page 86: Instrumentation

INSTRUMENTATION-II

86 BY: Er. Sharib Ali

The basic principle of testing any IC or device is to compare the outputs obtained from the IC remaining under test on giving a set of input signals (check bits) based on its truth table, with the standard results stored in the memory for a particular set of input signals. If all sets of results so obtained for a specific IC, tally with the stored results, the IC is declared ‘GOOD’; otherwise it is considered ‘BAD’. The above 1st figure shows the steps required to be followed for designing a microprocessor based system. For this particular type microprocessor based instrument the following blocks are required-

1. A microprocessor kit, (such as Intel 8085 based kit) with programmable IC chips 2. Zip socket for IC under test 3. Power supply selection unit 4. Data Input Unit 5. Display unit

An overall block diagram of the system is given below-

Fig. Block Diagram of IC Tester The power supply selection unit connects 5V supply and ground to appropriate pins of the digital IC under test. The microprocessor sends out check bits for application to the input pins of the IC under test. Similarly, the responses from output pins of the IC under test are again fed back to the microprocessor. These responses are then compared with the standard expected responses which are stored in the memory. Any mismatch between the two causes the IC BAD LEDs in the display unit to glow.

Display

Microprocessor Standard Result

Supply/ Ground Pin Selection

Comparison (by µP Kit)

IC under Test

Input

Check Bits

Page 87: Instrumentation

INSTRUMENTATION-II

87 BY: Er. Sharib Ali

If the responses match, ‘IC GOOD’ LEDs glow. The overall system system flowchart is given below so far as concerned with programming language, assembly language is used for programming. The kit should be equipped with the assembler which makes the task of assembly language programming simpler. The program requires certain data such as IC number, IC type etc, which are to be stored in the RAM area of the microprocessor, using the keyboard of microprocessor kit, before running the program. The software developed is designed for operation of the IC tester in the following modes-

i. Test Mode ii. Search Mode iii. Self Test Mode iv. Directory Check

Hardware The basic electronic components are-

1. Hex buffer/ Driver with open collector 2. High current Darlington arrays 3. Multiple Inputs NAND gate 4. 8255 programmable peripheral interface (PPI) 5. Hex inverter 6. Relay, SPDT 7. 8085 microprocessor trainer kit 8. External 6V, 500mA and 5V, 250mA regulated power supply 9. ZIF socket, 24 pins 10. SIP connectors 11. Ribbon Cables

Etc

Microprocessor based Smart Scale Scopes:

I. It can be used to take weight of consuming materials. II. It can be used in company mail rooms to weight packages and calculate the postage

required to send them to different postal zones. III. It can be used to count coins in a bank or gambling casino. In this application, the

user enters the type of coin being weighted. There is a conversion factor in the program that computes the total number of coins and the total dollar amount.

IV. It can be used in packaging items for sale. As for example, somebody is manufacturing wood screws and he wants to package 100 of them per box. It is then that we can pass the boxes over the load cell on a conveyor be it and fill them from a chute until the weight.

As in block diagram, a load cell converts the applied weight of something like a bunch of carrots to a proportional voltage signal. This is a small signal which is amplified and converted to a binary (digital) value. This binary value is read in by the microprocessor and sent to the attached display.

Page 88: Instrumentation

INSTRUMENTATION-II

88 BY: Er. Sharib Ali

The user then enters the price per kg. with the keyboard and this price per kg. is shown on the display. Then the user presses the compute key on the keyboard, then the µp multiplies the weight times the price per kg. and display the computed price. After holding the price display long enough for the user to read it, the scale goes back to reading in the weight and displaying it. To save the user from having to type the computer price in the cash register, an output from this scale could be connected directly into the cash registry circuitry. Also, a speech synthesizer could be added to verbally tell the consumer the weight, price per kg., and total price. HARDWARE REQUIREMENT

1. Reference voltage source- LM 329 2. Differential Amplifier- LM308 3. NPN transistor as a driver 2N2222 4. Load cell having transducers connected-strain gage load cell 5. Bridge configuration of resistors network 6. Instrumentation Amplifier- LM363N16 7. Analog-to-Digital converter – MN14433 8. Microprocessor kit- 8085/8086 9. Electronic components required

Circuit Description We have used the model C462-10#-10PI strain gage load cel. We have added a piece of wood to the top of load cell to keep the materials from falling off. This load cell has the accuracy of about 1 part in 100 or 0.01kg. over the 0 to 10 kg. range for which it was designed. The load cell is having four 350Ω resistors connected in bridge configuration. A stable 10.00 V excitation voltage is applied to the top of bridge. When there is no load on the top of cell, the outputs from the bridge are at about the same voltage, 5V.When a load is applied to the bridge, the resistance of one of the resistors will be changed. This produces a small differential voltage output from the bridge. The maximum differential voltage output difference for the 10kg. load cell is 2mV per volt of excitation. So, with the 10.00V excitation as shown in the circuit, the maximum differential output voltage will be 20mV. This output voltage is too small to be used so it must be amplified properly. That why, we use an instrumentation amplifier(LM363N16). The close loop gain of the amplifier is programmable with the jumpers 2,3 and 4 for fixed values of 5,100 and 500. We have jumpered here for a gain of 100 so load cell will give a maximum voltage of 2.00V to the A/D converter input. A precise voltage divider on the output of the amplifier divides this signal in half so that a weigth of 10.00kg. produces an output voltage of 1.000V. This scaling simplifies the display of weight after it is read into the microprocessor. The 0.1µF capacitor between the pins 15 and 16 of the amplifier reduces the bandwidth of the amplifierto about 7.5Hz. This removes 60 HZ and any high frequency noise that might have been induced in the signal lines. The voltage across the LM329, 6.9V precision referenced diode is amplified to produce 10.00V excitation voltage for the load cell and a 2.00V reference for the A/D with a 2.00V reference voltage, the full scale input voltage for the A/D is 2.00V.

Page 89: Instrumentation

INSTRUMENTATION-II

89 BY: Er. Sharib Ali

Conversion rate and the multiplexing frequency for the converter are determined by an internally oscillator and R11. An R11 of 300KΩ gives a clock frequency of 66KHz, a multiplied frequency of 0.8KHz, and about four conversions per second. Accuracy is ±0.05% and ±1 count.