Professional Documents
Culture Documents
Faculty of Engineering
Department of Biomedical Engineering
1
What is LabVIEW?
Virtual Instruments
The basic files you create with LabVIEW are called Virtual Instruments, or VIs.
Each VI consists of two main parts—the front panel and the block diagram—and a
third part—the icon and connector.
2
Front Panel: The User Interface
The front panel contains the user interface of your VI. The following image is an
example of a front panel window.
The block diagram contains the graphical code for your VI. The following image is an
example of a block diagram window.
In this block diagram, the values passed from the front panel knob controls are added
every 500 milliseconds. The results are displayed on the waveform graph when the
user presses the Boolean button on the front panel to stop the VI.
The icon and connector pane of a VI are located in the upper-right corner of the front
panel and block diagram window. The icon is what you see on the block diagram
when you use a VI as a subVI.
3
The LabVIEW Environment
The basic LabVIEW environment elements are the menus at the top of the front panel and block
diagram windows, the toolbar, and the free-floating palettes, which you can place anywhere on the
screen.
The Controls and Functions palettes contain the basic building blocks of VIs. You can browse
through the palettes for the controls, indicators, VIs, and functions you need.
Tools Palette
The Tools palette is available on the front panel and the block diagram. A tool is
a special operating mode of the mouse cursor. The cursor corresponds to the icon
of the tool selected in the palette. Use the tools to operate and modify front panel
and block diagram objects.
If automatic tool selection is enabled and you move the cursor over objects on the
front panel or block diagram, LabVIEW automatically selects the corresponding
tool from the Tools palette.
Use the Tools palette to modify the contents of the front panel and block
diagram.
Each icon on the Tools palette changes the behavior of the cursor in LabVIEW so
you can perform positioning, operating, and editing tasks on your VIs.
Controls Palette
You build a front panel by placing controls and indicators from the Controls
palette. Each palette icon represents a subpalette, which contains controls you
place on the front panel.
A control is a front panel object that the user manipulates to interact with the VI.
Simple examples of controls are buttons, slides, dials, and text boxes.
An indicator is a front panel object that displays data to the user. Examples of
indicators are graphs, thermometers, and gauges.
4
Functions Palette
You build the block diagram using the terminals from the front panel controls
and indicators and the VIs, functions, and structures from the Functions palette.
Each palette icon represents a subpalette, which contains VIs and functions you
place on the block diagram.
As you add nodes to the block diagram, you wire them to each other and to the
terminals from the front panel objects using the Wiring tool, found on the Tools
palette. A complete block diagram appears similar to a flowchart
5
The Hashemite University
Biomedical Engineering Faculty
Biomedical Transducer Lab. (0406326)
Experiment (1)
Introduction to Measurement System
Objectives:
Basic Information:
Signal Conditioning: To measure signals from transducers, you must convert them
into a form a DAQ device can accept. Common types of signal
Conditionings include amplification, isolation, and filtering. For this purpose the
bridge amplifier (ETH- 256) with two channel combinations can be used.
Signal Processing: it is the process of converting the raw signal into a useful form to
get specific data from it. One of the interfacing software that helps in signal
processing is Labview.
Analog Input: Acquire a specified number of samples at a specified sample rate from
both a single or multichannels inputs and returns the acquired data. The AI acquire
Waveform VI performs a timed measurement of a waveform (multiple voltage
readings at a specified sampling rate) on a single analog input channel.
Data Presentation: the last stage in any measurement system, that presents the
measured value in a form which can easily recognized by the observer. There are two
ways to present the output data:
1. Inside Labview: in this case the output data transfer to a local indicator
within Labview such as waveform graph, waveform chart …etc.
7
2. Outside Labview: in this case the display screen will be out of the
computer, so it should be taken as an output from the DAQ. To achieve
this Labview provides analog output VI that generates a timed, simple-
buffered waveform for the given output channel at the specified update rate
then this output will be shown on an external indicator such as
oscilloscope.
Equipments:
Procedure:
Right click in the front panel of the VI to get two waveform graphs from Controls
list:
Graph >> Waveform Graph.
4. Connect the Function Generator (FG) output to ACH0 on the BNC-2090 at (Diff)
mode.
8
5. Set the FG parameters to provide Sine wave with 2 Vp-p at frequency 50Hz
6. Connect the BNC-2090 output (DAQ0OUT) to CH1 at the oscilloscope.
7. Run your program continuously.
9
The Hashemite University
Biomedical Engineering Faculty
Biomedical Transducer Lab. (0406326)
Experiment (2)
Signal Conditioning (1)
Objectives:
Basic Information:
Many sensors have a primary sensing element that convert the input variable
to a resistance. So, such sensors need a variable-conversion element that
converts the change in resistance to an electric voltage change, Wheatstone
bridge used for this purpose.
10
Detecting zero current can be done to extremely high accuracy. Therefore, if
R1, R2 and R3 are known to high precision, then Rx can be measured to high
precision. Very small changes in Rx disrupt the balance and are readily
detected.
Amplification:
Equipments:
• Power Supply.
• Breadboard.
• Digital Multimeter.
• Potentiometer (1KΩ).
• Operational Amplifier (Op-Amp LM741CN).
• Resistors with different values.
• Wires.
Procedure:
11
1. Construct the following circuit.
2. Adjust the Wheatstone bridge circuit until you reach the null point.
12
The Hashemite University
Biomedical Engineering Faculty
Biomedical Transducer Lab. (0406326)
Experiment (3)
Signal Conditioning (2)
Objectives:
Learning how to build an interface circuit between analog and digital systems
through an analog to digital converter integrated circuit.
Basic Information:
Analog Signals
Analog signals are continuous electrical signals that vary in time as shown in
the figure below. Most of the time, the variations follow that of the non-
electric (original) signal. Therefore, the two are analogous hence the name
analog.
Not all analog signals vary as smoothly as the waveform shown in Figure 1.
Analog signals represent some physical quantity and they are a ‘MODEL’ of
the real quantity.
Digital Signals
13
Analog system is very complicated when compared to digital one according to:
Number of circuits'
Too much Few
components
Hard, because it needs Easy, because it needs
Updating
changing parts with only to change the
(changing the design)
different values software programming
Resolution: the value of the bit with respect to measured value (for example:
when we said that 1bit = 0.19V this means an increase/decrease of 0.19V will
cause the binary value to increase/decrease by 1).
14
Equipments:
• Power Supply.
• Breadboard.
• Function Generator.
• Oscilloscope.
• Digital Multimeter.
• Analog to Digital Converter (ADC) IC.
• Voltage Regulator.
• LEDs.
• Resistors and capacitors with different values.
• Wires.
Procedure:
Square wave.
Amplitude = 2.5V.
DC Offset = 2.5V.
Frequency = 202 KHz.
3. Let the input voltage be (3, 6, 9) Volt record the corresponding binary
number for each.
15
16
The Hashemite University
Biomedical Engineering Faculty
Biomedical Transducer Lab. (0406326)
Experiment (4)
Static Characteristic of Measurement System
Objectives:
Basic Information:
The ways in which a sensor affects the measurement performance due to the
feature of the sensor are termed its static characteristics.
Some of these characteristics are:
1. Range: the interval between the maximum and minimum either for the input or
for the output. (Input range: Imax, Imin and the output range: Omax, Omin).
2. Span: the interval of input /output range of a measurement device. (Input span
= Imax - Imin and the output span = Omax - Omin).
17
Equipments:
Procedure:
3. Using Labview software and the voltage division rule; construct the following
program to find the value of RL from its voltage.
Note: you can get the (Amplitude and Levels.vi) from Functions >> Analyze >>
Waveform measurements >> Amplitude and Levels.vi.
4. For the six resistor in the range (1 KΩ -10 KΩ) find their values first using
DMM then using your measurement system and record the results.
18
Note: use the DMM to compare the resistor voltage value with that appears at
your Labview VI.
6. Again measure the values of the previous resistors start from 10 KΩ down to
1.2 KΩ and record your results.
19
The Hashemite University
Biomedical Engineering Faculty
Biomedical Transducer Lab. (0406326)
Experiment (5)
Calibration Process
Objectives:
Basic Information:
Force Transducer (FT): when a force is applied to a structure, the length of the
structure changes. Strain is the ratio of this change in dimension to the original,
and strain gauges are used to measure it. As the strain gauge is glued to the
structure, any distortion will also cause a distortion of the strain gauge. The gauge
contains conducting material and the distortion therefore results in a change in its
resistance. By measuring this change in resistance we can measure the strain.
Wheatstone bridge.
20
Displacement Transducer (DT): the displacement transducer used, based on a
moving magnetic rod and a stationary magnetic sensor. Changes in the magnetic
flux cause changes in the output induced voltage that can be detected.
Equipments:
Procedure:
21
Note: Get Y Value.vi from Functions >> Waveform >> Waveform Operation
>> Get Y Value. vi
5. Using the offset knob at the bridge amplifier, try to reach the first calibration point
(0 (gm)/ (mm), voltage (mV)).
Note: consider the zero weight for the FT as the force transducer without
weight, while for DT the zero displacement when the rod all the way to one
ends of its travel.
6. To take the second calibration point its prefer to have the maximum value of the
variable you want to measure. So, for the FT hold a known weight (ex: 100gm.
Notice that the holders weight is 20gm) and record the voltage output, while for
the DT push the rod all the way to the other end of its travel, measure the length
of rod that extends from the sensor housing using caliper then record the
corresponding voltage.
Note: the constant will be zero if you have the first calibration point exactly (0,0).
22
The Hashemite University
Biomedical Engineering Faculty
Biomedical Transducer Lab. (0406326)
Experiment (6)
Heart Sound Measurement
Objectives:
Basic Information:
A microphone converts sound energy into electrical energy; one of the most
commonly used microphones is crystal microphones that utilize the piezoelectric
properties of crystals to convert sound waves into electrical pulses. The crystal
microphone uses the piezoelectric effect by placing the sensitive diaphragm over
a piezoelectric crystal. Vibration of the diaphragm due to sound waves pushes
against the crystal, causing it to generate an electric current of variable voltage.
The signal may then be amplified and processed to produce sound waves.
Speakers convert the electric signals of microphones back into sound waves. The
dynamic speaker at the receiving end of the electrical or radio wave signal
consists of a rigid speaker frame that contains a cone-shaped diaphragm. An
input terminal on the speaker frame runs an electrical current to the inside of the
speaker, where the current flows through a conductive coil. This coil is looped
around a permanent magnet mounted in a conductive frame. The electrical pulses
cause the wire to generate a varying magnetic field that makes the cone of the
speaker vibrate. Two dampers on the side of the center cap of the cone confine
the vibrations to the sensitive diaphragm and keep the sound waves from being
muffled by the speaker frame. The diaphragm's shape amplifies the sound, and
the vibrations produce sound waves that vary with the electrical signal input.
Heart Sounds:
Heart sounds are vibrations produced by the closure of the valves . Physicians
listen to heart sounds for the purpose of diagnosing various cardiac malfunctions.
Within a cardiac cycle, there are four sounds produced by the mechanical activity
of the heart.
S1: First heart sound is initiated by the onset of ventricular systole. It is the
longest and loudest of the four sounds. S 1 is heard best over the apical region of
the heart. S1 is produced by the oscillation of blood in the ventricular chambers
23
and vibration of the ventricular free wall. At the onset of systole, ventricular
pressure begins to increase and forces the blood within the ventricles toward the
atria through the mitral and tricuspid valves. As these one way valves close,
blood and the ventricular wall vibrates producing the S 1 sound. Therefore, S1
sound is expected soon after the onset of the ventricular contraction, QRS wave
of the ECG. Heart now is in the iso-volumetric contraction phase of the cardiac
cycle.
S2: The second heart sound is generated the end of the ejection of the blood from
the ventricles by the closure of the semilunar valves, i.e. aortic and pulmonic
valves. At this point, blood from the ventricle is pumped into the arteries, arterial
pressure exceeded the ventricular pressure, hence the one way valves are closing
as the pressure is reversed. These sounds have higher frequency components and
the aortic valve sound is louder than the pulmonic valve sound.
S3: This heart sound is heard in young children and patients with left ventricular
failure and believed to be resulted by the deceleration of blood entering the
ventricle. In enlarged hearts, ventricular walls are stretched beyond normal
ranges and are under tension allowing vibrations.
S4: Is the weakest on of all the heart sounds and heard occasionally. It is not
related to a pathological condition and believed to be due to the oscillation of
blood in the atria and atrial walls. It occurs immediately after the P-wave in the
ECG.
The next Figure shows the relationship between the heart sounds and the ECG
waveform.
# Frequency Change
increases the sharpness
of the sound.
# Amplitude Change
increases the Loudness
of the sound.
24
Equipments:
Procedure:
1. Fix the sensor vertically on the supporting stand. It should be against the
level of audio generator speaker.
• HPF: 3 Hz.
• LPF: 2 KHz.
• Gain: x1.
3. Connect the sound transducer cable to CH1 on the bridge. Connect the
bridge output to one of the oscilloscope channels. Place the transducer in
front of the audio generator speaker. Let the space between them be 0.5
cm. Keep this space constant.
5. Set the function generator to 100Hz 100mV p sine wave. Increase the
volume of the audio generator until you hear a comfortable voice then
notice the output frequency on the oscilloscope.
6. Change the input frequency values slowly (don't exceed 250 Hz) and
notice the output frequency.
7. Now shutdown the speaker and notice the signal on the oscilloscope.
8. Repeat steps (5-7) but in this time fix the frequency and change the
amplitude slowly.
9. Clean the sound transducer and your skin above your heart with alcohol.
25
10.Measure your heart sound (S1). By applying the sound transducer on your
heart as shown in the following figure. Try to detect (S1) , speak, laugh,
and move. Notice changes on your signal.
11.Repeat step 10, but in this case put some gel at the transducer then take
measurement.
26
The Hashemite University
Biomedical Engineering Faculty
Biomedical Transducer Lab. (0406326)
Experiment (7)
Temperature Measurement (1)
Objectives:
Basic Information:
Equipments:
• Bridge Amplifier.
• PC, with Labview software.
• Supporting stand.
• Heater.
• Temperature sensor (thermocouple).
• Digital thermometer.
• Mercury thermometer.
• Beakers.
• Water, ice.
27
Procedure:
2. Construct the Labview VI that returns the temperature readings (in Cº)
using the thermocouple (notice that your thermocouple is linear).
3. Check the temperature of heated water of 40Cº and body temperature at the
inside of elbow joint (elbow joint flexed).
6. Repeat steps (1-5) but this time start with two temperatures one for heated
water with 50Cº and the other one for water with temperature less than
10Cº, then construct your linear relationship to take measurements.
28
The Hashemite University
Biomedical Engineering Faculty
Biomedical Transducer Lab. (0406326)
Experiment (8)
Temperature Measurement (2)
Objectives:
Basic Information:
Many factors affect the design of biomedical instruments. The factors that impose
constraints on the design are of course different for each type of instrument.
However, some of the general requirements can be categorized as signal,
environmental, medical, and economic factors.
In this experiment we are going to study the signal factors such as sensitivity,
range, accuracy, linearity…. etc.
Thermistor:
ΔR = change in resistance
ΔT = change in temperature
k = first-order temperature coefficient of resistance
Procedure:
Note: when you test your design record the thermistor resistance and the output
voltage of the sensor.
30
The Hashemite University
Biomedical Engineering Faculty
Biomedical Transducer Lab. (0406326)
Experiment (9)
Photocell
Objectives:
Basic Information:
31
Equipments:
Procedure:
8. Using DMM study the relation between the photocell resistance and the distance of
your finger above its surface. Record your results.
10.Adjust the potentiometer in your design to let the LED be ON only and only if
your finger touches its surface otherwise it should be OFF.
11.According to your design; measure the value of the potentiometer that achieved the
above condition.
32