Lab 1 - Sensors and Signals
Lab 1 - Sensors and Signals
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.
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
IMPLIEDWARRANTIES OFMERCHANTABILITY, 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.
2
Lab 1: Signals and Sensors
In this lab, you are going to dive into the first step of the signal chain, converting a real-
world phenomenon into processed data.
You are going to learn about sensors and the process of measuring physical signals of
many different types. Further, you are going to explore signal characteristics and the
measurement process. Specifically, you will explore the question, “what aspects of a
measurement am I interested in?”
Learning Objectives
1. Discuss the purpose of a sensor and the different types and characteristics
2. Discuss the characteristics of a signal and how they relate to the physical world
3. Analyze a spec sheet and choose an appropriate sensor based on a
measurement need
3
Required Tools and Technology
4
Platform: NI ELVIS III View User Manual:
● Use the NI ELVIS III instruments as http://www.ni.com/en-
needed us/support/model.ni-elvis-
Note: The ELVIS III Cables and iii.html
Accessories Kit (purchased separately) is View Tutorials:
required for using the instruments. https://www.youtube.com/playl
ist?
list=PLvcPIuVaUMIWm8ziaSx
v0gwtshBA2dh_M
Install Soft Front Panel
support:
http://www.ni.com/documentati
on/en/ni-elvis-iii/latest/getting-
started/installing-the-soft-front-
panel/
5
6
Expected Deliverables
Your instructor may expect you complete a lab report. Refer to your instructor for
specific requirements or templates.
7
1.1 Theory and Background
Video Summary
8
What Are Sensors?
Sensors are physical devices that convert a real-world phenomenon into a measurable
signal. Most commonly, they generate a voltage output, but they can also generate
current or they can change their electrical resistance.
Sensors are often packaged into a more advanced system where the output can be a
message from the sensor, instead of an analog electrical signal. You will focus on
sensors with simpler construction.
Many different physical properties can be utilized to generate the measurable output
signal. To name a few, these can include:
Sensors are often called transducers, meaning a device that converts energy from one
form to another.
Furthermore, sensors are important components of the data acquisition side of IoT
(Internet of Things), development.
Sensors are used in data acquisition, monitoring, and control systems in almost every
industry. From agriculture to manufacturing, sensors are included in systems to
measure conditions, confirm proper positioning of equipment, automate machine
movement, and measure produced products for defects.
Depending on the measurement that you're interested in, different characteristics of the
measurement signal will be of interest.
9
Signal characteristics include:
Level
State
Shape
Pattern
Frequency
Rate
You will learn more about these characteristics in subsequent sections of this lab.
10
Check Your Understanding
Note: The following questions are meant to help you self-assess your understanding so far. You
can view the answer key for all “Check your Understanding” questions at the end of the lab.
A. Signal level is the most important characteristic for all measurement sensors
B. All sensors output signals have the same characteristics
C. Different measurement scenarios are interested in different characteristics of a
signal
11
1.2 Sensor Types
What is a Sensor?
Sensors may be either analog or digital, depending on the type of signal that they
produce. Analog signals directly represent the phenomena they measure, tracing those
phenomena through a range of values. Digital signals represent physical phenomena
through a discrete (usually binary) set of possible values. Most sensors are analog,
although digital sensors do exist (such as encoders, which measure displacement).
Another distinction that you can make is whether a sensor is active or passive. Passive
sensors are those that rely on an external power source to function. Passive sensors
reflect physical phenomena by producing some change in the current running through
them. Active sensors generate current or voltage in response to the phenomena they
are meant to measure, and therefore do not need to be powered.
12
When are Different Sensors Used?
Different sensors are used to measure different physical phenomena. It is important that
the right sensor be used in any situation to measure the factor in question. Some
physical phenomena and the sensors that measure them are:
Strain Gauge
Strain, force Load Cell
Piezoelectric Transducer
Pressure
Microphone
Sound
Accelerometer
Vibration/Acceleration
Potentiometer
Position/Displacement Encoder
Flowmeter
Fluid flow
Photo sensor
Light
1-3 Which sensor would be appropriate to measure how heavy a manufactured part is?
13
A. Thermocouple
B. Load Cell
C. Hall-Effect Sensor
D. Flowmeter
14
1.3 Signal Types and Characteristics
Whether analog or digital, signals can all be described and analyzed in terms of multiple
different features, or characteristics. Depending on our purpose for producing the signal,
you may be interested in measuring certain of these characteristics and unconcerned
with knowing the others.
Level/State
The digital equivalent is state, which refers to the value of a signal at a certain point in
time (usually one of two binary values, either 1 or 0).
Shape/Pattern
The signal characteristic shape is exactly what it sounds like: the profile, or form of the
graph, of the signal over a certain period of time. Some common shapes even have
special names, such as square, triangle, and sawtooth.
A digital signal may have an identifying pattern, a particular sequence of states over a
certain period of time.
15
Figure 1-4 Voltage Graphs Showing Shape and Pattern
Frequency/Rate
Finally, the frequency of a signal is the number of times a recurring waveform repeats in
one second. Waveforms that recur in this nature are known as periodic.
For digital signals, the related concept is rate, which refers to the number of either
pulses or bytes of data sent each second.
Note that frequency is easy to understand in regards to a simple sinusoidal wave, but
becomes daunting to conceptualize for signals with complex shapes and many possible
periods. Fourier analysis allows us to break any signal down into a sum of multiple
different sine and cosine waves and analyze it from there.
16
Measurement Scenarios and Characteristic Importance
The signal characteristics we are interested in depend on the situation in which we are
taking the measurement.
In analog signals, level reflects the intensity or magnitude of the physical phenomenon
being measured. When level is the characteristic being studied, the phenomenon is
usually such that the level does not change rapidly with respect to time. Light intensity,
temperature, and pressure are some examples of phenomena for which level is
important.
A signal's shape is of interest mostly for signals that change quickly. The details of a
signal's shape--such as peak values and slope--help us to analyze physical
phenomena such as video signals, sound, and vibrations.
The significance of frequency depends on the phenomenon being measured, but it can
communicate such useful information as the pitch of a sound and the rapidity of an
earthquake tremor.
In digital signals, state is a binary value defining the thing being measured as either high
or low, on or off. Therefore, it is relevant in situations for which we only care to know
whether or not some condition is true, such as monitoring whether a switch is closed.
Pattern, like shape, reflects some aspect of the nature of a physical phenomenon, and
is used to deal with values that change over time.
Finally, rate can provide insight as to the rapidity of the phenomenon being measured,
such as how quickly a piston is firing.
1-4 In a scenario where you need to monitor the combustion of an engine and are
interested in the repeatability of the cylinder stroke and the cylinder moving through the
correct points with correct timing, which signal characteristic would you be most
interested in?
17
1.4 Sensor Characteristics
Sensitivity
Sensitivity is the ratio between the output signal and the physical phenomenon being
measured (the input). In other words, it is the slope of the sensor's graph.
Range
The range of a sensor is the minimum and maximum values of input property that it can
measure. The term dynamic range refers to the magnitude of the difference between
the minimum and maximum values. Keep in mind that the range of a sensor is often not
centered around zero.
Accuracy refers to how correct or truthful the sensor's output is to the input values.
Specifically, it is the maximum difference between the actual value of the phenomenon
being measured and the measurement output by the sensor.
Finally, resolution is the smallest measurable change of input property that a sensor can
detect and convey through a change in output signal. Both accuracy and resolution can
be given as absolute values or as percentages of the reading or range.
18
Offset and linearity
Linearity describes how much a sensor's graph deviates from the ideal curve. We can
determine percentage non-linearity with the following equation:
Non-linearity (%) =
Equation 1-1
where Din(max) is the maximum input deviation and INf.s. is the maximum (full-scale) input.
Keep in mind that linearity and offset are different; linearity deals with error in terms of
the shape and slope of the graph (sensitivity), whereas an offset error does not change
the shape of the sensor's graph from what is ideal, but merely translates it up or down.
Hysteresis
Sometimes, sensors output different values for the same input depending on whether
they approach that input from a higher or lower value. This behavior can generate
problematic inconsistencies. Hysteresis is a measure of how much a sensor's outputs
differ when approaching an input value from different directions.
Response Time
A sensor's response time is the amount of time it takes to change to and settle on a new
output value after a change in input.
19
Read more on sensor characteristics: http://www.ni.com/white-paper/14860/en/.
1-5 For a measurement scenario where you’re interested in detecting very small
changes in position, with a high degree of repeatability, within a small range of possible
values, which of the following are not an immediate interest?
A. Range
B. Precision
C. Sensitivity
D. Response time
20
1.5 Implement
Let's put all of this information to use and investigate the sensor characteristics of an IR
sensor. You will investigate the physical range of the sensor, the voltage output range,
the linearization of the sensor, and the resolution of the sensor.
You will begin with a pre-built program to run, and you will need to connect a simple
circuit to test it.
Sensor Specification
As is common practice, start with the spec sheet for the sensor. The spec sheet can be
accessed here: https://cf-ts.mythinkscape.com/IR_Distance_Sensor.pdf
Look at the specifications for the input and output ranges, and an approximation of the
output. Click the link above to download the sheet and find the Electro-optical
Characteristics. Starting from here, you will find some useful information about the
sensor.
21
Figure 1-7 Output Voltage Graphs
22
Let's identify some specifications of the sensor:
Given these specifications, we have some guidelines to work with, but we'll need to
linearize our output ourselves.
23
Circuit
Using the diagram in Figure 1-8, complete the circuit in order to apply a voltage to this
active IR sensor and begin measuring output.
Measure
Now that the sensor is connected, open the IR Sensor LabVIEW Project that was
provided in the courseware zip file, configure the IP address of your NI ELVIS III, and
then open the Virtual Instrument (VI) called IR Sensor.vi. Run the VI to begin taking
measurements.
With no objects in front of the sensor, record the measured voltage in the table below.
Then, place an object with a flat surface 20cm in front of the sensor with the flat surface
toward the face of the sensor. Record the voltage measured in the table in the program
and in the table below.
Move the flat object to different distances in front of the sensor, according to the table
below, and complete both tables with measured voltages.
24
1-6 Complete the distance and Voltage Measurements table below.
Calibrate
With the measurement table complete inside the program, click Calibrate to apply a line
of best fit. LabVIEW will calculate the parameters and begin using them.
These will be used for subsequent measurements, so your output will now display in
units of distance, instead of a voltage.
1-7 Consider your specification sheet. What factors could account for the differences of
the linearization of your sensor and another sensor? What factors could account for the
differences of the linearization between your sensor today and your sensor on another
day?
_____________________________________________________________________
_____________________________________________________________________
25
1.6 Exercise – Part 1
Measurement Scenario
Other Considerations:
Sensor Choices
In a real-world measurement scenario, any obtainable sensor that fit within the budget
could be a consideration. In this case, your choices will be limited to the 3 sensors you
have access to in the kit:
Open the data sheets in the VI and analyze the specifications. You will investigate
which of these is most appropriate for the measurement scenario listed.
26
For more information comparing temperature sensor types, you can read:
http://digital.ni.com/public.nsf/allkb/C50FA55B3B2F85D9862572D00083350E.
Range
Thermistor
The Thermistor lists that the 10k version follows Resistor/Temperature Characteristic
table number 2904.
Thermocouple
The thermocouple datasheet lists a range from -73 to 482°C.
27
RTD
The RTD datasheet lists a range from -200 to 550°C.
Linearity
Thermistor
Thermistors are non-linear in their resistance response to temperature. As we progress
through the signal chain, we would need to account for this non-linearity.
Thermocouple
Thermocouples have close to linear responses of voltage at different temperatures.
RTD
RTDs are close to linear in resistance response.
Sensitivity
Thermistor
Because thermistors are non-linear, to calculate the sensitivity of a thermistor, we'll
need to investigate a specific region of interest. Based on the measurement
specification, the sensitivity in the 40°C region will be of most interest.
On the spec sheet table 2904, a change from 40°C to 45°C changes the resistance from
(10 kΩ*0.5074) to (10 kΩ*0.41046), a change of 969.4Ω. If you linearize that change to
a 1 degree change, the resistance changes by 193.9, to 10 kΩ*0.4880.
For a 10 kΩ thermistor, a common voltage divider would put the thermistor in series with
a 10 kΩ resistor. A 1 degree change in temperature would result in a
5074/15074 voltage divider. With a 5 V supply, a 1 degree change of temperature would
change the voltage divider from (5 * 5074/15074 = 1.683 V) to (5 * 4880/14880 = 1.6398
V), which is a 43.2 mV/°C change.
28
Thermocouple
The thermocouple datasheet lists a voltage variation of 41.276 uV/°C, while being quite
linear.
RTD
The RTD datasheet lists resistance variation of 0.385 Ω/°C.
For a 100Ω RTD, a common voltage divider would put the RTD in series with a 100Ω
resistor. A 1 degree change in temperature would result in a 100.385/200.385 voltage
divider. With a 5V supply, a 1 degree change of temperature would change the voltage
divider from 2.5V to (5 * 100.385/200.385 = 2.5048V), which is a 4.8mV/°C change.
1-8 Which of the sensors have an appropriate range? What would you say about the 3
sensor types, when considering range?
_____________________________________________________________________
_____________________________________________________________________
1-9 Which of the sensors have an appropriate sensitivity? What would you say about
the 3 sensor types, when considering sensitivity?
_____________________________________________________________________
_____________________________________________________________________
1-10 Which sensors will be easier or harder to use, with respect to linearity? Will this
affect your final decision?
_____________________________________________________________________
_____________________________________________________________________
29
1-11 Which sensor is the best fit for the measurement scenario described? Why?
_____________________________________________________________________
_____________________________________________________________________
30
1.7 Exercise – Part 2
Measurement Scenario
In this scenario, you are going to investigate a strain measurement. For more
information on strain and strain gauges, you can read: http://www.ni.com/white-
paper/3642/en/.
Other Considerations:
Sensor Choices
In a real-world measurement scenario, any obtainable sensor that fit within the budget
could be a consideration. In this case, we will limit our choices to a single catalog of
different shapes and sizes of strain gauges:
1-12 Which of the sensor choices is the most appropriate for the area and orientation
that needs to be measured? Which sensor would you choose?
_____________________________________________________________________
_____________________________________________________________________
31
1-13 How does temperature affect a strain measurement? If you needed to account for
this, how could you?
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
32
1.8 Conclusion
These questions will help you review and interpret the concepts learned in this lab.
1-14 Summarize any observations from the lab that have not been addressed
elsewhere.
_____________________________________________________________________
_____________________________________________________________________
1-15 In your own words, describe what a sensor is and its purpose.
_____________________________________________________________________
_____________________________________________________________________
1-16 Describe the characteristics of a signal and how they relate to the real-world
counterpart of the signal.
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
33
Answer Key – Check Your Understanding Questions Only
1-1 A
1-2 C
1-3 B
1-4 C
1-5 D
34