Signal Conditioning and Data Acquisition System
117603Module 5: Data Processing
Q1(i). The main objective of data processing is to: (i) Reduce microcontroller load (ii) Extract meaningful insights (iii) Increase clock frequency (iv) Improve battery capacity2025?m
Module 5: Data Processing
View this question on its own page →The main objective of data processing is to:
(i) Reduce microcontroller load
(ii) Extract meaningful insights
(iii) Increase clock frequency
(iv) Improve battery capacityWorked SolutionAnswer
Correct option: (ii) Extract meaningful insights
Explanation
Data processing converts raw acquired data into useful information that can be interpreted or used for decision-making.
Typical processing operations include:
- Data cleaning and removal of invalid values.
- Noise reduction and filtering.
- Calibration and scaling.
- Averaging and statistical calculations.
- Feature extraction.
- Conversion into engineering units.
- Preparation of data for visualization or control.
For example, raw vibration samples can be processed to calculate RMS vibration, peak amplitude or frequency components, helping identify a machine fault.
Therefore, the correct answer is (ii).
Q1(j). Which of the following is not a data storage device used in embedded systems? (i) EEPROM (ii) SRAM (iii) SD card (iv) Transformer2025?m
Module 5: Data Processing
View this question on its own page →Which of the following is not a data storage device used in embedded systems?
(i) EEPROM
(ii) SRAM
(iii) SD card
(iv) TransformerWorked SolutionAnswer
Correct option: (iv) Transformer
Explanation
Embedded systems commonly use different types of memory and storage devices, including:
- EEPROM: Non-volatile memory used for storing configuration data and calibration values.
- SRAM: Fast volatile memory used for variables and temporary runtime data.
- SD card: Removable non-volatile storage suitable for large amounts of logged data.
A transformer is an electrical power/isolating component. It is not a data-storage device.
Therefore, the correct answer is (iv).
Q6(a). Explain the complete data processing cycle in a microcontroller-based system.20257m
Module 5: Data Processing
View this question on its own page →Explain the complete data processing cycle in a microcontroller-based system.
Worked SolutionSolution: Complete Data Processing Cycle
Definition
Data processing converts raw acquired samples into meaningful information that can be stored, displayed, transmitted or used for control.
Processing Cycle
Data Acquisition ↓ Data Validation ↓ Pre-processing / Filtering ↓ Calibration & Scaling ↓ Feature Extraction / Computation ↓ Analysis ↓ Storage / Display / Communication / Control1. Data Acquisition
Sensors and ADCs generate digital samples at a selected sampling rate.
2. Data Validation
The system checks for missing, out-of-range or corrupted values.
3. Pre-processing
Noise may be reduced using averaging or digital filters. Signals can also be normalized or resampled when appropriate.
4. Calibration and Scaling
ADC codes are converted into engineering units such as °C, V, Pa or rpm.
5. Feature Extraction
Useful quantities are calculated from raw samples, such as peak, RMS, mean, frequency or heart rate.
For a set of samples , the mean is:
6. Analysis
Statistical, frequency-domain or trend analysis can be applied depending on the application.
7. Storage and Output
Processed or raw data can be saved to flash, EEPROM, SD card or a computer and displayed or transmitted.
Real-Time Considerations
The processing time must be sufficiently small compared with the sampling interval. Buffering and interrupts/DMA can help prevent sample loss.
Conclusion
A complete data-processing cycle transforms raw sensor samples into reliable, useful information through validation, filtering, calibration, computation and analysis.
Q6(b). Describe various data storage options available in microcontroller systems and explain how data can be logged or stored using programming techniques.20257m
Module 5: Data Processing
View this question on its own page →Describe various data storage options available in microcontroller systems and explain how data can be logged or stored using programming techniques.
Worked SolutionSolution: Data Storage Options and Data Logging
Data Storage Options
Storage Nature Typical use SRAM Volatile, fast Temporary buffers EEPROM Non-volatile Calibration/configuration data Internal Flash Non-volatile Firmware and small datasets External Flash Non-volatile Larger embedded storage SD card Removable, high capacity Continuous data logging USB/Computer External Long-term transfer/storage Data Logging Process
Sensor → ADC → MCU → RAM Buffer → Storage Interface → File/MemorySteps
- Initialize the sensor and ADC.
- Configure the sampling timer.
- Acquire a sample at every sampling instant.
- Convert the ADC code into the required format.
- Add a timestamp or channel identifier when necessary.
- Store samples in a RAM buffer.
- When the buffer is sufficiently full, write a block to non-volatile storage.
- Repeat until logging ends.
Why Buffering is Important
Storage devices such as SD cards may have variable write latency. A RAM buffer allows acquisition to continue while data is being written in blocks.
Example Pseudocode
while (logging) { sample = read_adc(); buffer[index++] = sample; if (index == BUFFER_SIZE) { storage_write(buffer, BUFFER_SIZE); index = 0; } }A real implementation should also handle write failures, buffer overflow, timestamps, file-system errors and safe shutdown.
Storage Selection
- Use EEPROM for small calibration/configuration data.
- Use Flash for firmware and moderate non-volatile data.
- Use SD cards for large continuous logs.
- Use computer/USB/network storage when very large datasets must be transferred or archived.
Conclusion
Efficient data logging depends on selecting suitable storage, using buffering and ensuring that the sustained storage throughput is greater than the incoming data rate.
Q8(a). A microcontroller system needs to store real-time vibration data at 10 kSamples/s, each sample being 16 bits. (i) Calculate the minimum memory size required for storing 5 minutes of data. (ii) Suggest a suitable data storage interface (SPI/I2C/Parallel) and justify with bandwidth calculations.20257m
Module 5: Data Processing
View this question on its own page →A microcontroller system needs to store real-time vibration data at 10 kSamples/s, each sample being 16 bits.
(i) Calculate the minimum memory size required for storing 5 minutes of data.
(ii) Suggest a suitable data storage interface (SPI/I2C/Parallel) and justify with bandwidth calculations.Worked SolutionSolution: Vibration Data Storage Calculation
Given:
- Sampling rate = 10 kSamples/s = samples/s
- Sample size = 16 bits = 2 bytes/sample
- Duration = 5 minutes = 300 s
(i) Minimum Memory Required
Data rate:
Convert to bytes/s:
For 300 seconds:
Therefore:
Using binary units, this is approximately:
So at least 6 MB decimal storage is required, excluding filesystem overhead and metadata.
(ii) Suitable Interface
The raw required throughput is:
or:
SPI
SPI is the best choice among the given options for a typical embedded data logger because it provides high throughput with simple hardware and is widely supported by SD cards and external memory.
Even a modest SPI clock of 1 MHz can theoretically transfer:
which is well above the required 20 kB/s, leaving margin for protocol and storage overhead.
I²C
I²C is convenient for sensors and EEPROMs, but its lower typical speed makes it less attractive for continuous high-rate storage.
Parallel
Parallel interfaces can provide high throughput but require more pins and hardware complexity.
Final Answer
- Minimum data storage: bytes ≈ 6 MB
- Raw data rate: 0.16 Mbps = 20 kB/s
- Recommended interface: SPI, because it easily provides sufficient bandwidth with low pin count and is well suited to SD-card/external-memory logging.
Q9(a). A DAQ system samples 4 channels simultaneously at 25 kS/s per channel. Each sample is 12 bits. The microcontroller writes data to an SD card via SPI at 12 Mbps. The SD card uses 512-byte sectors and write operations must be in whole sectors. The MCU packs samples channel-wise into frames and writes continuously. (i) Compute the raw data rate in Mbps and the required sustained write throughput in MB/s (account for packing). (ii) Design a framing strategy: pack samples into 512-byte sectors with minimal wasted space—compute how many samples per sector and how many sectors per second must be written.20257m
Module 5: Data Processing
View this question on its own page →A DAQ system samples 4 channels simultaneously at 25 kS/s per channel. Each sample is 12 bits. The microcontroller writes data to an SD card via SPI at 12 Mbps. The SD card uses 512-byte sectors and write operations must be in whole sectors. The MCU packs samples channel-wise into frames and writes continuously.
(i) Compute the raw data rate in Mbps and the required sustained write throughput in MB/s (account for packing).
(ii) Design a framing strategy: pack samples into 512-byte sectors with minimal wasted space—compute how many samples per sector and how many sectors per second must be written.Worked SolutionSolution: Multichannel DAQ Data Rate and SD-Card Framing
Given:
- Number of channels = 4
- Sampling rate per channel = 25 kS/s
- ADC resolution = 12 bits/sample
- SPI rate to SD card = 12 Mbps
- Sector size = 512 bytes
(i) Raw Data Rate
Total samples per second across all channels:
Each sample contains 12 bits, so:
Therefore:
In bytes/s:
So:
Account for packing
Because SD-card writes are byte-addressable, 12-bit samples cannot simply occupy 12 bits independently unless the firmware packs them.
A convenient packing scheme stores two 12-bit samples in 3 bytes:
Thus efficient packing produces exactly the theoretical raw rate of 0.15 MB/s, excluding filesystem and protocol overhead.
The available SPI bandwidth is:
Therefore the nominal raw data rate is only:
of the stated SPI link capacity, leaving substantial bandwidth margin.
(ii) 512-Byte Sector Framing
A 512-byte sector contains:
With 12-bit samples, the maximum number of complete samples is:
341 samples use:
So one sector can contain 341 complete 12-bit samples if the packing is bit-level, leaving:
unused.
However, a cleaner byte-aligned scheme is to pack 340 samples:
leaving exactly 2 bytes for metadata, a timestamp, frame counter, CRC, or padding.
Recommended framing
Use 340 samples per 512-byte sector and reserve 2 bytes for metadata, or use a 341-sample bit-packed payload with 4 unused bits plus a defined header/trailer.
At 100,000 samples/s:
Thus the system needs approximately:
with 340 samples/sector, ignoring additional metadata.
For maximum packing efficiency using 341 samples/sector:
so approximately 294 sectors/s are required.
Final Answer
- Raw data rate: 1.2 Mbps = 0.15 MB/s
- SPI capacity: 12 Mbps = 1.5 MB/s
- Maximum complete 12-bit samples in 512 bytes: 341 samples
- Efficient practical framing: 340 samples + 2 bytes metadata/padding
- Sectors/s: approximately 295 sectors/s for 340-sample frames, or 294 sectors/s with 341-sample bit packing.
The stated SPI bandwidth is comfortably sufficient for the raw acquisition rate.