EE250Unit6 ADC
EE250Unit6 ADC
EE 250 Unit 6
Sensing and Analog-to-Digital Conversion (ADC)
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 2
IoT Architecture
https://www.quicsolv.com/internet-of-things/how-iot-works/
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 3
SENSORS
ACTUATORS
IMPORTANCE OF SENSING
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 5
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 6
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 7
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 8
The I3 Consortium
http://i3.usc.edu/
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 9
The I3 Consortium
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 10
10
http://i3.usc.edu/
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 11
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 12
I3 Prototype
I3 Platform Admin
Seller
Website
BACnet client Subscriber Client
Database
Parser Access
Database
Broker Log
Publisher Client
Visualization
Backend
Pub-Sub Broker
Authentication
Plugin https://github.com/anrgusc/i3-core
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 13
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 14
Motivation / Orientation
• Look at sparkfun.com and the Sensor section, pick a sensor or two
that sound interesting and any documentation for the part (or chips
used)
▪ How do you interface to it?
▪ What terms are unfamiliar? What questions does it make you ask?
• Look at the ATMega328P (Arduino processor) manual, chapter 24
introduction (page 246) to see some of the related terminology and
concepts regarding ADCs that we will cover
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 15
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 16
1
volts 0
1
Analog to 0
1
Digital 0
1
Converter 0
1
0
time time
Analog Digital
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 17
Sampling
• Measure (take samples) of the signal's voltage at a regular time
interval
• Sampling converts the continuous time scale into discrete time
samples
∆t
Original Analog Signal Sampled Signal
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 18
Quantization
• Voltage scale is divided into a set of finite numbers (e.g. 256 values: 0 – 255)
• Each sample is rounded to the nearest number on the scale
• Quantization converts continuous voltage scale to a discrete (finite) set of
numbers
5V 5V 255
227
0V 0V 000
∆t
Sampled Signal Each sample is quantized
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 19
Digitization
• The measured number from each sample is converted to a set of 1’s
and 0’s
Measurement Scale
255
Sample
000
Each sample is quantized Quantized value is converted
to bits
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 20
∆t
Digital Sound
• CD Quality Sound
▪ 44.1 Kilo-samples per second
▪ 65,536 quantization levels (16-bits
per sample)
▪ 44.1KSamples * 16-bits/sample =
705 Kbps
• MP3 files compress that
information to 128Kbps – 320
Kbps
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 23
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 24
𝑉𝐿𝑂 0
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 25
Quantization Error
• The precision of the ADC (and error) is defined by the
number of bits used and the voltage range 4.445V
4.45V 227 227
4.43V 226
▪ 8-bit ADC implies 256 levels
4.41V 225
▪ 10-bit ADC implies 1024 levels
• In the diagram to the right, 1 digital unit is equivalent to
what ΔV? The sample value must be
rounded to the nearest
▪ 0.02V
"representable"
• When a signal is sampled it must be "rounded" to one of (in this case integer) value.
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 27
NYQUIST THEOREM
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 28
Examples
• Telephone system
▪ Voice usually between 300Hz – 3.4kHz
▪ Digitized at fs >= 6.8 kHz (usually 8KHz)
• CD quality sound
▪ Digitized at 44.1 kHz
▪ Implies fmax (Nyquist freq.) <= 22.05 kHz
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 30
Aliasing
• So what happens if we
sample at less than the
Nyquist rate?
• Aliasing!
▪ Occurs when a sampled signal
fits multiple possible signals
▪ Loss of information or
inaccurate results
Aliasing Example
• The plots below show two cosine waves sampled at 𝑓𝑠 = 100𝐻𝑧
▪ A 60 Hz cosine wave will alias with a 40Hz
▪ A 70 Hz cosine wave will not alias to a 40Hz but a 30Hz cosine wave
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 32
Frequency
components we
think we have after
sampling
(normalized to fs)
Anti-aliasing Filter
• To avoid the effects of aliasing, a low-pass filter (LPF) known as an anti-aliasing filter is
often placed in front of the ADC to remove any unwanted high-frequency components in
the signal to avoid their aliasing effects
▪ Even if your signal is band limited, noise and other interference sources may add high-
frequency components
▪ Suppose we have a signal whose desired frequency components lie below 5 kHz and so we
sample at 10 kHz. However, the signal (due to noise or other causes) has a high frequency
component at 17 kHz. Without an anti-aliasing filter (with 𝑓𝑐𝑢𝑡𝑜𝑓𝑓 = 5 kHz) we would see the
17kHz component at 3 KHz.
ARCHITECTURES
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 35
Architectures
• We will examine 2 basic ADC architectures
▪ Flash
▪ Successive Approximation
• Others exist
▪ Delta-sigma
▪ Pipelined
▪ Integrating
https://www.eetimes.com/document.asp?doc_id=1276974
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 36
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 37
Analog Amplifier/Comparators
• A common circuit in an ADC is an analog amplifier
(e.g. an op-amp) used as a comparator
• Characteristic equation when there is no feedback i=0
from the output back to the input is:
𝑉𝑜𝑢𝑡 = 𝐴𝑂 𝑉 + − 𝑉 − where 𝐴𝑂 is very large
• This leads to its use as an analog comparator i=0
Flash ADC
Graphic typo: An additional resistor should
https://www.electronics-tutorial.net/analog-integrated-circuits/data-converters/flash-type-adc/index.html
https://www.maximintegrated.com/en/app-notes/index.mvp/id/810
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 39
Algorithm:
analog comparator and Vref = Vhi_ref – Vlo_ref
for i=1 to n
generating 1-bit of the result at Vcomp = VDAC + Vref/2i
if Vin >= Vcomp
a time result[i] = 1
VDAC = Vcomp
• Uses a DAC to generate else
result[i] = 0
different voltages to compare
with the input
• Performs a "binary-like search"
to approximate the input
voltage
https://www.maximintegrated.com/en/app-
notes/index.mvp/id/1080
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 40
https://www.maximintegrated.com/en/app-notes/index.mvp/id/1080
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 41
https://www.electronicdesign.com/adc/what-s-difference-between-sar-and-delta-sigma-adcs
© 2024 by Mark Redekopp. This content is protected and may not behttps://www.maximintegrated.com/en/app-notes/index.mvp/id/2094
shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 43
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 44
CC 2538
• Uses a sigma-delta ADC
▪ 𝑓𝑆 = 4MHz
▪ Can trade data rate and 𝑓𝐷
• Section 15.2.7 in PDF (and page 379)
▪ http://www.ti.com/lit/ug/swru319c/swru319c.pdf
• TCONV = (decimation rate + 16) × 0.25 μs.
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 45
REVIEW EXERCISES
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 46
Review Questions 1
• Show how the operation of a 3-bit successive approximation ADC
with VLO=1V and VHI=6V would convert an input of 5V.
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 47
Review Questions 2
• A signal is digitized at 5 Megasamples/second, where would a noise
source at 8.1 MHz appear in the frequency domain of the digitized
signal?
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 48
SENSOR TYPES
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 49
Electric Signals
• Information is represented
electronically as a time-varying
voltage
▪ Each voltage level may represent
a unique value
▪ Frequencies may represent
unique values (e.g. sound)
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 50
Microphone
• Vibrations cause the coil to move changing the magnetic
field which induces a voltage according to Faraday's law
https://www.electronics-tutorials.ws/io/io_8.html
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 51
Images
• Digital Camera
▪ CCD’s (Charge-Coupled Devices) Color Filters
Thermal Sensing
• Thermistor
▪ Changes its resistance based on temperatures (e.g. 10kΩ at 25⁰C,
100Ω at 100⁰C)
• Resistive Temperature Detectors
▪ Like a thermistor but with greater linearity
• Thermocouple
▪ Use two different types of metal joined at one point
▪ The junction of two different metals (materials) will create a small
voltage across the junction
▪ This voltage is also dependent on temperature
▪ So by measuring the junction voltage, temperature can be inferred
• Several others exist
https://www.electronics-tutorials.ws/io/io_3.html
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 53
Linearity
• Often it is desirable for the sensor to
exhibit linearity over the desired range
of inputs
• Non-linear sensors may lead to less
accurate results or require more
processing to convert
Temp./Resistance Relationship
for a sample thermistor
https://eecs.oregonstate.edu/education/docs/datasheets/10kThermistor.pdf
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 54
Photoresistor
• Photoresistor causes the resistance
of a material to change based on
the amount of photons striking it
▪ Full moon at night: 0.3-0.5 lux
▪ Common indoor lighting: 300-500 lux
▪ Overcast day: 1000 lux
▪ Full daylight (not direct sunlight):
10000 or more
Source: https://learn.adafruit.com/photocells/measuring-light
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 55
Accelerometer
• GrovePi accelerometer
sensor range can detect -1.5g
to +1.5g on each axis
• Each axis value can be
digitized by a 6-bit ADC
• Result is a 6-bit 2's
complement
▪ 0g = 00000
▪ -1.5g = 100000
▪ +1.453g = 011111
• Some sensors have built in
ADCs and provide a serial
(I2C, SPI, UART) or other
digital interface that can
easily be connected to a
microcontroller
https://www.explainthatstuff.com/accelerometers.html
https://raw.githubusercontent.com/SeeedDocument/Grove-3-Axis_Digital_Accelerometer-1.5g/master/res/MMA7660FC.pdf
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 56
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 57
Micro-Electro-Mechanical Systems
MEMS
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 58
Idea of MEMS
• MEMS = Micro Electro-Mechanical Systems
• Design and fabricate micro-sensors, micro-actuators, and other
structures usually on the same chip
• Read more:
▪ https://www.memsnet.org/mems/what_is.html
http://sensera.com/2018/wp-content/uploads/2018/04/What-are-MEMS.pdf
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 59
A MEMS Gyroscope
http://memsjournal.typepad.com/.a/6a00d8345225f869e20148c7d54d63970c-pi
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 60
http://www.chipworks.com/about-chipworks/overview/blog/stmicroelectronics-micromirrors-
microvision-and-sony-bring-pico
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 61
MEMS Actuators
https://www.sandia.gov/mstc/_assets/images/mems/gallery/gears/2.jpg
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 62
Other Architectures
• Only if time allows
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 63
A capacitor:
Stores charge
and the total
charge represents
the voltage level
(can add or
remove charge)
Delta Modulation
• Sample operation
1 0 1 0 1 1 1 1
10 10 10 10 0 0 0 0 >=
3 2 1 0 1 0 1
0
Vsample,1=5.2V
VHI 8V
3-bit ADC Vsample,2=2.3V
1111100
Vsample Vin + 1100000
Vsample,1 5.2V
Counter 5
-
∆ ( Σ)
Vhi/2n 2
Vsample,2 2.3V
If 1, remove
Vref
VL 0V
O
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 66
http://www.ti.com/lit/an/slyt423a/slyt423a.pdf | http://www.ti.com/lit/an/slyt438/slyt438.pdf
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.
EE 250 | ADC / Sensing | Unit 6 | 67
The Scientist and Engineer's Guide to Digital Signal Processing by Steven W. Smith, Ph.D., Ch. 3
http://www.ti.com/lit/an/slyt423a/slyt423a.pdf
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed. | http://www.ti.com/lit/an/slyt438/slyt438.pdf
EE 250 | ADC / Sensing | Unit 6 | 68
• If we assume the noise is uniformly distributed between [− , + ] LSB, then the standard
1
2
1
2
1
deviation is = 0.29 LSB
12
𝑘 𝑛2 (𝑡)
© 2024 by Mark Redekopp. This content is protected and may not be shared, uploaded, or distributed.