Data acquisition systems and sampling
DAQ chain, Nyquist sampling and alias folding, quantisation step and error, ADC types and multiplexing, with resolution, aliasing, bit-count and multiplexed-rate examples.
Drafted with Aria, reviewed by the AiCanCode.org team. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
Every modern measurement or control loop ends in a number inside a microcontroller, PLC or PC. How often you sample and how many bits you convert with decide whether that number truly represents the physical signal. Under-sampling creates false frequencies (aliases) that no software can remove, and too few bits hide the small changes you were trying to see.
Key ideas
Chain of a data acquisition system (DAQ) Sensor → signal conditioning (bridge, amplifier, anti-aliasing filter) → multiplexer (if several channels share one converter) → sample-and-hold → analogue-to-digital converter (ADC) → processor, storage or controller. Output channels use a digital-to-analogue converter (DAC) and a driver.
Sampling
- Sampling takes the value of a continuous signal every T_s seconds; f_s = 1/T_s is the sampling rate.
- Nyquist–Shannon theorem: a band-limited signal whose highest frequency is f_max can be reconstructed exactly from its samples if f_s > 2·f_max. The quantity 2·f_max is the Nyquist rate; f_s/2 is the Nyquist (folding) frequency.
- Aliasing: any component above f_s/2 folds back and appears as a lower frequency |f − k·f_s| (k the integer that brings it into 0 to f_s/2). After sampling, an alias is indistinguishable from a real component.
- Anti-aliasing filter: an analogue low-pass filter placed before the ADC to remove content above f_s/2. Real filters are not brick walls, so practical systems sample at 5–10 times f_max (more for control loops, where sampling delay also costs phase margin).
- Sample-and-hold: holds the input constant while the ADC converts, so a changing signal does not corrupt the conversion.
Quantisation and resolution
- An n-bit ADC has 2ⁿ output codes. The step size (one LSB, quantisation step) is Q = V_FS/2ⁿ, where V_FS is the full-scale input range. Some textbooks write V_FS/(2ⁿ − 1), which is the step between the lowest and highest code values; for n ≥ 8 the two differ by less than 0.4 %. State which you use.
- Quantisation error: with rounding, the error lies within ±Q/2; it behaves like noise of RMS value Q/√12.
- Ideal signal-to-quantisation-noise ratio for a full-scale sine: SNR ≈ 6.02·n + 1.76 dB. Each extra bit adds about 6 dB.
- Resolution is not accuracy: offset, gain error, nonlinearity, noise and the reference voltage's tolerance all add to the error.
ADC types
- Successive approximation (SAR): one bit decided per clock, n clocks per conversion; the workhorse of microcontrollers (10–16 bit, up to a few MS/s).
- Flash: 2ⁿ − 1 comparators, fastest, low resolution, high power.
- Dual-slope (integrating): slow but rejects mains noise if the integration time is a multiple of 20 ms (50 Hz); used in digital multimeters.
- Sigma-delta: heavy oversampling plus digital filtering; high resolution (16–24 bit) for slow signals such as load cells and thermocouples.
Multiplexing When N channels share one ADC through a multiplexer, the ADC must run at N × (per-channel rate), and samples on different channels are taken at slightly different instants (skew), unless simultaneous sample-and-hold is used.
Formulas
f_s > 2·f_max — sampling theorem; f_s: sampling rate (Hz or samples/s), f_max: highest frequency present (Hz).
f_alias = |f − k·f_s| — apparent frequency (Hz) of a component f after sampling, with integer k chosen so that 0 ≤ f_alias ≤ f_s/2.
Q = V_FS / 2ⁿ — quantisation step (V); V_FS: full-scale range (V), n: number of bits.
e_q,max = ±Q/2 — maximum quantisation error with rounding (V).
SNR ≈ 6.02·n + 1.76 — ideal SNR (dB) for a full-scale sine.
D = round(V_in / Q) — output code (decimal) for an input V_in (V) on a unipolar ADC.
f_ADC = N·f_s,ch — required aggregate conversion rate for N multiplexed channels, each sampled at f_s,ch.
t_conv ≤ 1 / f_ADC — time available per conversion (s).
Worked examples
Example 1 (standard): resolution of a temperature channel Given: a temperature transmitter gives 0–10 V for 0–100 °C, read by a 12-bit unipolar ADC with a 0–10 V range. The highest frequency of interest is 1 Hz.
- Quantisation step:
Q = V_FS/2ⁿ= 10/4096 = 2.441×10⁻³ V = 2.44 mV. - Maximum quantisation error: ±Q/2 = ±1.22 mV.
- Sensitivity: 10 V / 100 °C = 0.1 V/°C, so one step is 2.441×10⁻³/0.1 = 0.0244 °C.
- Minimum sampling rate:
f_s > 2·f_max= 2 Hz; practical choice 10–20 Hz with a low-pass filter around 2–5 Hz. Answer: Q ≈ 2.44 mV ≈ 0.024 °C per count; sample faster than 2 Hz (about 10 Hz in practice).
Example 2 (GATE level): aliasing, bits and multiplexing (a) A vibration signal contains components at 30 Hz and 70 Hz. It is sampled at 100 Hz without an anti-aliasing filter. What frequencies appear in the sampled data?
- Nyquist frequency = f_s/2 = 50 Hz. The 30 Hz component is below it and appears correctly.
- For 70 Hz:
f_alias = |70 − 1 × 100|= 30 Hz. Answer: both components appear at 30 Hz, so the 70 Hz content is hidden inside the true 30 Hz reading and cannot be separated afterwards.
(b) The measurement must resolve 0.01 % of full scale. Minimum number of bits?
- Need 2ⁿ ≥ 1/0.0001 = 10 000.
- log₂(10 000) = 13.29, so n = 14 (2¹⁴ = 16 384). Answer: 14 bits (ideal SNR ≈ 6.02 × 14 + 1.76 = 86.0 dB).
(c) Eight such channels are multiplexed into one ADC, each to be sampled at 2 kS/s. Required ADC rate and maximum conversion time?
f_ADC = N·f_s,ch= 8 × 2000 = 16 000 S/s.t_conv ≤ 1/f_ADC= 1/16 000 = 62.5 µs (including multiplexer settling). Answer: 16 kS/s; at most 62.5 µs per conversion.
Common mistakes
- Saying the sampling rate must be "at least" 2·f_max and then sampling a sine at exactly 2f: the samples can all land on zero crossings. The strict condition is f_s > 2·f_max.
- Believing that a digital filter after the ADC removes aliasing. The anti-aliasing filter must be analogue and come before sampling.
- Mixing up resolution (step size) with accuracy, or quoting resolution in bits when the question asks for volts.
- Forgetting that multiplexing divides the ADC rate among channels.
- Using 2ⁿ in one step and 2ⁿ − 1 in another; pick one and state it.
- Ignoring the signal's harmonics: a 50 Hz square wave has content at 150 Hz, 250 Hz and beyond.
For GATE ME
Typical items: minimum sampling rate, the alias frequency of an undersampled sinusoid, quantisation step and error for an n-bit ADC, the number of bits needed for a stated resolution, and the output code for a given input. Conceptual MCQs test the role of the anti-aliasing filter, sample-and-hold, and the differences between ADC types. Practise the folding calculation and powers of two until they are instant.
Quick check
- What is the Nyquist rate for a signal whose highest frequency is 500 Hz?
- A 900 Hz sine is sampled at 1 kHz. At what frequency does it appear?
- What is the step size of a 10-bit ADC with a 0–5 V range (using 2ⁿ)?
- How many dB of ideal SNR does each additional bit add?
- Where must the anti-aliasing filter be placed?
Answers: 1. 1000 Hz. 2. 100 Hz. 3. 5/1024 ≈ 4.88 mV. 4. About 6 dB. 5. In the analogue path, before the sample-and-hold/ADC.
Interview questions
All Sensors, Actuators and Electric Drives interview questionsTry answering each one aloud before you open it.
1.What is a data acquisition system (DAS) and what are its main components?Concept
A data acquisition system (DAS) is a system used to collect, digitize, and process data from various sensors and instruments. The main components of a DAS include sensors, signal conditioning units, analog-to-digital converters (ADC), and a data storage or processing unit. Sensors detect physical parameters, signal conditioning units prepare the signal for conversion, ADCs convert the analog signals to digital, and the data storage or processing unit stores or processes the data for analysis.
2.Explain the concept of sampling in the context of data acquisition systems.Concept
Sampling in data acquisition systems refers to the process of converting a continuous-time signal into a discrete-time signal by taking periodic samples. The rate at which samples are taken is called the sampling rate or sampling frequency. According to the Nyquist-Shannon sampling theorem, the sampling rate must be at least twice the highest frequency present in the signal to accurately reconstruct the original signal without aliasing.
3.Why is signal conditioning important in data acquisition systems?Application
Signal conditioning is important in data acquisition systems because it prepares the raw signals from sensors for accurate and reliable conversion by the ADC. This process may involve amplification, filtering, and isolation to ensure that the signal is within the range of the ADC, free from noise, and safe for the system. Proper signal conditioning improves the quality and accuracy of the data collected.
4.What happens if the sampling rate is lower than the Nyquist rate?Application
If the sampling rate is lower than the Nyquist rate, aliasing occurs. Aliasing is a phenomenon where higher frequency components of the signal are indistinguishably mapped to lower frequencies, leading to distortion and loss of information in the reconstructed signal. This makes it impossible to accurately reconstruct the original continuous-time signal from the sampled data.
5.How does an analog-to-digital converter (ADC) work in a data acquisition system?Concept
An analog-to-digital converter (ADC) works by converting continuous analog signals into discrete digital values. It samples the analog input signal at regular intervals and quantizes the amplitude of each sample into a finite number of levels, which are then represented as binary numbers. The resolution of an ADC, typically measured in bits, determines the number of discrete levels available for quantization.
6.Why is it important to match the ADC resolution with the application requirements?Application
Matching the ADC resolution with the application requirements is important because it ensures that the data acquisition system provides sufficient precision without unnecessary complexity or cost. Higher resolution ADCs offer more precise measurements but are more expensive and may require more processing power. Conversely, using an ADC with too low a resolution can result in loss of important signal details and reduced accuracy.
7.What is the role of a multiplexer in a data acquisition system?Concept
A multiplexer in a data acquisition system is used to select one of several input signals and forward the selected input into a single line. This is particularly useful when multiple sensors are connected to a single ADC, as it allows the ADC to process multiple signals sequentially without needing multiple converters. This reduces the cost and complexity of the system.
8.Calculate the minimum sampling rate required for a signal with a maximum frequency of 5 kHz.Numerical
According to the Nyquist-Shannon sampling theorem, the minimum sampling rate required is twice the maximum frequency of the signal. Therefore, for a signal with a maximum frequency of 5 kHz, the minimum sampling rate required is 2 × 5 kHz = 10 kHz.
9.If a 12-bit ADC is used, how many discrete levels can it represent?Numerical
A 12-bit ADC can represent 2^12 discrete levels. This is because each bit can have two possible states (0 or 1), and with 12 bits, the total number of combinations is 2^12 = 4096 discrete levels.
10.Explain the impact of quantization error in data acquisition systems.Application
Quantization error is the difference between the actual analog input value and the quantized digital output value produced by an ADC. This error occurs because the ADC can only represent a finite number of levels, leading to small discrepancies in the representation of the signal. Quantization error can affect the accuracy of the data and is more pronounced in systems with lower resolution ADCs. Minimizing quantization error is crucial for applications requiring high precision.
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?