Download as pdf or txt
Download as pdf or txt
You are on page 1of 68

MEASUREMENT & INSTRUMENTATION

LABORATORY (ELE 3162)

LABORATORY MANUAL

V SEMESTER B. Tech (E&E)


(Academic year 2023-2024)

Student Name
Register Number
Section / Roll no.

Department of Electrical and Electronics Engineering


MANIPAL INSTITUTE OF TECHNOLOGY, MANIPAL
(Manipal Academy of Higher Education, Manipal)

July 2023
Measurement & Instrumentation Lab

TABLE OF CONTENTS

Week Experiments Page


No.
1 Introduction to LabVIEW - programming and loops 05
2 Shift registers and subVIs in LabVIEW 16
3 Case structures in LabVIEW, Miniproject review 1 24
4 Express VI, signal processing and storage using LabVIEW 29
5 Interfacing Arduino to LabVIEW and realization of measuring instruments: 39
DC voltmeter, light intensity level meter
6 Signal conditioning circuit: Instrumentation amplifier 45
7 Signal conditioning circuit: Realization of analog filter, Miniproject review 2 48
8 Realization of digital meters 1: voltmeter, temperature level meter, power 51
measurement system
9 Realization of Digital Meters 2: power spectrum analyzer 66
10 Lab mini-project demonstration 68

CO No Course Outcome
CO 1 Build Virtual instrument simulations by exploring National Instruments LabVlEW software

CO 2 To interface microcontroller to LabVIEW and realize measuring instruments

CO 3 Analyze a three-OPAMP Instrumentation amplifier and analog filter for given specifications.

CO 4 Develop digital instruments using LabVlEW and applications of NI Data Acquisition platform.

CO 5 Investigate a complex problem by developing a capstone mini project using laboratory skills
making use of technical literature.

Department of E&E Engineering 2


Measurement & Instrumentation Lab

Evaluation Plan: Continuous Evaluation (60%) + LAB exam (40%)


Evaluation Weightage
LAB Exercise: Preparation, Conduction, Documentation 40%
Mini project: Progression, Demonstration and Documentation 20%
Continuous Evaluation: 60%
LAB End Exam: VIVA, Writeup and Conduction 40%
Total 100%

General Instructions to students:

1. Be well disciplined and follow the dress code in the lab.


2. Come to the LAB on time and keep the belongings in the allotted space inside the lab.
3. Students need to maintain an observations/report book.
4. Students need to come prepared writing the questions, theory, algorithm/logic/flowchart for
regular demonstration and exercise questions.
5. After conduction of experiments students need to submit theory observations and inferences
for evaluation.
6. DO NOT possess smartphone/cellphone in-person inside the lab.
7. Handle the measuring instruments and apparatus carefully.
8. Return the instrument/equipment issued for the experiments before leaving the lab

LAB Journal Book Instructions:


1. Maintain a separate book for Measurements and Instrumentation lab Journal
2. Preparations: Before coming to the LAB, Write the Following in the LAB journal for all the
examples and exercise questions of each week of the LAB
a. Title (Week 1: xxxx)
b. Objective
c. Questions (examples and exercises)
d. Logic/flowchart for programming questions
e. Connection diagram/circuit diagram
f. Formulas and appropriate calculations
3. Conduction: Conduct the experiments following the procedure given in the manual and write
the observations in the journal.
4. Documentation: After conduction, do necessary calculations and obtain results, document the
following in the journals
a. Tabulation/observations/Results
b. Inferences (week /Experiments)

Department of E&E Engineering 3


Measurement & Instrumentation Lab

Safety Instructions to students:

1. All wiring connections should be firm and tight, loose connections and joints between cables
should be avoided.
2. DO NOT turn ON the power supply to the instruments unless approved by the faculty in-
charge.
3. If any issues with the circuit is observed, do not touch/stay away from the circuit, call the lab
in-charge immediately and inform.

Layout of Microcontroller & Instrumentation Lab

Department of E&E Engineering 4


Measurement & Instrumentation Lab

Week 1: Introduction to LabVIEW - programming and Loops


Objective: Familiarize Graphical Programming and loops in LabVIEW

1.1 Introduction
LabVIEW (Laboratory Virtual Instrument Engineering Workbench), a system design software
developed by National Instruments, used by engineers and scientists for Data analysis, Visualization
and Real-Time monitoring & control of engineered systems. Its comprehensive system design
environment, unique graphical programming language, built-in engineering-specific libraries of
software functions and hardware interfaces provide tools needed to create, simulate and deploy
complex measurement and control systems through unparalleled hardware integration.

Acquiring Data and Processing Signals, Instrument control, Embedded Monitoring and Control are
few of the tasks that can be achieved easily through LabVIEW.

1.2 Invoking LabVIEW

To invoke LabVIEW, either double click the icon on Desktop or search for “National
Instruments LabVIEW 2010” in start button of windows. The getting started window shown in Fig
1.1, is displayed when LabVIEW is launched. New projects and VI’s can be created, previously
created project, VI’s can be opened, find recently opened LabVIEW files, find examples and LabVIEW
help.

Fig 1.1: Getting Started Window

1.3 Creating and saving a LabVIEW Project

Department of E&E Engineering 5


Measurement & Instrumentation Lab

1. Select File>>New Project to display the Project Explorer window or select


Project>>EmptyProject in the New dialog box to display the Project Explorer window. The
window is as shown in Fig 1.2
2. Add items which has to be included in the project under target.
3. Select File>>Save Project to save the project.

Fig 1.2: Project explorer window

1.4 Creating and saving a VI


LabVIEW programs are called virtual instruments, or VIs, because their appearance and operation
imitate physical instruments, such as oscilloscopes and multimeters. The VI comprise of two
interfaces, the front end known as Front Panel and the programming environment called as Block
Diagram.

An user interface, or Front Panel is built with controls and indicators as shown in Fig 1.3. Controls
are knobs, push buttons, dials etc.. Indicators are graphs, LEDs, and other displays. When controls
and indicators are placed on the Front Panel, a corresponding graphical input block is created
automatically in the Block Diagram. The procedure for creating the VI is as follows:

• Select File>>Open Project, the Project Explorer window is displayed on the screen.
• Select File>>New VI. An empty Front Panel and Block Diagram are displayed on the screen.
Also the VI is created and displayed under the Project Name in the Project Explorer.
• Select File>>Save All to save the project and all the VI’s

Department of E&E Engineering 6


Measurement & Instrumentation Lab

Fig 1.3 a) Front Panel Fig 1.3 b) Block Diagram

In the Block Diagram, the code is written using a high-level, dataflow graphical programming
language (called ‘G Programming’ or ‘G Code’) by interconnecting graphical blocks that compiles
into machine code.

An example for front panel & block diagram is shown in Fig 1.4

Fig 1.4 a) Front Panel after writing G Code

Department of E&E Engineering 7


Measurement & Instrumentation Lab

Fig 1.4 b) Block diagram with G code

1.5 Adding a Control onto the Front Panel


Controls on the front panel simulate the input devices on a physical instrument and supply data to
the block diagram of the VI. Many physical instruments have knobs that can turn to change an input
value. If the Controls palette, shown in Fig 1.5, is not visible on the front panel, select
Window»Show Controls Palette to display it.

Fig 1.5 Controls Palette

The commonly used controls available on the front panel are:


1. Numeric Controls: Numeric Control, Slide with pointer, Slide, Dial, Knob and Color Box.
2. Buttons: Rocker, Slide Switch, Toggle Switch, Push Button and Text Buttons.
3. Text Controls: String Control, Text Ring, Menu Ring and File Path Control.

Department of E&E Engineering 8


Measurement & Instrumentation Lab

4. Numeric Indicators: Numeric Indicator, Progress Bar, Graduated Bar, Meter, Gauge, Tank
and Thermometer.
5. LED’s: Square and Round LED’s.
6. Text Indicators: String Indicator, Table and File Path Indicator.
7. Graph Indicators: Chart, Graph and XY Graph.

1.6 Writing code in the Block Diagram


The controls placed on the front panel appear as graphical block in the block diagram.
A knob placed in the front panel would look like a icon with a port pointing outwards
indicating, that the position of the knob on the front panel acts as an input to the -
code written in the block diagram.

Similarly, a Text indicator or an LED on the front panel would appear as an icon with a
input port. The ouput of the G-Code is written to the text indicator, LED, meter, graph
etc.

To write a G Code, wire up the terminals on the block diagram based on the control logic using the
wiring tool. A typical G code block diagram is as shown in Fig 1.4 b and its corresponding front panel
is shown in Fig 1.4a.

1.7 Running the VI


Running a VI executes the solution. Complete the following steps to run the VI.
1. Display the front panel by selecting Window» Show Front Panel or by clicking the front panel.
2. Click the Run button on the toolbar and the RUN button changes to darkened arrow
indicating the program is under execution. (The front panel or block diagram cannot be
edited while the VI runs.
3. Click the STOP button, shown at right, to stop the VI.

Note: Although the Abort Execution button looks like a stop button, the Abort Execution button
does not always properly close the VI. National Instruments recommends stopping the VIs using the
STOP button on the front panel. Use the Abort Execution button only when errors prevent
terminating the application using the STOP button.

Example 1:
1. Display the slope of the line given it`s co-ordinates (x1, y1) and (x2, y2). Given that
𝑦2 − 𝑦1
𝑠𝑙𝑜𝑝𝑒, 𝑚=
𝑥2 − 𝑥1

Sample Solution:

Department of E&E Engineering 9


Measurement & Instrumentation Lab

a. Invoke LabVIEW as described in section 1.2.


b. Open a project & save it using the steps mentioned in section 1.3.
c. Create a new VI observe the front panel & block diagram as shown in Fig 1.3.a & b.
d. In front panel on right click Controls Palette is displayed. Move the cursor over
Modern>>Numeric >>Numeric control icon as shown in Fig 1.6.

Fig 1.6: Numeric Controls in Front Panel

e. Click on Numeric Control and place the icon on front panel. This Numeric control acts as a
controlled input. As four numeric inputs are required in this example, place four inputs using
the numeric control on the front panel. Observe the changes in block diagram which is as shown
in Fig 1.7.

Fig 1.7: Numeric Controls on Front Panel & Block Diagram

Department of E&E Engineering 10


Measurement & Instrumentation Lab

f. The output of the slope calculation has to be displayed on the Front Panel. To do this, on the
front panel right click; in the control palette select Numeric Indicator from Modern>> Numeric.
The front panel and the block diagram is as shown in Fig 1.8.
g. The labels of control and the indicators can be suitably renamed by double clicking the label and
renaming with suitable names.

Fig 1.8: Numeric Controls& Indicator on Front Panel & Block Diagram

h. To calculate the slope of the line, operators like subtract and divide are to be included in the
block diagram. Right click in block diagram. In the Function Palette, move the cursor over
Mathematics>>Numeric and place two Subtract and 1 Divide blocks in the block diagram. The
respective block diagram is as shown in Fig 1.9.

Fig 1.9: Operators on Front Panel & Block Diagram

Department of E&E Engineering 11


Measurement & Instrumentation Lab

i. To connect the blocks, move the cursor (mouse pointer) over the Numeric Control in the block
diagram till the cursor changes its shape to a wiring spool as shown. Click and move the
cursor to the node of the other connecting block. The wired network is as shown in Fig 1.10.

Fig 1.10: Completed Code on Block Diagram

j. Enter the coordinates for the line in the numeric controls on the front panel. Click Run button
to run the VI. Note the value displayed in the Numeric Indicator in the Front Panel.

1.8 Loops in LabVIEW


Loops enable LabVIEW users to execute a sequence of instructions repeatedly with the conditions
specifying when the loop will stop. Each pass through the loop is called iterations. LabVIEW uses for
and while to control repetitive operations within a VI.

FOR loops:
A FOR loop executes a sub diagram for a set number of times. A FOR loop in LabVIEW is as shown
in Fig 1.11.

Fig 1.11 FOR Loop in LabVIEW

Department of E&E Engineering 12


Measurement & Instrumentation Lab

The value in the count terminal (an input terminal ), indicates the no. of times to repeat the sub
diagram. It is explicitly set by wiring a value from outside the loop to the left or top side of the count
terminal, or the count is set implicitly with auto-indexing. If the count is 0 or a negative number, the
loop does not execute and the outputs contain the default data for that data type.

The iteration terminal (an output terminal ), contains the number of completed iterations. The
iteration count always starts at zero.

1.9 While loop


A While Loop executes a sub-diagram until a condition occurs. It acts similar to a Do Loop or a
Repeat-Until Loop in text-based programming.

Example 2:
Develop suitable VI to plot a sine wave using elementary math function sine.

Sample Solution:

a. Invoke LabVIEW. In the block diagram window right click. Move the cursor over
Mathematics>>Elementary & special functions>>Trigonometric function>> sin. This is as
shown in Fig 1.12.

Fig 1.12 Selection of Elementary math function in block diagram

Department of E&E Engineering 13


Measurement & Instrumentation Lab

b. The input to the elementary SIN block is in radians. Hence the input angle needs to be converted
to radians. To do so, develop suitable logic in the block diagram using the pi, numeric constant
and Divide block available in Mathematics>>Numeric.
c. To generate a sine wave, this loop has to be executed continuously, for which while loop can be
used.
d. To use while loop, right click in block diagram, move the cursor over
Programming>>Structures>>while loop. The corresponding selection is as shown in Fig 1.13.
After selection drag over the available blocks in block diagram that are to be enclosed in the
loop.
e. The while loop has to be specified with one input i.e. the condition to stop execution of the loop.
This is specified by a red button located inside the while loop near the bottom right corner.

Fig1.13 Selection for while loop

f. Place chart on the front panel and wire the output of the SIN function to it. The completed VI is
as shown in Fig 1.14.

Department of E&E Engineering 14


Measurement & Instrumentation Lab

Fig1.14 Completed VI with while loop

g. Run the VI and observe the sine wave on the front panel. The output is as shown in Fig 1.15.

Fig 1.15 Generated sine wave

Week 1 Exercises:

1. Create a VI to convert the given temperature in degree Celsius to degree Fahrenheit [Given: (°C
x 1.8) + 32 = °F]
2 Create a VI to convert the given time in seconds to a combination of hours, minutes and seconds.
(Hint: Use the ‘Quotient & Remainder’ block from the Programming>>Numeric).
3 Develop a VI to generate half wave rectified sine wave.

Department of E&E Engineering 15


Measurement & Instrumentation Lab

Week 2: Shift Registers and Sub-VIs in LabVIEW


Objective: Familiarize programming with Shift Registers and Sub-VIs in LabVIEW

2.1 Shift Registers:


Shift registers ( ) are used to pass values from previous iterations through the loop to the
next iteration.
A shift register appears as a pair of terminals, directly opposite each other on the vertical sides of
the loop border. Shift Registers appearing in FOR and WHILE loops are as shown in Fig 2.1.

The terminal on the right side of the loop contains an up arrow and stores data on the completion
of an iteration. LabVIEW transfers the data connected to the right side of the register to the next
iteration. After the loop executes, the terminal on the right side of the loop returns the last value
stored in the shift register.

Fig 2.1(a) Shift Registers in FOR Loop Fig 2.1(b) Shift Registers in WHILE Loop

A shift register transfers any data type and automatically changes to the data type of the first object
wired to the shift register. The data wired to the terminals of each shift register must be of the same
type.

Initializing a shift register resets the value the shift register passes to the first iteration of the loop
when the VI runs. To initialize a shift register, wire a control or constant to the shift register terminal
on the left side of the loop, as shown in Fig.2.2

Fig.2.2 Initializing the shift registers

Department of E&E Engineering 16


Measurement & Instrumentation Lab

More than one shift register can be added to a loop. If the loop involves multiple operations that
use previous iteration values, then multiple shift registers can be used to store the data values from
those different processes in the structure, as shown in the Fig.2.3.

Fig.2.3 Multiple Shift Registers

2.2 Stacked Shift Registers:


Stacked shift registers allows data access from previous loop iterations. Stacked shift registers
remember values from multiple previous iterations and carry those values to the next iterations.
(To create a stacked shift register, right-click on the left shift register and select Add Element from
the shortcut menu).

Stacked shift registers can occur only on the left side of the loop because the right terminal transfers
the data generated only from the current iteration to the next iteration, as shown in the Fig.2.4.

Fig.2.4 Stacked shift registers

Example 1
Create a VI to find the sum of first five natural numbers using FOR loop and shift registers.

Department of E&E Engineering 17


Measurement & Instrumentation Lab

Sample solution:
a) Open a new VI and place a Numeric Indicator in the front panel. In the block diagram place
ADD and Increment block from Programming>>Numeric.
b) To use a FOR loop, right click on block diagram >Programming>>Structures >>For loop as
shown in Fig 2.5.

Fig.2.5 Selection of For loop.

c) A cursor appears on the block diagram. Click and drag the cursor over the blocks that are to
be included in the FOR loop. The FOR loop thus created is as shown in Fig2.6.

Fig.2.6 Creation of FOR loop

Department of E&E Engineering 18


Measurement & Instrumentation Lab

d) Create a constant and wire it to loop count terminal . Assign a value 5 to it.
e) To create a shift register place cursor on the left vertical border of for loop and select Add
shift register from the right click menu as shown in Fig 2.7.

Fig.2.7 Creating shift register

f) A down arrow and an up arrow appears on the sides of the FOR loop indicating the creation
of one shift register which is as shown in Fig.2.8.

Fig 2.8 Shift Register on FOR loop

Department of E&E Engineering 19


Measurement & Instrumentation Lab

g) Create a constant of initial value zero and connect it to the left shift register indicating that
the initial value of the iteration is zero. Also wire the blocks as shown in Fig.2.9.

Fig 2.9 Final layout on front panel and block diagram

h) Run the VI and observe the output on the front panel.

2.3 Sub VI’s


In LabVIEW a VI within another VI is called a subVI. To create a subVI, first build a VI with front
panel and block diagram. Then build the icon and the connector pane. Insert this VI into another
VI.

Example 2:
Create a subVI to determine the slope of the given whose co-ordinates are (X1, Y1) and (X2, Y2).

STEPS:

a. Create the front panel and block diagram for the VI by repeating the steps mentioned in
example 1.
b. Right hand top corner of every front panel has an icon as shown in Fig 2.10. The VI will be
represented by this icon whenever this VI is used as a subVI.

Department of E&E Engineering 20


Measurement & Instrumentation Lab

Icon

Fig 2.10 Front panel with the showing the connector pane
c. To use this VI as subVI, the inputs and the outputs of this VI have to be made accessible. In
order to do so, map the inputs and the outputs to a connector pane. To access the connector
pane, right click on the icon and select Show Connector. Select suitable connector block so
as to match with the number of inputs and outputs. This can be done by right clicking the
connector icon and moving the cursor over Patterns. This is as shown in Fig 2.10. The inputs
have to be mapped on the left half of the connector block and the outputs to the right half.
d. Move the cursor over the connector block. The cursor changes to wiring spool. Click on the
first terminal of the connector block and then click on the numeric indicator which is to be
mapped. After mapping the change in color of the connector block terminal can be
observed. This is as shown in Fig 2.11

Change in color

Fig 2.11 Front panel showing the connector block


e. Similarly map all the inputs and the outputs. After the mapping of inputs and outputs the
connector block would look as shown in Fig 2.12.

Department of E&E Engineering 21


Measurement & Instrumentation Lab

Fig 2.12 Front panel with the connector block


f. Save this VI.
g. Open a new VI. In the block diagram, right click and move the cursor over Select VI as shown
in Fig 2.13. Now the saved VI can be browsed from the stored location.

Fig 2.13 Selection of VI in block diagram


h. Select the particular VI. The VI would appear as an icon in the block diagram as shown in Fig
2.14. Move the cursor over the icon and notice the input and output nodes for the subVI.

Department of E&E Engineering 22


Measurement & Instrumentation Lab

Fig 2.14 Icon of subVI in block diagram

Week 2 Exercises:

1. Develop a VI to generate Fibonacci series whose length defined by the user. (Ex: if length is 7,
series is: 0 1 1 2 3 5 8)
2. Create a VI to find the factorial of the given using while loop and shift registers.
3. Create a VI to find the nCr and nPr of a given number using FOR Loop, given the value of n and r.
(use Sub VI from exercise 2 - factorial)

Department of E&E Engineering 23


Measurement & Instrumentation Lab

Week 3: CASE STRUCTURES in LabVIEW


Objective: Familiarize the usage of Case structures for programing in LabVIEW

A case structure executes one sub-diagram depending on the input value passed to it and is similar
to if… then… else statement in text-based programming language. A case structure has generally
two or more sub-diagrams (or cases). Only one case is executed by the structure depending upon
the input value.
A typical case structure in LabVIEW is as shown in Fig 3.1.

Input Case Selector

Fig 3.1 Case Structure

The Case structure comprises of two important parts:


a) The Case Selector at the top of the Case structure contains the name of the selector value
that corresponds to the Case in the center and decrement and increment arrows on each
side. Only one Case is visible at a time.
b) The INPUT terminal decides the case to be executed. The input to the Case structure may be
Boolean (True or False), String or Enumerated type data.

For the CASE structure shown in Fig 3.1, the TRUE or FALSE case is executed based on the Boolean
input.

Example 1:
Create a VI to monitor the temperature condition using the Case Structure. The VI should display
‘High’ if the input temperature exceeds 30 Degrees and ‘Low’ if the temperature is below 30.

Sample Solution:

a) Open a new VI and place a KNOB on the front panel and set its lower and higher limits as 0 and
50 and also place a TEXT INDICATOR to display the temperature condition.
b) On the Block Diagram, Right Click and select Case structure from Programming>> Structures>>
Case Structure as shown in Fig 3.2.

Department of E&E Engineering 24


Measurement & Instrumentation Lab

Fig 3.2 Selection of Case Structure


c) A cursor appears on the block diagram. Click and drag the cursor. A Case structure created in
the block Diagram is as shown in Fig 3.3.

Fig 3.3 A Case Structure on Block Diagram


d) Select ‘TRUE’ on the Case structure and complete the wiring on the block diagram with
Greater or Equal and String Indicator as shown in Fig 3.4. Also write ‘High’ in the String
Constant.

Department of E&E Engineering 25


Measurement & Instrumentation Lab

Fig 3.4 G-Code for TRUE Statement


e) Select ‘FALSE’ on the Case structure and complete the wiring on the block diagram with String
Constant as Low’ as shown in Fig 3.5.

Fig 3.5 G-Code for FALSE Statement


f) RUN the VI and observe the changes in the “Temperature Condition’ Text Indicator when the
KNOB is rotated.

Department of E&E Engineering 26


Measurement & Instrumentation Lab

Exercise:

1. Develop a VI to realize a DC Voltmeter to display the following as per its conditions

Voltage (V) Text Display Indicator color


0 to 0.5 very Low blue
> 0.5 to 1.0 low green
> 1.0 to 2.0 mid-range yellow
>2.0 high red

2. Create a VI to develop a simple calculator to perform basic arithmetic operations (add, subtract,
multiply, square, square root, divide) and display result at same indicator for any two user input
values. Display error pop up message if divided by zero

Mini Project Review 1: Synopsis Submission

Problem statement for mini project should be in line with the following statement:

“Design system level solutions or processes for engineering problems that meet the specified needs
with appropriate consideration for public health and safety, and/or cultural, societal, and/or
environmental considerations with an understanding of the limitations.”

A one-sheet (double side) synopsis to be submitted with following contents:


• Title
• Team – students name and Reg no
• Objectives
• Flowchart showing methodology.
• Justification as per problem statement (public health and safety, and cultural, societal, and
environmental considerations)
• Hardware components and tentative Bill of materials
• Timeline : weekly work progress timeline

Week Work details


Week 1 Conducted literature survey and selection of topic
Week 2 ….
…. ….
Week 10 Demonstration and report submission

Department of E&E Engineering 27


Measurement & Instrumentation Lab

Department of E&E Engineering 28


Measurement & Instrumentation Lab

Week 4: EXPRESS VI, signal processing and storage in LabVIEW


Objective: Familiarize programming using toolboxes Express VI, signal processing and storage in
LabVIEW

EXPRESS VI’s are interactive VI’s with configurable dialogue page. LabVIEW uses colored icons to
distinguish between EXPRESS VIs, VIs and functions on the block diagram. By default, icons for
EXPRESS VIs appear on the block diagram as expandable nodes with icons surrounded by a blue
field whereas icons for VIs have white background and icons for functions have pale yellow
backgrounds.

Example 1
Generate a sine wave of 50 Hz and 230 V (RMS) using EXPRESS VI.

Sample solution:
a) Open a new VI. Right click on the block diagram, scroll the cursor over
Express>>Input>>Simulate signal which is as shown in Fig.4.1

Fig.4.1 Selection of Express VI

b) On selecting Simulate signal, a Configure Simulate Signal window is displayed on the screen
which is as shown in Fig.4.2.

Department of E&E Engineering 29


Measurement & Instrumentation Lab

Fig.4.2 Configure Simulate Signal window


c) From this window one can change the following parameters with respect to a signal:
• Signal type: Sine, Square, Triangular, Sawtooth & DC
• Frequency in Hz
• Phase in degrees
• Amplitude and Offset
• Samples to be generated per second
• Number of samples
d) Select Sine in Signal type and enter frequency (given as 50 Hz) and amplitude. Then click OK.
The simulate signal block would appear on the block diagram as shown in Fig.4.3.

Fig.4.3 Simulate Signal Block

Department of E&E Engineering 30


Measurement & Instrumentation Lab

e) Place a graph indicator on the front panel and wire the same to the Sine port of the simulate
signal block. This is as shown in Fig 4.4

Fig.4.4 Final layout on Front panel and Block Diagram

f) Run the VI and observe the output on graph indicator as shown in Fig 4.5.
g) Include WHILE loop and observe the difference.

Fig 4.5 Front Panel and Block Diagram with While loop

Department of E&E Engineering 31


Measurement & Instrumentation Lab

EXPRESS VI’s for SIGNAL ANALYSIS


LabVIEW™ provides following block for Signal Analysis,
1. Spectral Measurement- To determine RMS, Peak & Power Spectral density of a signal.
2. Distortion Measurement- To determine Total THD (Total Harmonic Distortion) and Specific
Harmonic Levels.
3. Tone Measurement- To determine Amplitude, Frequency and Phase of a Signal, search signals
of specific frequency.
4. Amplitude & Level Measurements- To determine Maximum Peak, Minimum Peak, Peak to Peak,
Cycle Average and Cycle RMS.
5. Timing & Transition Measurements- To determine Frequency, Period, Pulse Duration, Duty
Cycle, Pre-shoot, Overshoot and slew rate.
6. Filter-Low pass, High Pass, Band Pass, Band Stop, Smoothing.

Example 2:
Generate a Sine wave of 325 V Amplitude, 50 Hz and determine the RMS value, Peak to peak value,
Maximum Peak and Minimum Peak value.
Sample Solution:
a) Create a New VI and Place Simulate Signal block in the Block Diagram (Refer Example 5) and
configure it to generate a Sine signal of 50 Hz with amplitude of 325.
b) Right click in the block diagram and move cursor over Express >> Signal Analysis and select
Amplitude &Level Measurements as shown in Fig 4.6.

Fig 4.6 Selection of Signal Analysis Blocks

Department of E&E Engineering 32


Measurement & Instrumentation Lab

c) The selection of Amplitude & Measurement block opens a configure Amplitude and Level
Measurements dialog box as shown in Fig 4.7.

Fig 4.7 Configuring ‘Amplitude & Measurement’ Block


d) Tick the following: RMS, Peak to Peak and Maximum Peak and Click OK.
e) The “Amplitude and Measurements Block” with Input: Signals and Outputs as “Peak to Peak”.
“Positive Peak” and “RMS Value” is created as shown in Fig 4.8.

Fig 4.8 ‘Amplitude & Measurement’ Block-Configured

Department of E&E Engineering 33


Measurement & Instrumentation Lab

f) Place three Numeric Indicators and one Graph Indicator on the Front Panel and wire them as
shown in the Fig 4.9

Fig 4.9 VI to Measure RMS and Pk-Pk Value

g) Run the code to observe the output as shown in Fig 4.10.

Fig 4.10 Output of ‘Amplitude and Measurement’ Block

Department of E&E Engineering 34


Measurement & Instrumentation Lab

STORING MEASUREMENT DATA


The measurement data obtained can be stored in a file for future engineering analysis. LabVIEW™
supports the following file formats for storing data.
1. Text (ASCII) File: To be used with applications if disk space and file I/O speed are not crucial,
if numeric precision is not important and if random access reads and writes are not
performed. LabVIEW™ stores the Text files with ‘.LVM’ extension.
2. Binary File: They are most compact and fastest formats for storing data. They are used to
save numeric data and in applications that involve accessing numbers randomly in the file.
LabVIEW™ stores the Text files with ‘.TDMS’ or ‘.TDM’ extensions.

Example 3:
Generate a sine wave and store the output in a TDMS file with time stamp.
Sample Solution:
a) Create a New VI and Place Simulate Signal block in the Block Diagram (Refer Example 5) and
configure it to generate a Sine signal of 60z with amplitude of 200.
b) Right Click on Block Diagram and move the cursor over Express>> Output>> Write to
Measurement File. This is as shown in Fig 4.11.

Fig 4.11 Selection of Write to Measurement File

c) Click and select Write Meas File icon and place the Express VI on the block diagram. A ‘Configure
Write to Measurement File’ dialog box opens up as shown in Fig 4.12.

Department of E&E Engineering 35


Measurement & Instrumentation Lab

Fig 4.12 Configuring ‘Write to Measurement File’

d) Configure the following:


1. File Name: Use the ‘Open Folder’ option and select the path to store the measurement file.
Enter the file name followed by an extension.lvm (for Selection of Text in File Format),. TDMS (for
Selection of Binary File).
2. Segment Headers: Select ‘One header Only’.
3. X Value (Time) Columns: Select ‘One Column Only’.
4. Click on ‘OK’ to complete.
e) Wire the Simulate signal block & Write to Measurement File block and enclose these two blocks
in a while loop ( for continuous execution of code). Also place a Graph Indicator on the Front
Panel and complete wiring the blocks. This is as shown in Fig 4.12.
f) Run the code for 2 seconds.

Department of E&E Engineering 36


Measurement & Instrumentation Lab

Fig 4.13 Completed VI


g) Using Windows Explorer, locate the .TDMS file and open the same using Microsoft Excel. (Use
Excel Importer for extracting the data from the TDMS file).
h) The measurement data stored in the TDMS file is as shown in Fig 4.14.

Fig 4.14 Measurement Data

Department of E&E Engineering 37


Measurement & Instrumentation Lab

i) The measurement data stored has three components: (1) Column 1 – With Date and Time of
Signal Generation (2) Column 2 – Time elapsed after starting the simulation (3) Column 3- value
of the signal.

Exercise
1. Create a VI to develop a function generator. (Hint: Use Simulate signal block and Case
structure.)
2. Determine the THD (Total Harmonic Distortion), RMS value, Peak to Peak value for the
output of a Half wave rectifier connected to AC source of 230 V, 50 Hz. Also, determine the
amplitudes of all the harmonic frequencies. (Hint: Use Distortion block from
Express>>Signal Analysis)
3. A sinusoidal signal of v(t)=200 Sin(314t) is applied to a load of 20±θ. Determine the active
power, reactive power and apparent power supplied to the load for different value of ‘θ’.
(Hint: Generate two sinusoidal signals, one for voltage and the other for current
corresponding to the load).

Department of E&E Engineering 38


Measurement & Instrumentation Lab

Week 5: Interfacing Arduino to LabVIEW and realization of measuring instruments: DC


Voltmeter, Light Intensity level meter
Objective: Interface Arduino as a data acquisition device and realize measuring instruments in LabVIEW

5.1 Interfacing Arduino to LabVIEW Steps


1. Connect Arduino board to PC via USB port using the connection cable.
2. Verify the COM Port Number at: device manager > Ports > Arduino Uno as shown in Fig 5.1

Fig 5.1 COM port for interfacing Ardiuno

3. Open Arduino application, check COM port (tools→ port), browse and open the program
named LIFA_BASE
from the directory: C:\Program Files\National Instruments\LabVIEW 2015\vi.lib\LabVIEW
Interface for Arduino\Firmware\LIFA_Base

Fig 5.2 Upload interface program to Arduino

Department of E&E Engineering 39


Measurement & Instrumentation Lab

4. Verify the program, upload the LIFA_BASE program to Arduino board, close Arduino
software
5. Open LabVIEW > blank VI > functions pallet > Arduino, to start programming as shown in
Fig 5.3

Fig 5.3 Arduino toolbox in LabVIEW

Example 1: Develop a LabVIEW VI to acquire voltage signals from a battery pack connected via
Arduino microcontroller board.

Components:

Sl. No. Apparatus Type Quantity


1 Arduino UNO 1

3 Digital multimeter (DMM) 1

4 Battery pack DC 1

5 Connecting wires - -

Department of E&E Engineering 40


Measurement & Instrumentation Lab

Procedure:

1. Configure Arduino Uno to interface with LabVIEW


2. Develop VI in block diagram as shown in Fig 5.4
1) Control to initialize connection to Arduino – to select appropriate com port
2) Init (functions > Arduino): helps initialize Arduino connection to interface with
LabVIEW
3) Analog Input pin select control block – select as per hardware connection
4) Analog Read pin (functions > Arduino > low level) used to read the analog data
5) Indicator to display the voltage read
6) Close (functions > Arduino) : helps close Arduino connection to with LabVIEW
7) Simple Error Handler (functions > dialog and user interface): indicates error if any
8) Stop control for while loop

Fig 5.4 Block diagram of the VI developed

3. Connection diagram of hardware is shown in Fig 5.5

Fig 5.5 Arduino connection to Battery pack

4. Run the LabVIEW VI to acquire the voltage signals and press STOP in front panel to terminate
loop of program. Sample solution is shown in Fig 5.6

Department of E&E Engineering 41


Measurement & Instrumentation Lab

Fig 5.6 Sample solution of developed VI

Results: Compare three measurements as per LabVIEW and Verify the same using DMM.

Sl. No. DC Voltage from DMM DC Voltage In LabVIEW

The Average Percentage Error:

Inference:

Example 2: Develop a LabVIEW VI to identify bright/low levels of light using a light dependent
resistor as sensor and Arduino to interface with LabVIEW. Also, If intensity is less than 50% turn
ON an LED and if otherwise turn OFF the LED

Procedure:

1. Configure Arduino Uno to interface with LabVIEW


2. Develop VI in block diagram as shown in Fig 5.7
1) Arduino Init (functions > Arduino)
2) Photocell Read (functions > Arduino > sensors)
3) intensity less than 50% logic
4) digital write to hardware logic
5) LED indicator
6) Digital Write Pin (functions > Arduino > low level)
7) Arduino Close (functions > Arduino)
8) Stop control for while loop

Department of E&E Engineering 42


Measurement & Instrumentation Lab

3. Connect the hardware connections as shown in Fig. 5.8

Fig 5.7 Block diagram of the VI developed

Fig 5.8 Circuit connection diagram

4. Sample output for both cases is noted as shown in Fig 5.9

Fig 5.9 Sample solution of developed VI

Inference:

Department of E&E Engineering 43


Measurement & Instrumentation Lab

Exercise:

1. Develop a LabVIEW VI to measure the room temperature using LM35 temperature sensor
connected via Arduino microcontroller board.
2. Develop a LabVIEW VI to identify three levels of light using a light dependent resistor as
sensor and Arduino to interface with LabVIEW. Also, If intensity is less than 25% turn ON
two LEDs, and if the intensity is less than 50% turn ON only one LED of the two LEDs, and if
otherwise turn OFF both LEDs.
3. Develop a VI to verify the correctness of a 2-number’s math operation and indicate correct
answer with turning ON LED1 and OFF LED2 and indicate wrong answer with turning OFF
LED1 and ON LED2 connected via Arduino to LabVIEW. (user must enter 2 numbers and
select a math operation (add, subtract, multiply, divide), and enter the expected answer in
front panel)

Department of E&E Engineering 44


Measurement & Instrumentation Lab

Week 6: Signal conditioning circuit - Instrumentation Amplifier

Hardware TI ASLKv2010 Starter Kit: An Overview

Texas Instruments’ ASLKv2010 starter kit (refer Fig 6.1) comes with 4 general purpose Op-amps
(TL082) & 3 wide bandwidth precision analog multipliers (MPY634) from Texas Instruments. There
is also a provision to include a 12 bit parallel-input multiplying DAC (DAC7821). A bread board is
provided for general purpose prototyping and can be used to carry out mini projects.

±12𝑉

Fig 6.1 ASLKV 2010 Starter Kit

The kit has a provision to connect ±12𝑉 DC power supplies. The kit comes with necessary short
and long connectors, as well as connectors for power supplies. The power supply connections are
made on ASLKv2010 Starter Kit are shown in Fig 2.1. The ±12𝑉 supplies are connected internally
to all the ICs that require ±12𝑉 supplies, namely, the Op-amps and the multipliers. Refer to
Appendix A of Analog system lab manual for the details of the integrated circuits that are included
in ASLKv2010 Starter kit. Refer to Appendix D for additional details of ASLKv2010 Starter Kit.

Precautions: If the experiment requires only of the 2 op-amps in an IC, do not leave the inputs and
output of the unused op-amp open. Instead, place the unused op-amp in unity-gain mode and
ground the input.

Objective: To design an instrumentation amplifier & find its CMRR.

Design specifications:

Department of E&E Engineering 45


Measurement & Instrumentation Lab

Configuration: Classical 3 Op-amp configuration


Differential gain, 𝐴𝑑 = 10

Components required:

Sl. No. Apparatus Type Quantity


1 ASLKv2010 starter Kit

2 Signal generator

3 Dual power supply

4 Digital Multimeter (DMM)

4 Digital Storage Oscilloscope (DSO)

5 Connecting wires

Design:

1. The o/p voltage, 𝑉0 of the instrumentation amplifier is given by


2𝑅1 𝑅3
𝑉0 = [1 + ] (𝑉 − 𝑉1 )
𝑅𝑔𝑎𝑖𝑛 𝑅2 2

V2 – V1 = The differential input voltage to the amplifier.


Compute the value of Rgain by considering R1, R2 & R3 as the fixed resistors available on the
kit.

2. The common-mode rejection ratio is given by

𝐴𝑑
𝐶𝑀𝑅𝑅 = 20𝑙𝑜𝑔
𝐴𝑐

where 𝐴𝑑 - differential mode gain, 𝐴𝑐 -common mode gain


The circuit connection is shown in Fig 6.2. The circuit needs to be developed using TI ASLKv starter
kit. Verify the correctness of the circuit and then proceed with the experimentation procedure.

Department of E&E Engineering 46


Measurement & Instrumentation Lab

Fig 6.2 Instrumentation Amplifier

𝑹𝟏 = 𝑹𝟐 = 𝟏𝒌Ω, 𝑹𝟑 = 𝟐. 𝟐𝒌Ω. 𝑹𝒈𝒂𝒊𝒏 𝒕𝒐 𝒃𝒆 𝒔𝒆𝒕 𝒖𝒔𝒊𝒏𝒈 𝒂𝒏 𝒆𝒙𝒕𝒆𝒓𝒏𝒂𝒍 𝟏𝒌 𝑷𝑶𝑻.

Procedure:
[For pin diagram of op-amp IC TL082, refer page 88 and for connection diagrams, refer page 107 –
‘Appendix D’ of Analog System Lab manual. Use 3 Op-amps to realize the above instrumentation
amplifier and provide ±12𝑉 DC supply to the board].

To determine the differential gain (Ad):

1. Using a function generator, apply a sine wave of 1 V (peak-to-peak) between the input
terminals 𝑉1 and 𝑉2.
2. Measure the output voltage (peak-to-peak), 𝑉0 using the DSO.
3. Compute the differential-mode voltage gain and determine CMRR for the instrumentation
amplifier.
To determine the common-mode gain (AC):

1. Interconnect the input terminals, 𝑉1 and 𝑉2. Using a dual-power supply, apply a common
voltage of +5 V DC between V1 (or V2) and ground terminals.
2. Measure the output voltage, 𝑉0 using the DMM.
3. The common-mode voltage gain is the ratio of Vo and Vin (= +5 V).

Results:

Inferences:

Department of E&E Engineering 47


Measurement & Instrumentation Lab

Week 7: Signal conditioning circuit - Realization of Analog Filter


Objective: To design a Butterworth low pass filter and plot its frequency response.

Design specifications:
Filter type : Active Low Pass Cut-off freq. : 10 kHz
Response type : Butterworth Gain : Unity
Order :2

Components Required:

Sl.
Apparatus Type Quantity
No.
1 ASLKv2010 starter Kit

2 Signal generator

3 Dual power supply

4 Digital Storage Oscilloscope (DSO)

5 Connecting wires

Design of 2nd Order Butterworth Filter:


The normalized transfer function for nth order Low Pass Butterworth filter is as
shown in Table-1

Order ‘n’ Normalized transfer function


1 𝑠+1
2 𝒔𝟐 + 𝟏. 𝟒𝟏𝟒𝟐𝒔 + 𝟏
Table1: Transfer function for Low Pass Butterworth Filter

A Sallen-Key Circuit as shown in Fig 2.3 is used to implement the 2𝑛𝑑 order Butterworth Low pass
filter. For ease of design, we assume 𝑅1 = 𝑅2 = 𝑅. The gain of this stage is unity.

The circuit connection diagram is as shown in Fig 7.1. The circuit needs to be developed using TI
ASLKv starter kit. Verify the correctness of the circuit and then proceed with the experimentation
procedure.

Department of E&E Engineering 48


Measurement & Instrumentation Lab

Fig 7.1 Sallen-Key unity gain LPF

⍵20
𝐻(𝑠) = ⍵0
(1)
(𝑠 2 + 𝑠 + ⍵20 )
𝑄

1
𝐻(𝑠) = (2)
1
(𝑠 2 + 𝑄 𝑠 + 1)
Equation (1) shows the transfer function of a second order filter circuit where Q is the quality factor
(0.7071 for 2nd order) and ⍵0 is the cut-off frequency in radians/second. Equation (2) shows the
transfer function in its normalized form.

The value of capacitor C1 and C2 can be determined by using the following equations:

1 (3)
𝐶1 =
2𝑅𝑄⍵0

2𝑄 (4)
𝐶2 =
𝑅⍵0

We have cut-off frequency, 𝑓0 = 10𝐾ℎ𝑧 , let 𝐶1 = 0.1µ𝐹 now using Eqn 3 we get

1
𝑅1 = 𝑅2 = 𝑅 = = Ω
2𝑄𝐶1 ⍵0

Select R = 147Ω standard value.


Using equation (4) we have, Q= 0.7071

2𝑄
𝐶2 = = µ𝐹
𝑅⍵0
Select 𝑪𝟐 = 𝟎. 𝟏µ𝑭 standard value.

Department of E&E Engineering 49


Measurement & Instrumentation Lab

Procedure:

1. Develop the circuit as shown in Fig 7.1


2. Using a function generator, apply a voltage (sine wave) with 2 V_pp between Vin and
ground.
3. Maintaining the magnitude of the input voltage constant, vary the frequency of the input
signal from 0 to 20 kHz. Note down the output voltage using DSO.
4. Tabulate the parameters required (freq & gain) for plotting the frequency response.
5. Plot the response on a semi log sheet.
6. From the frequency plot see if the pass band is maximally flat, and determine graphically
the fall-off rate & also the cut-off frequency.

Results/Observation:
2nd Order Butterworth filter
Input voltage, Vi (P-P) = V

Frequency (kHz) Output Voltage (P-P) Gain = Vo(P-P)/Vi(P-P)

… … …
Inference:

Reference:

1. Application note 779. A basic introduction to filters – Texas Instruments


2. Application report SLOA093. Filter design in 30 seconds.

Mini Project Review 2: one sheet report with following details


1. Title
2. Name and Register number of Team
3. Progress: brief of work done towards achieving each objective, partial results if any
4. Challenges faced in the project.
5. Timeline
Week Work details Remarks
Week 1 Conducted literature survey completed
and selection of topic
… …. ongoing
Week 10 Demonstration and report ….
submission

Department of E&E Engineering 50


Measurement & Instrumentation Lab

Week 8: Realization of Digital Meters 1


8.1 INTRODUCTION TO MAX
The Measurement and Automation eXplorer is a configuration wizard with many useful
capabilities. MAX can be used to configure a variety of National Instruments hardware and
software. MAX can be used to add new channels, interfaces, virtual instruments, and execute
system diagnostics. Using MAX you may also view devices and instruments that are connected to
your computer.

8.2 NI USB-6008/6001
The NI USB-6008/6001 is a multifunction I/O device that provides connection to eight single-ended
analog input (AI) channels, two analog output (AO) channels, 12 digital input/output (DIO)
channels, and a 32-bit counter with a full-speed USB interface.

8.3 Follow the following steps to configure the device using NI-MAX (Measurement and
Automation Explorer)

1 Invoke MAX by clicking the following link START>>All Programs >>National Instruments>>
Measurement and Automation Explorer (NI-MAX)
2 The MAX loads and the following screen shown in Fig 8.1 is displayed. On the left hand side of
MAX, an explorer displays the list of physical and virtual devices connected to the host
computer or PC. Help menus are displayed on the right hand side of MAX.

Fig 8.1 Measurement & Automation Explorer (MAX)

3 On the explorer expand ‘Devices and Interfaces’. A list of devices connected to the PC (host)
are displayed. Identify if ‘NI USB-6008/6001’ is listed. This is as shown in Fig 8.2. If the device is
not listed then press <F5> to refresh the view.

Department of E&E Engineering 51


Measurement & Instrumentation Lab

4 Right click on the device ‘NI USB-6008/6001’ and Select ‘Test Panels’ on RH side of the explorer.
This is as shown in Fig 8.2.

Fig 8.2 Selection of active device and then the ‘Test Panels’

5 Selection of ‘Test Panels’ displays the following dialog box shown in Fig 8.3.

Department of E&E Engineering 52


Measurement & Instrumentation Lab

Fig 8.3 ‘Test Panels’ Dialog Box

Check the following selections before starting the Test.

Tag Name Tag Value Remarks

Channel Dev3/AI0 Selection of device name i.e device name of NI


Name USB-6008/6001 followed by the analog channel to
be tested.

Mode Continuous On Demand Acquire one sample.


Finite — Acquire n samples, where n is


defined by

Samples to Read.

Continuous Acquire samples continuously


— until you click Stop.

Input Differential Differential The measurement is made with


Configuration — respect to a floating ground.

RSE — Referenced Single Ended. The


measurement is made with
respect to the ground, typically
the AIGND terminal on the device,
which is directly connected to the
measurement system ground.

NRSE — Non Referenced Single Ended.


The measurement is made with
respect to a single-node analog
input sense.

Max Input 10
Maximum value of transducer output.
Limit

Min Input -10


Minimum value of transducer output.
Limit

Department of E&E Engineering 53


Measurement & Instrumentation Lab

6 Click on ‘START’ to test the NI USB-6008/6001. The test result displayed is as shown in Fig 8.4.
7 Click on ‘STOP’ to terminate the test on channel AI0. And close the Dialog Box.

Fig 8.4 Test Result on Channel 1

8 Right click on the device and select ‘Reset Device’ to reset the device to its default state. This is as shown
in Fig 8.5. A Confirmation dialog box appears indicating the completion of device reset. Click ‘OK’ and
Continue. The device NI USB-6008/6001 is now ready to be used in LabVIEWTM. Close MAX after test
and reset are complete.

Department of E&E Engineering 54


Measurement & Instrumentation Lab

Fig 8.5 Reseting the Device State

Example: 1. Realization of DC Voltmeter

Aim: To Realize a DC Voltmeter using NI USB-6008/6001 and battery pack

1 Using MAX, detect the device NI-USB 6001. Refer to ‘MAX and NI USB-6008/6001 Setup’ for connection
of NI USB-6008/6001 and its testing.
2 Invoke LabVIEWTM and create a new project. Also create a new VI and rename it as ‘DC Voltmeter’.
3 On the block diagram, right click and select Express>>Input>> DAQ Assistant as shown in Fig 8.6.

Fig 8.6 Selection of DAQ Assistant in Express

4 Place the ‘DAQ Assistant’ express VI on the Block Diagram. A configuration popup box appears as shown
in Fig 8.7. The left-hand side of the configuration dialog displays help on the DAQ assistant menus. The
right side of the configuration box provides has two selections,
4.1 Acquire Signals – Provides a channel to acquire data from analog inputs like Voltage, current,
temperature etc., Digital inputs like line and port and counters.
4.2 Generate Signals – Provides access to write or output an analog voltage or current signal to
an actuator and digital outputs to a counter etc.

Department of E&E Engineering 55


Measurement & Instrumentation Lab

Fig 8.7 DAQ Assistant Configuation Box

5 Expand ‘Acquire Signals’ and Analog Input. Select ‘Voltage Input’. This is as shown in Fig 8.8.

Fig 8.8 Selection of Voltage Input

6 Selecting ‘Voltage Input’ opens a popup box as shown in Fig 8.9.

Department of E&E Engineering 56


Measurement & Instrumentation Lab

Fig 8.9 Devices connected to PC

7 Locate the device NI USB-6008/6001 in the tab ‘Physical’. And expand the selection. The channels
available on the NI USB-6008/6001 are displayed in a list. The list contains analog channels from AI0
through AI7. Select the channel to which the analog input (i.e the output of battery pack) is connected,
Eg. AI0. The selection is as shown in Fig 8.10.

Fig 8.10 Selection of Analog Channels

8 Click on ‘FINISH’. A popup ‘DAQ Assistant’ is displayed on the screen as shown in Fig 8.11.

Department of E&E Engineering 57


Measurement & Instrumentation Lab

Fig 8.11 DAQ Assistant Dialog Box

9 The ‘DAQ Assistant’ has two tabs, ‘Express Task’ and ‘Connection Diagram’. Select the “Express Task’
tab and check the settings in the ‘Configuration’ tab as per the table below.
Tag Name Tag Value Remarks

Channel Settings

Voltage Input Max: 5/10V Max: The maximum input voltage to NI


Setup> Settings USB-6008/6001.
Min: -5/-10V
Min: The minimum input voltage to NI
Scaled Units:
USB-6008/6001.
Volts

Terminal Differential Differential The measurement is made with


Configuration respect to a floating ground.

RSE Referenced Single Ended. The


measurement is made with respect
to the ground, typically the AIGND
terminal on the device, which is
directly connected to the
measurement system ground.

Custom Scaling <No Scale>

Tag Name Tag Value Remarks

Timing Settings

Department of E&E Engineering 58


Measurement & Instrumentation Lab

Acquisition Continuous 1 Sample (On Specifies that the task acquire


Mode Demand) or generate one sample.

1 Sample (HW Specifies that the task acquire or


Timed) generate one sample on an edge
of a hardware clock. Note:
LabVIEW Signal Express does not
support this mode.

N Samples Specifies that the task acquire


or generate a finite number of
samples, specified by Samples To
Read/Write.
Continuous Specifies that the task acquire
or generate data until stopped.
Continuous Specifies that the pulse
Pulses (HW characteristics—the high time
Timed Updates) and the low time—are updated
with each rising or falling
sample clock edge. A new high
and low time pair must be
written between each edge of
the sample clock.
1 Pulse specifies that the task generate
one pulse
N Pulses Specifies that the task
generate a finite number of
pulses, specified by Samples to
Write.
Continuous Specifies that the task
Pulses generate pulses until stopped.

Sample to Read 1k Specifies the number of samples to read when N


Samples selected and specifies the buffer size when
Continuous is selected.

Rate 1k Rate (Hz)


Specifies the sampling rate in
Hertz.
Sample/Update Period
(s)
specifies the sample period in
seconds

10 To log the acquired data in a TDMS file, select the Logging tab and tick the ‘Enable TDMS
logging’ check box and select the path for storing the TDMS file as shown in Fig 8.12.

Department of E&E Engineering 59


Measurement & Instrumentation Lab

Fig 8.12 Selection for Data Logging

11 Select the ‘Connection Diagram’ tab to see the connections for analog voltage input (AI0). The
connection diagram for channel AI0 is as shown in Fig 8.13..

Fig 8.13 Connection Diagram for Analog Input Channel

12 Click ‘OK’ to complete the ‘DAQ Assistant’ configuration. The ‘DAQ Assistant’ appears on the
block diagram as shown in Fig 8.14. The values of input voltage are available in the data.

Department of E&E Engineering 60


Measurement & Instrumentation Lab

Fig 8.14 DAQ Assistant after configuration

13 Right click on the data port of DAQ Assistant and select ‘Create Numeric Indicator. Rename the
indicator Label as ‘VOLTAGE’. Also place a while loop with a STOP button to complete the DC
Voltmeter. This is as shown in Fig 8.15.

Fig 8.15 DC Voltmeter VI

14 Connect the battery pack to terminal 2 & 3 of NI USB-6008/6001. Vary the potentiometer on
the battery pack and observe the voltage reading on the screen. Verify the same with a Digital
Voltmeter.

Department of E&E Engineering 61


Measurement & Instrumentation Lab

Results and Observations:

Input DC Voltage measured DC Voltage displayed on


Sl. No.
from DMM LCD

Accuracy of the Instrument =

Precision of the Instrument =

Inference:

Exercise 1. Realization of Temperature monitor System


Objective: Develop a Temperature monitor system and realize a Room temperature monitor using
LM35 sensor to measure and display the room temperature on the front panel of LabView using
NI DAQ 6001

Connection Diagram:

Fig 8.16 Connection diagram for Temperature monitor system

Procedure:

1. Connect and configure NI USB-6001 to the PC. (Refer to ‘MAX and NI USB-6001’ setup and
configuration of ‘DAQ Assistant’).
2. Connect the sensor pins to appropriate analog input/output channels of NI DAQ as shown in
Fig 8.16.
3. Configure LabVIEW to generate require supply voltage as shown in Fig. 8.17
4. Develop VI to display the room temperature from the acquired signal from the LM35 sensor.

Department of E&E Engineering 62


Measurement & Instrumentation Lab

Fig 8.17 Analog output selection in DAQ assistant


LM 35 Sensor Details:

Features:

 Calibrated directly in Celsius (Centigrade)


 Linear + 10.0 mV/°C scale factor
 0.5°C accuracy (at +25°C)
 Rated for full -55 to +150°C range
 Operates from 4 to 30 volts
 Less than 60 A current drain
 Low self-heating, 0.08°C in still air
 Low impedance output, 0.1 W for 1 mA load

Results and Inferences:

Department of E&E Engineering 63


Measurement & Instrumentation Lab

Exercise 2. Realization of Power Measurement System


Objective:

1. To observe the load voltage and current of a single-phase AC controller supplying lamp
load using LabVIEWTM
2. To compare the measurements of Active power, Reactive Power, Apparent power and
Power factor for a. Incandescent bulb

Connection Diagram:

Fig 8.18 Connection Diagram for power measurement system


Procedure:

1. Connect and configure NI USB-6001 to the PC. (Refer to ‘MAX and NI USB-6001’ setup and
configuration of ‘DAQ Assistant’).
2. Connect single lamp load to the power measurement kit.
3. Connect the current and voltage sensor output to the analog input channels of NI DAQ.
4. Configure LabVIEW to select multiple channel data acquisition using NI DAQ assistant, and
compute appropriate multiplication factors to the sensors
5. Develop VI to determine Active power, Reactive power, Apparent power and power factor.
(Hint: To average of instantaneous values of period use of Amplitude and level measurements > cycle Average)

Department of E&E Engineering 64


Measurement & Instrumentation Lab

Theoretical calculations:

Apparent power = 𝑉𝑅𝑀𝑆 × 𝐼𝑅𝑀𝑆

Active power = 𝑉𝑐𝑦𝑐𝑙𝑒 𝑎𝑣𝑔 × 𝐼𝑐𝑦𝑐𝑙𝑒 𝑎𝑣𝑔

Reactive power = √(Apparent power)2 − (Active power)2

Active power
Power factor =
Apparent power

Results and Inferences:

A Sample expected front panel for a 200W Incandescent bulb load is shown in Fig 8.19

Fig 8.19 VI for power measurement system

Department of E&E Engineering 65


Measurement & Instrumentation Lab

Week 9: Realization of Digital Meters 2 - Power Spectrum Analyzer


Objective:

1. To observe the load voltage of a single-phase AC controller supplying lamp load using
LabVIEWTM and to determine the delay angle for various lamp brightness.
2. To observe the harmonic spectra and to calculate the THD (Total Harmonic Distortion) for
various lamp brightness.
3. To analyze the variation in THD and dominant harmonics for various delay angles.
Connection Diagram:

Fig 9.1 Spectrum Analyzer Circuit

Procedure:

1. Connect and configure NI USB-6008/6001 to the PC. (Refer to ‘MAX and NI USB-6008/6001’
setup and configuration of ‘DAQ Assistant’).
2. Write a suitable G Code to plot the load voltage, harmonic spectra and to display the load
voltage, THD and dominant harmonic components.
3. Connect the ‘AI0+‘and ‘AI0-’ terminals of NI USB-6008/6001 to the ‘V+’ and ‘V-‘ terminals of
the ‘AC Voltage controller Module’. These terminals are the output of the ‘LEM Voltage sensor’
connected across the load.
4. Connect the Lamp to the module (The lamp acts as a load). And module to the single phase
supply.
5. Switch ON the module, vary the dimmer and observe the change in the brightness of the lamp.
6. Observe the load voltage waveform and Load Voltage-Frequency spectra for different
brightness.
7. Measure the delay angle, THD and dominant harmonics when the dimmer is varied from low
to maximum brightness in definite steps.

Department of E&E Engineering 66


Measurement & Instrumentation Lab

Theoretical calculations:

𝛼 Sin 2α
Vload RMS = Vsupply RMS (√1 − + )
𝜋 2π

Note: Students are advised to observe the effect of delay angle on the THD and dominant
harmonics.

Results:

Load Voltage and Delay Angle, THD and Dominant Frequencies

Sl. Supply V Firing Angle α Firing Angle α THD Dominant Harmonics


No. Voltage Load
(Theoretical) (Observed) (%)
(RMS) (RMS) Fundamental 1st 2nd 3rd

Inferences:

Department of E&E Engineering 67


Measurement & Instrumentation Lab

Week 10: Lab Mini-Project Demonstration

Mini Project Demonstration includes the PPT presentation, live demonstration, and report
submission.

1. Report

The contents in the Report of Mini project limited to a maximum of 3 sheets are

1. Title
2. Team name and Registration numbers
3. Objectives
4. Literature survey
5. Design Solution
a. Working Principle (Explain using block-diagram representation)
b. Circuit Diagram with explanation
c. Programming –flowchart
d. Results
i. Simulation - snapshots
ii. Hardware prototype - snapshots
e. Conclusion
6. Limitations of the project and scope for improvements.
7. Identify and explain the impact of the project on consideration for public health and safety,
and/or cultural, societal, and/or environment.
8. Comment on the ability to function effectively as a team member for the project (each student
comments).
9. Bill of Materials

2. Project demonstration video → include all members demonstrating and explaining the project work
(maximum 5 minutes)
__________________________________________________________________________________

Additional Exercises
1. Realization of a Single/ Dual Trace Oscilloscope using LabVIEW with options of signals displayed both in
time & frequency domain.
2. Realization of a single-phase digital energy meter.
3. Realization of a scientific Calculator using LabVIEW.
4. Realization of frequency determining meter based on Lissajous patterns.
5. Develop a LabVIEW VI to change the speed of a DC motor connected via Arduino (Use a slider/knob in
front panel)

_____________________*****______________________

Department of E&E Engineering 68

You might also like