Chapter 9
Data Acquisition, Automated Testing, and Virtual Instrumentation
Post Graduate Program in Electrical Engineering
Electrical Measurement & Instrumentation
•
Post Graduate
Data Acquisition, Automated Testing, and Virtual Instrumentation
Introduction and context
Electrical measurement has evolved from isolated analog instruments to networked systems that sense, condition, digitize, analyze, store, and act upon data. A modern measurement system is therefore not merely a meter connected to a circuit; it is an engineered information pipeline. Data acquisition (DAQ) converts physical variables into usable digital records, automated testing applies repeatable procedures with limited human intervention, and virtual instrumentation combines measurement hardware with software-defined functionality.
These technologies are central to power-system monitoring, electric-machine testing, battery characterization, semiconductor production, condition monitoring, research laboratories, and industrial control. At postgraduate level, their study must include not only hardware architecture but also sampling theory, uncertainty, synchronization, software design, validation, cybersecurity, and the relationship between measurement quality and engineering decisions.
Learning objectives
After studying this chapter, the reader should be able to:
Explain the architecture and operation of a data-acquisition system.
Select signal-conditioning, conversion, sampling, and synchronization methods for electrical measurements.
Analyze quantization, aliasing, resolution, accuracy, uncertainty, and dynamic range.
Design an automated test sequence with suitable hardware, software, safeguards, and records.
Distinguish virtual instruments from conventional instruments and evaluate their advantages and limitations.
Apply calibration, validation, and traceability principles to computer-based measurements.
Critically assess contemporary DAQ technologies, including distributed systems, edge computing, and machine-learning-assisted diagnostics.
1. Measurement-system architecture
A generalized DAQ system contains the following stages:
Measurand and sensor: The measurand may be voltage, current, temperature, torque, speed, vibration, irradiance, or a derived electrical quantity.
Transducer: A sensor produces an electrical representation of the measurand. Current transformers, Hall sensors, shunts, thermocouples, strain gauges, and optical encoders are examples.
Signal conditioning: The signal is amplified, attenuated, isolated, filtered, linearized, excited, or otherwise adapted to the input range of the converter.
Multiplexing and holding: Several channels may share a converter. A sample-and-hold circuit captures the instantaneous value while conversion occurs.
Analog-to-digital conversion: The ADC maps an analog input into a finite digital code.
Timing and synchronization: A clock determines sampling instants; trigger and synchronization systems establish temporal relationships among channels and instruments.
Processing and storage: Software scales raw codes, removes invalid records, computes quantities, displays results, and stores metadata.
Decision or actuation: A test may pass or fail, or the system may issue a control command through a digital-to-analog converter or digital output.
Data acquisition and automated test architecture
Figure: Data acquisition and automated test architecture
Figure: Functional architecture of a DAQ-based automated test system.
The architecture is governed by a chain of dependencies: an accurate ADC cannot compensate for sensor nonlinearity, inadequate isolation, or incorrect timing. Conversely, excellent analog circuitry can be undermined by poor software scaling or undocumented configuration.
2. Signal conditioning and electrical integrity
Signal conditioning is often the most important practical part of a DAQ system. Its functions include:
Range adaptation: attenuation for high voltages and amplification for low-level signals;
buffering: presenting a suitable source impedance to the ADC;
differential measurement: rejecting common-mode voltage and reducing ground-loop errors;
isolation: protecting users and equipment and breaking galvanic ground paths;
anti-alias filtering: limiting out-of-band energy before sampling;
excitation and bridge completion: required by resistive sensors such as strain gauges;
linearization and compensation: correcting sensor characteristics and temperature effects.
For a differential amplifier, the common-mode rejection ratio is commonly expressed as
CMRR = 20 log₁₀(Ad / Acm) dB
where Ad is differential gain and Acm is common-mode gain. The expression assumes gains are dimensionless and uses the voltage-gain ratio. High CMRR is valuable only when resistor matching, layout, shielding, and source impedance preserve the theoretical rejection.
For a first-order low-pass filter, the cutoff frequency is
fc = 1 / (2πRC)
where R is resistance in ohms, C is capacitance in farads, and fc is in hertz. At frequencies well above the cutoff, the attenuation approaches 20 dB per decade for a first-order filter. Practical anti-alias filters are often higher order because a transition band is required between the highest wanted frequency and the Nyquist frequency.
Grounding deserves special attention in power measurements. A grounded-ended input may be unsafe or may short a floating circuit. Differential isolated inputs, appropriately rated voltage probes, current transformers, Hall sensors, and fiber links can reduce risk. Isolation ratings, creepage, clearance, transient category, and working voltage must be selected according to applicable safety standards and the installation environment.
3. Sampling, quantization, and conversion
3.1 Sampling theorem and aliasing
For a band-limited signal with no frequency content above fmax, ideal uniform sampling requires
fs > 2fmax
where fs is sampling frequency. This is the Nyquist condition under ideal assumptions. Real systems require an anti-alias filter because physical signals are not perfectly band-limited and because a practical filter has a finite transition band. If a sinusoid of frequency fin is sampled at fs, frequencies separated by integer multiples of fs produce indistinguishable samples. The observed alias frequency can be expressed as the frequency in the Nyquist interval equivalent to fin modulo fs.
Oversampling provides guard band, simplifies filtering, and may improve noise performance, but it does not automatically improve accuracy. Clock jitter is also important: for a sinusoidal input of frequency fin and rms timing uncertainty σt, the approximate rms jitter-induced SNR limit is
SNRjitter ≈ −20 log₁₀(2π fin σt) dB
This approximation assumes small, random timing errors and a sinusoidal input.
3.2 Quantization and resolution
An ideal unipolar N-bit ADC with input span from 0 to Vref has 2N codes. The nominal least significant bit is
q = Vref / 2N
where q is in volts. Quantization error is commonly modeled as uniformly distributed between −q/2 and +q/2 when the signal exercises many codes and is not correlated with the sampling clock. Its rms value is
σq = q / √12
This is an ideal statistical model, not a guarantee of ADC performance. Differential nonlinearity, integral nonlinearity, offset, gain error, reference noise, thermal noise, and missing codes can dominate.
For an ideal ADC driven by a full-scale sinusoid, the theoretical signal-to-quantization-noise ratio is approximately
SNRideal ≈ 6.02N + 1.76 dB
The formula assumes an ideal converter, a sinusoidal input, and quantization noise as the limiting impairment. Effective number of bits is often estimated from measured SNR as
ENOB = (SNR − 1.76) / 6.02
where SNR is in decibels and the same sinusoidal assumptions apply.
Worked example. A 16-bit, ±10 V bipolar input has a total span of 20 V. Its nominal code width is
q = 20/65536 = 0.000305 V ≈ 0.305 mV.
The ideal rms quantization uncertainty is approximately 0.305/√12 = 0.088 mV. This does not mean that a 0.088 mV measurement is accurate; sensor error, gain error, noise, and calibration uncertainty must also be included.
3.3 ADC architectures
Successive-approximation-register (SAR) ADCs provide a useful balance of speed, resolution, and power for multiplexed DAQ. Delta-sigma ADCs use oversampling and noise shaping and are attractive for high-resolution, lower-bandwidth measurements. Flash ADCs are extremely fast but require many comparators and are used where bandwidth is more important than resolution. Pipeline ADCs support high throughput with conversion latency. The architecture must be selected according to bandwidth, latency, resolution, channel count, and synchronization requirements rather than nominal bit count alone.
Multiplexed systems introduce channel-to-channel settling errors. After switching channels, the input network and sample capacitor require sufficient acquisition time. Simultaneous-sampling ADCs avoid interchannel time skew and are preferred for phase-sensitive power, vibration, and multi-axis measurements.
4. Timing, synchronization, and digital processing
Time information is a measurement variable. In a three-phase power system, even a small channel skew can create phase and power errors. Systems may use a common backplane clock, a shared trigger, hardware timestamps, IEEE 1588 Precision Time Protocol, GPS-disciplined timing, or sample-clock synchronization through a deterministic network.
A record should include channel identity, engineering units, sampling rate, time base, sensor range, calibration status, filter settings, and instrument configuration. Without metadata, a numerically precise data file may be scientifically unusable.
Digital processing may include averaging, RMS calculation, spectral analysis, digital filtering, feature extraction, and event detection. For a sequence of N equally spaced samples x[k], the arithmetic mean is
x̄ = (1/N) ∑k=0N−1 x[k]
and the rms value is
xrms = √[(1/N) ∑k=0N−1 x²[k]]
These discrete formulas estimate corresponding continuous quantities. They are most reliable when the observation window is appropriate to the signal. For periodic power waveforms, an integer number of cycles or a window synchronized to the fundamental reduces spectral leakage and bias.
The discrete Fourier transform (DFT) is
X[m] = ∑k=0N−1 x[k] e^(−j2πmk/N)
where N is record length, k is sample index, and m is frequency-bin index. The bin spacing is ∆f = fs/N. Window functions reduce leakage caused by noncoherent sampling but broaden the main lobe and alter amplitude calibration. Therefore, the choice of window must reflect whether frequency resolution, amplitude accuracy, or detection of nearby components is the primary objective.
5. Automated testing
Automated testing is the controlled execution of stimulus, measurement, evaluation, and reporting by a software-hardware system. A robust test is more than a script that calls instruments. It is a defined procedure with:
a device under test (DUT) and test configuration;
preconditions and safety interlocks;
stimulus limits and settling times;
measurement ranges and sampling settings;
pass/fail criteria and tolerances;
exception handling and abort behavior;
calibration and traceability information;
immutable or access-controlled records.
A typical test sequence is: identify the DUT, verify connections, perform self-checks, apply a safe initial state, ramp the stimulus, wait for stabilization, acquire data, calculate results, compare with limits, return to a safe state, and generate a report. State-machine implementation is preferable to an unstructured sequence because each state has explicit entry conditions, actions, exit conditions, and fault transitions.
For a measured value y and specified acceptable interval L ≤ y ≤ U, a simple acceptance rule is pass when the result lies within the interval. However, measurement uncertainty must be considered. A result close to a specification boundary may require a guard band. If expanded uncertainty is Uc, a conservative rule may require y + Uc ≤ U for an upper limit, depending on the applicable conformity-assessment policy. The policy must be declared before testing; it should not be changed after observing results.
Instrument communication may use SCPI commands over USB, Ethernet, serial links, or standardized interfaces. Communication software should implement timeouts, command verification, status checking, retry limits, and clear logging. A test must never silently substitute a default range or ignore an instrument error.
6. Virtual instrumentation
A virtual instrument is a measurement or control function whose user interface, analysis, and presentation are primarily implemented in software while sensors, signal conditioning, timing, and conversion remain physical. A virtual oscilloscope, spectrum analyzer, power analyzer, or control panel may therefore be implemented on a general-purpose computer with modular DAQ hardware.
Virtual instrumentation differs from simply displaying data on a computer. It permits the user to define computational functions, graphical interfaces, data models, test sequences, and reports. Its strengths include flexibility, rapid reconfiguration, automated analysis, remote access, integration with databases, and lower incremental cost for multi-function systems. Its weaknesses include dependence on software quality, operating-system behavior, driver compatibility, cybersecurity, latency, and the temptation to present calculated results with unjustified confidence.
A good virtual instrument separates:
hardware abstraction and driver services;
acquisition and buffering;
calibration and engineering-unit conversion;
analysis algorithms;
user interface;
data and metadata management;
alarm, safety, and audit functions.
This separation improves verification and permits the analysis layer to be tested using simulated or previously validated data. User-interface indicators should not be treated as the authoritative record unless the underlying raw data and configuration are retained.
7. Accuracy, uncertainty, calibration, and validation
Accuracy is a qualitative closeness to a true or reference value; uncertainty is a parameter characterizing dispersion of values reasonably attributable to the measurand. A measurement system should report uncertainty rather than implying that displayed digits are meaningful.
For independent input quantities with standard uncertainties ui and sensitivity coefficients ci = ∂y/∂xi, the combined standard uncertainty under a first-order model is
uc(y) = √[∑(ci ui)²]
when covariance terms are negligible. If inputs are correlated, covariance terms must be included:
uc²(y) = ∑∑ ci cj u(xi,xj)
where u(xi,xj) denotes covariance. An expanded uncertainty is often reported as U = k uc, where k is a stated coverage factor, commonly near 2 for approximately 95% coverage under suitable distributional assumptions.
Calibration establishes the relationship between indication and a reference under specified conditions. Verification checks whether a system meets requirements; validation establishes that the complete method is fit for its intended purpose. These are distinct activities. A calibrated voltage channel may still fail validation if its bandwidth, timing, isolation, or software processing is unsuitable for the application.
A calibration record should identify the instrument, sensor, standards, environmental conditions, method, results, uncertainty, date, operator, and next due date. Traceability is an unbroken documented chain of calibrations to a recognized reference, with uncertainty stated at each step.
8. Practical design methodology
A postgraduate engineer should begin with requirements rather than hardware selection. Define the measurand, expected range, bandwidth, accuracy, isolation, channel count, synchronization, environmental conditions, data rate, storage period, and safety category. Then derive the architecture.
For a data rate estimate, if C channels are sampled at fs samples per second with b bytes per sample, the uncompressed payload rate is
R = C fs b bytes/s
Protocol overhead, timestamps, packet headers, storage format, and redundancy increase the actual rate. For example, 8 channels at 20 kS/s and 2 bytes per sample produce R = 8 × 20,000 × 2 = 320,000 bytes/s before overhead. A 24-hour record would require approximately 27.6 GB before file-system and metadata overhead. This estimate influences local buffering, network capacity, and storage architecture.
Design should include overload behavior. Inputs need clamps or protective networks that do not compromise normal accuracy. Software should detect saturation and mark affected records rather than reporting clipped values as valid. The system should fail safely: loss of communication should not leave a high-energy DUT energized unless the risk assessment explicitly permits it.
Background. Consider an illustrative laboratory system for characterizing a 48 V lithium-ion battery module. The objective is to measure voltage, current, temperature, capacity, energy efficiency, and thermal response during controlled charge-discharge cycles.
Problem. Manual testing produced inconsistent current profiles, incomplete temperature records, and reports that could not be reproduced because instrument settings were not stored. The battery also presented electrical and thermal hazards.
Analysis. The required voltage range is 0–60 V, current range is ±100 A, temperature range is 0–80 °C, and the relevant electrochemical dynamics include events from seconds to hours. Voltage and current require synchronized sampling; temperature can be sampled more slowly. Isolation is required between the battery power circuit, control computer, and auxiliary sensors.
Approach. An isolated voltage transducer and Hall-effect current sensor feed simultaneous-sampling ADC channels. Thermocouple inputs use cold-junction compensation and isolated conditioning. A programmable bidirectional DC source/load supplies the profile. Hardware interlocks monitor door position, insulation fault, overtemperature, overvoltage, and emergency stop. The software state machine performs identification, precharge, stabilization, constant-current operation, constant-voltage operation, rest, discharge, and shutdown. Raw waveforms are stored with timestamps, firmware versions, calibration identifiers, and test parameters.
For sampled voltage v[k] and current i[k], charge and energy can be estimated by numerical integration. With sample period ∆t,
Q ≈ ∑ i[k] ∆t
and
E ≈ ∑ v[k] i[k] ∆t
where Q is in coulombs when current is in amperes and time in seconds, and E is in joules when voltage is in volts. Ampere-hours are obtained by dividing coulomb quantity by 3600; watt-hours are obtained by dividing joule energy by 3600. Sign conventions must be defined, for example positive current for discharge.
Outcome. The automated method produces repeatable profiles, synchronized electrical and thermal data, automatic aborts, and reproducible reports. Its validity still depends on current-sensor calibration, integration sampling, contact resistance, thermal sensor placement, and the representativeness of the selected cycling protocol.
Learning points. Automation improves repeatability but does not remove engineering judgment. Safety interlocks must be independent enough to remain effective during software failure. Raw data, configuration, and uncertainty are essential for defensible conclusions.
10. Challenges, governance, and contemporary developments
Limitations and failure modes
Common failures include aliasing, sensor saturation, ground loops, channel skew, clock drift, incorrect units, stale driver states, buffer overflow, software race conditions, missing metadata, and unrecognized calibration expiry. More data does not correct a biased measurement. Similarly, machine-learning algorithms cannot infer reliable physical conclusions from an unvalidated acquisition chain.
Safety and ethics
Electrical test systems can expose personnel to shock, arc flash, rotating machinery, pressure, heat, and stored energy. Risk assessment, guarding, interlocks, lockout procedures, emergency shutdown, competent supervision, and applicable electrical and laboratory standards are mandatory considerations. Automated systems must log operator identity and configuration changes where results affect safety, quality, compliance, or commercial decisions.
Cybersecurity is increasingly a measurement issue. Networked instruments should use authentication, least privilege, secure update procedures, segmented networks, event logging, and controlled remote access. A compromised test system can generate false certificates or unsafe commands. Data integrity requires checksums, version control, access control, retention rules, and protection against unauthorized alteration.
Contemporary developments
Distributed DAQ places synchronized nodes near sensors, reducing analog cable length and enabling modular expansion. Edge computing performs filtering and feature extraction near the source, reducing bandwidth and latency. Time-sensitive networking supports deterministic communication. High-speed digitizers and software-defined radios extend measurement into wideband power-electronics and electromagnetic-compatibility studies. Digital twins can connect measured data to physics-based models, while machine learning can identify anomalies and estimate remaining useful life. These methods should be accompanied by uncertainty evaluation, explainability appropriate to the decision, drift monitoring, and independent test data.
Best-practice checklist
Specify the measurand, bandwidth, range, uncertainty, and safety requirements before selecting equipment.
Use anti-alias filtering and document sampling rationale.
Prefer simultaneous sampling when phase relationships matter.
Preserve raw data, calibrated data, metadata, and software versions.
Treat overload, timeout, missing samples, and calibration expiry as explicit states.
Validate the complete measurement method, not only individual instruments.
Use independent safety interlocks for hazardous energy.
Test algorithms with reference signals and known datasets.
Report units, sign conventions, uncertainty, and acceptance rules.
Secure networked instruments and maintain an auditable change history.
Chapter Summary
Data acquisition is an integrated chain from sensor to decision. Signal conditioning, isolation, filtering, conversion, timing, software, and data management jointly determine measurement quality. Sampling must satisfy bandwidth requirements and be supported by anti-alias filtering; ADC resolution is not equivalent to accuracy. Quantization, jitter, nonlinearity, noise, and channel skew must be assessed for the application.
Automated testing adds controlled stimulus, sequencing, acceptance criteria, safety interlocks, exception handling, and traceable reporting. Virtual instrumentation uses software to define analysis and interfaces around physical acquisition hardware, providing flexibility but increasing dependence on software verification, cybersecurity, and configuration control. Calibration, uncertainty analysis, validation, metadata, and safe design are indispensable. Distributed acquisition, edge computing, deterministic networking, digital twins, and machine learning offer important opportunities, but they must not replace physical reasoning and metrological discipline.
Key Terms
Data acquisition: Conversion and organized collection of physical measurements into digital data.
Measurand: Quantity intended to be measured.
Signal conditioning: Adaptation of a sensor signal through amplification, filtering, isolation, or linearization.
Anti-alias filter: Filter that attenuates frequency components that could alias during sampling.
Sampling frequency: Number of samples acquired per unit time.
Aliasing: Misrepresentation of a signal caused by inadequate sampling.
Quantization: Mapping of continuous amplitude values to discrete digital codes.
ADC: Analog-to-digital converter.
ENOB: Effective number of bits representing practical ADC performance.
Multiplexing: Sharing one acquisition resource among multiple channels.
Simultaneous sampling: Sampling multiple channels at effectively the same instant.
Virtual instrument: Software-defined measurement or control instrument using physical acquisition hardware.
Automated test: Programmed execution of stimulus, measurement, evaluation, and reporting.
DUT: Device under test.
Calibration: Establishment of the relationship between indication and a reference.
Traceability: Documented linkage of a measurement to a recognized reference.
Measurement uncertainty: Parameter describing dispersion of values attributable to the measurand.
Metadata: Information describing data origin, units, timing, configuration, and status.
State machine: Structured model of states, transitions, actions, and fault responses.
Edge computing: Processing performed near the measurement source rather than only in a central system.
Review Questions
Short Answer Questions
What are the principal stages in a DAQ signal chain?
Why is an anti-alias filter required even when the sampling frequency satisfies the Nyquist condition for the desired signal?
Distinguish calibration from validation.
What is the purpose of simultaneous sampling?
State two advantages and two limitations of virtual instrumentation.
Long Answer Questions
Explain the architecture of a modern DAQ system, including sensor conditioning, conversion, timing, software, and data management.
Discuss quantization, ideal ADC SNR, ENOB, and the practical factors that limit ADC performance.
Describe how a state-machine approach can improve the safety and reliability of automated testing.
Explain the role of uncertainty, traceability, and metadata in computer-based electrical measurement.
Compare centralized, distributed, and edge-based DAQ architectures for industrial applications.
Analytical / Application Questions
Design a synchronized three-phase power-acquisition system for measuring voltage harmonics up to 10 kHz. Specify sampling, filtering, timing, isolation, and data-validation requirements.
An automated test occasionally reports implausibly high energy because one current channel saturates. Develop a diagnostic and corrective plan covering hardware, software, data flags, and reporting.
Propose a virtual-instrument architecture for battery testing that includes uncertainty estimation, safety interlocks, cybersecurity, raw-data preservation, and machine-learning-based anomaly detection.
Multiple Choice Questions with Answers
Question 1
A 12-bit unipolar ADC has a 0–4.096 V input range. What is its nominal code width?
A. 0.1 mV
B. 1 mV
C. 4 mV
D. 12 mV
Correct Answer: B. 1 mV
Question 2
Which measure most directly prevents frequency components above the usable band from aliasing into sampled data?
A. Increasing display brightness
B. Using an anti-alias analog filter
C. Reducing ADC resolution
D. Removing timestamps
Correct Answer: B. Using an anti-alias analog filter
Question 3
For a first-order RC low-pass filter, the cutoff frequency is
A. 2πRC
B. R/C
C. 1/(2πRC)
D. C/(2πR)
Correct Answer: C. 1/(2πRC)
Question 4
Which ADC architecture is especially associated with oversampling and noise shaping for high-resolution measurements?
A. Flash
B. Delta-sigma
C. Relay ladder
D. Peak detector
Correct Answer: B. Delta-sigma
Question 5
Why is simultaneous sampling important in three-phase power measurement?
A. It eliminates the need for sensors
B. It prevents all quantization error
C. It reduces interchannel timing error affecting phase relationships
D. It increases the input voltage automatically
Correct Answer: C. It reduces interchannel timing error affecting phase relationships
Question 6
For eight channels sampled at 20 kS/s with 2 bytes per sample, the payload rate is
A. 32,000 bytes/s
B. 160,000 bytes/s
C. 320,000 bytes/s
D. 640,000 bytes/s
Correct Answer: C. 320,000 bytes/s
Question 7
Which statement best distinguishes validation from calibration?
A. Validation establishes fitness of the complete method; calibration relates indication to a reference
B. Validation is only a software restart; calibration is data deletion
C. They are always identical activities
D. Calibration applies only to mechanical instruments
Correct Answer: A. Validation establishes fitness of the complete method; calibration relates indication to a reference
Question 8
In an automated test, a state machine is primarily useful because it
A. removes the need for safety controls
B. defines explicit states, transitions, and fault responses
C. guarantees zero measurement uncertainty
D. converts analog signals without an ADC
Correct Answer: B. defines explicit states, transitions, and fault responses
Question 9
If independent uncertainty contributions are combined using a first-order model and negligible covariance, the appropriate expression is
A. the arithmetic sum of all nominal values
B. the product of all uncertainties
C. the root-sum-square of sensitivity-weighted uncertainties
D. the largest sensor range
Correct Answer: C. the root-sum-square of sensitivity-weighted uncertainties
Question 10
Which item is essential metadata for interpreting a DAQ record?
A. Screen color preference
B. Sampling rate and engineering units
C. Keyboard layout only
D. Unrelated network passwords
Correct Answer: B. Sampling rate and engineering units
Electrical Measurement & Instrumentation
Chapter 9
of 9