Docsity

Preparation Exercise 11 Solutions - Microprocessors and Digital System | ECE 331, Study notes of Electrical and Electronics Engineering

Toggle sidebar
bg1
ECE 331 Preparation Exercise 11 Solutions
Please refer to Module 10 course notes to answer the following questions.
1. What is an actuator and how is it different from a sensor?
An actuator is a device that converts electrical energy into a non-electrical form, such as
heat or motion, and thus generates a signal or stimulus that can act on the real world.
Sensors act in the opposite direction, sampling a real world signal, such as the
temperature or chemical concentration, and converting it into electrical data.
2. ADC operation is defined by digital sample parameters including VRH, VRL, Resolution and fs
(sampling rate). Which of these parameters is most closely linked to each of the analog signal
features below.
a) maximum voltage of the analog signal
VRH
b) frequency characteristics of the analog signal
fs
c) minimum voltage of the analog signal
VRL
d) voltage sensitivity of the analog signal
resolution
3. You have been asked to design a system that can record the analog output of a sensor using a
microcontroller with an ADC. The sensor’s output has information in the frequency band of 100Hz to
100kHz.
a) What ADC sampling rate should you use to meet the Nyquist criterion?
The Nyquist criterion says we need to sample at least 2x the max frequency of signal
information content. So, here that would be fs = 200kHz. This is, however, just the
minimum frequency and you would generally want to sample even faster, up to 10x the
information frequency, or 1MHz in this case –provided your ADC can be sampled that
rapid.
b) Assuming you wanted to develop a digital low pass filter to prevent aliasing, what cutoff
frequency should you set for the filter?
LPF cutoff is typically set to the max frequency of information content in the data, so
100KHz in this case.
c) With respect to data sampling, what is aliasing? How can it be prevented?
Aliasing is the creation of artifacts, erroneous data, due to the data sampling process. It
can occur if the sampling rate is set too low so that the true frequency content is
missed. Aliasing can also occur when data is oversampled at a frequency higher than data
content, resulting in generation of high frequency artifacts that should be removed with
a LPF.
pf2

Partial preview of the text

Download Preparation Exercise 11 Solutions - Microprocessors and Digital System | ECE 331 and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

ECE 331 Preparation Exercise 11 Solutions

Please refer to Module 10 course notes to answer the following questions.

  1. What is an actuator and how is it different from a sensor?

An actuator is a device that converts electrical energy into a non-electrical form, such as heat or motion, and thus generates a signal or stimulus that can act on the real world. Sensors act in the opposite direction, sampling a real world signal, such as the temperature or chemical concentration, and converting it into electrical data.

  1. ADC operation is defined by digital sample parameters including VRH, VRL, Resolution and fs (sampling rate). Which of these parameters is most closely linked to each of the analog signal features below. a) maximum voltage of the analog signal VRH b) frequency characteristics of the analog signal fs c) minimum voltage of the analog signal VRL d) voltage sensitivity of the analog signal resolution
  2. You have been asked to design a system that can record the analog output of a sensor using a microcontroller with an ADC. The sensor’s output has information in the frequency band of 100Hz to 100kHz. a) What ADC sampling rate should you use to meet the Nyquist criterion? The Nyquist criterion says we need to sample at least 2x the max frequency of signal information content. So, here that would be fs = 200kHz. This is, however, just the minimum frequency and you would generally want to sample even faster, up to 10x the information frequency, or 1MHz in this case – provided your ADC can be sampled that rapid. b) Assuming you wanted to develop a digital low pass filter to prevent aliasing, what cutoff frequency should you set for the filter? LPF cutoff is typically set to the max frequency of information content in the data, so 100KHz in this case. c) With respect to data sampling, what is aliasing? How can it be prevented? Aliasing is the creation of artifacts, erroneous data, due to the data sampling process. It can occur if the sampling rate is set too low so that the true frequency content is missed. Aliasing can also occur when data is oversampled at a frequency higher than data content, resulting in generation of high frequency artifacts that should be removed with a LPF.

4 Three common ADC architectures are Flash, Sigma-Delta, and Successive approximation register (SAR). Which of these three ADC architectures is: a) best for applications demanding very high resolution (high number of ADC bits) Sigma-Delta ADCs are slow but provide the highest resolution b) best for applications requiring a balance of resolution and speed SAR ADCs are best for moderate speed and moderate resolution applications c) best for applications that only need medium resolution but must have a very high sample rate Flash ADCs are the fastest

  1. Assuming that a microcontroller features a 10-bit SAR ADC with VRH = 3.3V, VRL = 0.1V, determine the following: a) What is the level of quantization or number of digital steps? number of steps = 2b^ = 2^10 = 1024 b) What is the resolution of this ADC in μV/step? resolution = (VRH – VRL) / 2b^ = (3.3 – 0.1) / 1024 = 3125 μV/step c) What hexadecimal digital value would be produced by this ADC for an input of 2.22V? Assume the ADC assigns the digital value to the lowest voltage within each step (effectively truncates any voltage beyond the largest full step). Vdigital = (Vanalog – VRL) / resolution = (2.22 – 0.1) / 3125μ = 678.4  678 = 0x2A Note that rounding errors can easily occur in ADC calculations. For example, if we had rounded the resolution to 3.1mV/step we would have calculated Vdigital = 683.9  0x2AC which is not the right value. Thus, with ADC calculations you should generally avoid any rounding and instead use full algebraic expressions like this: Vdigital = (Vanalog – VRL) / resolution = (Vanalog – VRL) * [2b^ /(VRH – VRL)]
  2. You have been asked to design a microcontroller system that must interface to an analog signal.

a) If the analog signal has a range from 0.2V to 2.0V and a voltage sensitivity of 5mV, what is the minimum number of ADC bits (8-bit, 10-bit, etc.) your chosen microcontroller must have? This problem essentially asks us to find the number of bits needed to achieve a resolution equal to or better than 5mV/step. resolution = (VRH – VRL) / 2b^  2 b^ = (VRH – VRL) / resolution = (1.8)/5m = 360 thus, b = log 2 (360), but most calculators won’t do base 2 logs so let’s solve this by trial and error. 4-bits  16, entirely too low. 8 bits  256, much closer but still too low 9 bits  512, which is more than 360 and thus would allow more than 5mV resolution b) If you found a microcontroller you liked that had a 12b ADC, but it had fixed ADC references of VRH=3V and VRL=0V, would this controller still meet your analog sampling needs? This problem essentially asks us check if this ADC provides more than the required 5mV/step resolution. resolution = (VRH – VRL) / 2b^ = (3 – 0) / 4096 = 732 μV/step which is much higher resolution than 5mV/step. Thus YES you could use this controller.