0% found this document useful (0 votes)
59 views16 pages

Lab 8 - ADC

This document provides instructions for a lab on analog to digital conversion using the NI Automated Measurements Board. The objectives are to use the on-board ADC to convert an analog signal to digital, understand the impact of resolution and sampling rate, and observe the ADC protocol using a logic analyzer. Key aspects of analog to digital conversion covered are resolution, sampling rate, range, and how the ADC converts a continuous analog signal to a discrete digital representation. The lab instructions provide wiring diagrams and guide using a LabVIEW simulation to generate analog signals and observe the digital output and scaling.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views16 pages

Lab 8 - ADC

This document provides instructions for a lab on analog to digital conversion using the NI Automated Measurements Board. The objectives are to use the on-board ADC to convert an analog signal to digital, understand the impact of resolution and sampling rate, and observe the ADC protocol using a logic analyzer. Key aspects of analog to digital conversion covered are resolution, sampling rate, range, and how the ADC converts a continuous analog signal to a discrete digital representation. The lab instructions provide wiring diagrams and guide using a LabVIEW simulation to generate analog signals and observe the digital output and scaling.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Lab Manual:

Measurements and Instrumentation


Using the NI Automated Measurements Board for NI ELVIS III

Lab 8: ADC
© 2019 National Instruments
All rights reserved. Neither this resource, nor any portion of it, may be copied or reproduced in
any form or by any means without written permission of the publisher.

National Instruments respects the intellectual property of others, and we ask our readers to do
the same. This resource is protected by copyright and other intellectual property laws. Where
the software referred to in this resource may be used to reproduce software or other materials
belonging to others, you should use such software only to reproduce materials that you may
reproduce in accordance with the terms of any applicable license or other legal restriction.

LabVIEW and National Instruments are trademarks of National Instruments.

All other trademarks or product names are the property of their respective owners.

Additional Disclaimers: The reader assumes all risk of use of this resource and of all
information, theories, and programs contained or described in it. This resource may contain
technical inaccuracies, typographical errors, other errors and omissions, and out-of-date
information. Neither the author nor the publisher assumes any responsibility or liability for any
errors or omissions of any kind, to update any information, or for any infringement of any patent
or other intellectual property right.

Neither the author nor the publisher makes any warranties of any kind, including without
limitation any warranty as to the sufficiency of the resource or of any information, theories, or
programs contained or described in it, and any warranty that use of any information, theories, or
programs contained or described in the resource will not infringe any patent or other intellectual
property right. THIS RESOURCE IS PROVIDED “AS IS.” ALL WARRANTIES, EITHER
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY AND ALL IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, ARE DISCLAIMED.

No right or license is granted by publisher or author under any patent or other intellectual
property right, expressly, or by implication or estoppel.

IN NO EVENT SHALL THE PUBLISHER OR THE AUTHOR BE LIABLE FOR ANY DIRECT,
INDIRECT, SPECIAL, INCIDENTAL, COVER, ECONOMIC, OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THIS RESOURCE OR ANY INFORMATION, THEORIES, OR PROGRAMS
CONTAINED OR DESCRIBED IN IT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES, AND EVEN IF CAUSED OR CONTRIBUTED TO BY THE NEGLIGENCE OF THE
PUBLISHER, THE AUTHOR, OR OTHERS. Applicable law may not allow the exclusion or
limitation of incidental or consequential damages, so the above limitation or exclusion may not
apply to you.
Lab 8 – Analog to Digital Converters
Learning Objectives
In this lab you will explore, through hands-on experience, the concept and properties of Analog to
Digital Converters. Among other experiments, you will

✔ Use the analog to digital converter (ADC) embedded in your NI Automated Measurements
Board to convert an analog signal to a digital signal.
✔ Revisit the resolution and sampling rate of a signal acquisition and experience its impact on an
ADC conversion.
✔ Use the Logic Analyzer Soft Front Panel (SFP) to observe and understand the ADC protocol.

You will be expected to:

✔ Conduct experiments using the NI ELVIS III and record your observations

✔ Conduct experiments using the NI Automated Measurements Board and record your
observations
✔ Complete Check for Understanding Questions
Required Tools and Technology
Platform: NI ELVIS III ✔ View User Manual:
http://www.ni.com/en-us/support/mod
● Logic Analyzer
el.ni-elvis-iii.html
✔ View Tutorials:
Note: The NI ELVIS III Cables and https://www.youtube.com/playlist?
Accessories Kit (purchased separately) is list=PLvcPIuVaUMIWm8ziaSxv0gwtshBA
required for using the instruments. 2dh_M

Hardware: NI Automated Measurements ✔ View Breadboard Tutorial:


Board
http://www.ni.com/tutorial/54749/en

Software: LabVIEW ✔ Before downloading and installing


Version 19.0 or Later software, refer to your professor or lab
manager for information on your lab’s
Toolkits and Modules: software licenses and infrastructure
● LabVIEW Real-Time Module ✔ Download & Install for NI ELVIS III:
http://www.ni.com/academic/download
● NI ELVIS III Toolkit
✔ View Tutorials:
http://www.ni.com/academic/students/l
earn-labview/
Introduction: Converting Analog Signals to Digital Signals
Using a computer to view and analyze a voltage signal requires a component called an analog to digital
converter (ADC). This unit converts the analog continues voltage signal (black) into a discrete digital
signal (grey).

An analog signal is a continuous signal, for example a sinewave signal. As a continuous signal, there are
an infinite number of values between any two points in the signal and the instantaneous voltage of the
signal varies continuously. In the diagram above, if you had a perfect representation of an analog signal,
you could zoom into the black line without it becoming a graph with steps like the grey one. No matter
how short the time interval is you are looking at the voltage will always be changing. Where in
comparison a digital signal is a discrete signal that attains a finite number of values over a finite range of
time. This causes the signal to have steps when you zoom in. The size or choppiness of the signal is
determined by the resolution and the bandwidth used to acquire the signal.

As mentioned before, an analog signal is a perfectly continuous signal, so if we wanted to perfectly read
that analog signal into a computer to analyze or store it, we would need a computer capable of storing
infinite amounts of data
However, seeing as a computer capable of storing infinite data doesn’t exist, we must store signals as
finite digital signals. This presents the following question: given a certain analog signal, how and which
of its values do we select for reading into the computer without losing the characteristic properties of
the signal? In other words, how do we convert an analog signal into a digital signal?

Let’s think of an example: the temperature in the room. At every instant in time, no matter how
granular, there is always a temperature in the room. Additionally, the temperature can always be
represented at more decimal places (if we were capable of measuring it).

So for measurement purposes, how frequently do we need to measure our temperature and how much
resolution do we need to measure with? This will depend on our measurement requirements, but these
are a couple of the pertinent questions for this lab.

In this Lab we will explore this process which is called analog to digital conversion of a signal with an
ADC.

An Analog to Digital Converter (ADC) is a device that converts an analog signal into a digital signal.
There are many parameters that determine how well the resulting digital output signal of an ADC
represents the original analog signal. Among those parameters, we have resolution, sampling rate and
range.

The range (E) of an ADC specifies the minimum and maximum values it can detect. For instance, an ADC
with range -5V/5V would read a 5.5V voltage value as 5V. It is capable of reading values within this range
only.

The resolution (M) of an ADC indicates the number of discrete values it can produce over the range of
analog values. For example, an ADC with a resolution of 4 bit can produce N=2M =2 4=16 different
values.

If that ADC had a range from Vmin = -5V to Vmax = 5V, then it would be able to measure the voltage with a
Voltage Resolution (Q) of:

V max −V min 5 V −(−5 V )


Q= M
= =0.625V
2 16

The sampling rate of an ADC refers to the number of times per second it reads an analog signal. A 1kHz
sampling rate means that the ADC reads the value of an incoming analog signal 1000 times per second.

In the following simulation you will experiment the impact each one of these parameters has over an
acquired analog signal.

Simulate: Analog to Digital Conversion


The following LabVIEW project simulates the process of analog to digital conversion.

Perform the proper wiring on the NI Automated Measurements Board

1) Acquire the voltage signal from the analog output A/AO0 into the Analog to Digital Converter on the
application board in order to measure it.
a) Connect A/AO0 to socket 32
b) Connect the analog ground (AGND) to socket 33.
The VI allows you to generate an analog signal on A/AO0 and measured with the ADC as well as observe
the raw data after ADC conversion and analog data after scaling.

From your course kit folder,

1. Make sure your NI ELVIS III is powered


2. Navigate to ADC ->Simulate
3. Open the LabVIEW project titled ADC Protocol.lvproj
4. From the project window, configure the NI ELVIS III IP address to reflect the IP address of the
actual NI ELVIS III your computer is connected to.
o You can find the IP address of your NI ELVIS III by clicking and holding the button on the
left-hand side until the IP address is displayed on the LED screen.
o To configure the NI ELVIS III from your project window,
▪ right-click NI ELVIS III (0.0.0.0)[Unconfigured IP Address]

▪ click General in the window prompt you get.


▪ In the IP address section enter the IP address of the NI ELVIS III connected to
your computer.

o Save your project.

Open the RT Main VI and run it.

1. Set Acquisition Mode to Single Acquisition and click Force Single Acquisition to trigger an ADC
conversion.
2. Observe the change in ADC Raw Data and Analog Output.
3. Set Acquisition Mode to Continuous and the Resolution in Bits to 4 then move the slider
between -5V and 5V.
a. How many different scaled Data readings does the ADC output? __________________
b. What is the difference in consecutive values? ____________________
4. Change the Resolution in Bits to 12 and repeat step 3.
a. Is the ADC capable of representing more or less values? ____________________
b. Calculate how many possible readings the ADC can output? __________________
5. In your own words describe the impact of changing the Resolution in Bits from 4 to 12. What is
the effect on the converted digital signal?
______________________________________________________________________________
____________________________________________________________________________
Experiment: Analog to Digital Converter (ADC) with different sampling rates

The following LabVIEW project helps you experiment with the ADC embedded in your NI Automated
Measurements Board. A 10 Hz sine waveform is generated on A/AO0 and measured with the ADC.
Observe the changes of the sine waveform acquired by the ADC while changing the ADC’s sampling rate.

From your course kit folder,

1. Make sure your NI ELVIS III is powered


2. Navigate to ADC ->Simulate
3. Open the LabVIEW project titled ADC Basic.lvproj
4. Make sure all other projects are closed.
5. From the project window, configure the NI ELVIS III IP address to reflect the IP address of the
actual NI ELVIS III your computer is connected to.
o You can find the IP address of your NI ELVIS III by clicking and holding the button on the
left-hand side until the IP address is displayed on the LED screen.
o To configure the NI ELVIS III from your project window,
▪ right-click NI ELVIS III (0.0.0.0)[Unconfigured IP Address]

▪ click General in the window prompt you get.

▪ In the IP address section enter the IP address of the NI ELVIS III connected to
your computer.

o Save your project.

Perform the proper wiring on the NI Automated Measurements Board

You are good to go, if you have not changed any wiring from the previous experiment. If you did change
the wiring, please follow the next steps to make sure the electrical connections are correct for this
experiment.
1) Acquire the voltage signal from the analog output A/AO0 into the Analog to Digital Converter on the
application board in order to measure it.
a) Connect A/AO0 to socket 32
b) Connect the analog ground (AGND) to socket 33.

The VI allows you to generate an analog signal on A/AO0 and measured with the ADC, as well as observe
the raw data after ADC conversion and analog data after scaling.

Open the RT Main VI and run it.

1. While keeping the Resolution in Bits at 12, start out with an ADC Sample Rate of 40S/s and
increase the sample rate to 1000S/s.
2. Observe the change in the Sample Data Waveform.
a) How does increasing the sample rate change the shape of the graph? _Tiến dần về hình
dạng sin hoàn chỉnh
b) At what approximate sampling rate does increasing the sampling rate have a negligible
visible effect? _209S/s

In your own words describe the impact of changing the sampling rate. What is the effect on the
converted digital signal?
__________________________________________________________________________________
________________________________________________________________________
Experiment: ADC Protocol – Logic analyzer

In this experiment we will have a look at the raw digital signal of the ADC, to investigate the structure of
the signal being output by the ADC.

ADC Signal PINs behavior.

1. When the ADC logic initializes it sets CNV to TRUE, CS to TRUE, and SCLK to FALSE. This state
lasts 125 ns.
2. The Assert Convert state sets CNV to FALSE to start the ADC conversion. This state lasts 125 ns.
3. The Deassert Convert state sets CNV to TRUE and waits for the completion of data conversion.
This state lasts 500 ns.
4. The Assert Chip Select state sets CS to FALSE to frame the data. This state lasts 125 ns.
5. The Read ADC Raw Data state reads 12 bits digital data from SDO only when SCLK is TRUE.
6. The Assert Clock state sets SCLK to TRUE to read one bit digital data from SDO. This state lasts 5
ticks (125 ns).
7. The Deassert Clock state sets SCLK to FALSE and waits 5 ticks (125 ns). The For Loop takes
another 2 ticks. So this state lasts 7 ticks (175 ns).
8. The Deassert All Outputs state sets CS to TRUE to finish the ADC data conversion. The ADC chip
repeats step 1 through 9 in every analog data conversion.

From your course kit folder,

1. Make sure your NI ELVIS III is powered


2. Navigate to ADC ->Simulate
3. Open the LabVIEW project titled ADC Protocol.lvproj
4. Make sure all other projects are closed.
5. From the project window, configure the NI ELVIS III IP address to reflect the IP address of the
actual NI ELVIS III your computer is connected to.
o You can find the IP address of your NI ELVIS III by clicking and holding the button on the
left-hand side until the IP address is displayed on the LED screen.
o To configure the NI ELVIS III from your project window,
▪ right-click NI ELVIS III (0.0.0.0)[Unconfigured IP Address]

▪ click General in the window prompt you get.

▪ In the IP address section enter the IP address of the NI ELVIS III connected to
your computer.

o Save your project.

Perform the proper wiring on the NI Automated Measurements Board

Make the following connections:

1. Acquire the voltage signal from the analog output A/AO0 into the Analog to Digital Converter on
the application board in order to measure it.
a) Connect A/AO0 to socket 32
b) Connect the analog ground (AGND) to socket 33.
c) Now connect the ADC outputs to the Logic Analyzer.
i) Connect the GND of the ADC to Ground
ii) Connect CNV to Logic 0
iii) Connect CS to Logic 1
iv) Connect SCK to Logic 2
v) Connect SDO to Logic 3
Using the Logic Analyzer Soft Front Panels on your NI ELVIS III

2. Make sure your NI ELVIS III is connected to your computer and powered on.
3. Launch Measurement Live https://measurementslive.ni.com/
4. Choose Instruments -> Logic Analyzer and Pattern Generator.
5. From the drop-down menu, choose the Voltage measurement mode.
6. Add a Trigger Logic 0, and set Mode to Normal, Acquisition delay to Enabled, Position to 0s.
7. Add Logic Analyzer, Logic 0 to Logic 3.

8. Set Time per division to 1us.


9. Select Single.

To start the experiment open the RT Main (Logic Analyzer) VI and run it.

1. Choose Single Acquisition for the Acquisition Mode from the pulldown.
2. Change the Analog Output Voltage to 3 Volt and push the button Single to force a single
acquisition. Your screen should look like the screen shoot below.

3. Compare the signals acquired by the Signal analyzer with the signals shown above in the ADC
Timing Diagram. The signals measured with the analyzer should match the diagrams signals.
a) In your own words, describe the clock (SCK) and signal (SDO) lines visible in the Logic
Analyzer when a value is triggered. Does it match the Timing Diagram? How many positive
peaks of the clock signal do you count?
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
b) What happens to the signal line after the least significant bit? Does it switch high or low?
(You may need to trigger multiple acquisitions to see how it behaves in multiple instances)
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
4. Read the SDO signal and compare it to the LED array in the RT Main VI. Write down the High-
Low status of the 12 bits of the ADC. ________________________________________________
a) Does it match the LED array? _____________________________________
Conclusion
Note: The following questions are meant to help you self-assess your understanding so far.

1. Indicate whether each of the following is true or false. [T/F]


a. The higher the resolution in bits the larger the resolution in volt. [T/F]
b. The higher the sampling rate the more accurate your digital representation of an analog
signal. [T/F]
2. In your own words, describe resolution and sampling rate of an ADC.
a. ________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
b. ________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________

Explore Further
In this lab, we identified the pertinent parameters of an ADC and of signal acquisition. We measured an
analog value represented as a 12-bit number and converted that raw digital value to a voltage.
Additionally, we experimented with the sampling rate of the ADC. Lastly, we investigated the raw digital
output of the ADC and the timing and shape of data coming from the ADC.

In future labs, we’ll almost exclusively use the on-board ADC within the ELVIS, as opposed to the ADC on
the board. But throughout the subsequent labs, you’ll utilize the concepts learned. In the measurement
application labs, you will experiment more with sampling rates of your measurements.

You might also like