Unit 3: Sensor Systems & Data Acquisition - Subjective Questions
ECE140 — Workshop On Iot For Digital Society • Practice Questions with Detailed Answers
20 questions
Define analog and digital sensors. Distinguish between their interfacing requirements in an IoT sensor node.
Analog sensors produce a continuous electrical output, such as voltage, current, resistance, or capacitance, that varies with the measured physical quantity. Examples include thermistors, gas sensors, and analog pressure sensors.
Digital sensors provide measurements in a discrete digital format through interfaces such as I2C, SPI, UART, or 1-Wire. Examples include the DHT22 humidity sensor and digital temperature sensors.
Key differences:
- Signal conversion: Analog sensors generally require an ADC, whereas digital sensors contain internal conversion circuitry.
- Signal conditioning: Analog sensors may require amplification, filtering, linearization, or impedance matching. Digital sensors usually require fewer external components.
- Noise immunity: Analog signals are more susceptible to noise, especially over long connections. Digital communication provides better noise immunity.
- Microcontroller connection: Analog sensors connect to ADC input pins, while digital sensors connect to communication or GPIO pins.
- Processing: Analog sensor data must be converted into engineering units using calibration equations. Digital sensors may directly provide calibrated values.
Thus, digital sensors simplify interfacing, while analog sensors offer flexibility and may be more suitable for simple or low-cost sensing applications.
Explain the working of an Analog-to-Digital Converter (ADC) in a sensor data acquisition system.
An Analog-to-Digital Converter (ADC) converts the continuous voltage generated by an analog sensor into a binary number that can be processed by a microcontroller.
The conversion involves the following stages:
- Sampling: The analog signal is measured at specific time intervals.
- Sample-and-hold: The sampled voltage is held constant during conversion.
- Quantization: The input voltage is mapped to one of a finite number of voltage levels.
- Encoding: The selected level is represented as a binary number.
For an -bit ADC, the number of output levels is:
For a unipolar ADC with reference voltage , the approximate ADC output code is:
where is the sensor voltage and is the digital output code.
Important ADC parameters include:
- Resolution: Smallest detectable input-voltage change.
- Sampling rate: Number of conversions performed per second.
- Reference voltage: Determines the ADC measurement range.
- Accuracy: Closeness of the digital result to the actual input.
- Conversion time: Time required to produce one digital sample.
The microcontroller uses the ADC result and a sensor calibration equation to calculate the corresponding physical value.
Derive the resolution and digital output equations of an -bit ADC. A 12-bit ADC uses a reference. Calculate its approximate voltage resolution and output code for an input of .
An -bit ADC can represent:
possible digital levels. For an ADC range from to , the approximate voltage represented by one least significant bit is:
The digital output code can be calculated as:
For the given ADC:
The number of levels is:
The approximate voltage resolution is:
Therefore:
The output code is:
After rounding, the ADC output is approximately:
Hence, the ADC can distinguish voltage changes of approximately , and a input produces a digital code of about .
Describe the complete signal chain required to interface an analog sensor with a microcontroller.
A typical analog sensor interface contains the following stages:
- Sensing element: Converts a physical quantity, such as temperature or pressure, into an electrical parameter.
- Excitation circuit: Provides a stable voltage or current if the sensor requires external excitation. Resistive sensors are commonly used in voltage-divider or bridge circuits.
- Signal conditioning: Prepares the sensor output for conversion. It may include:
- Amplification using an operational amplifier
- Buffering for impedance matching
- Level shifting
- Linearization
- Electrical isolation
- Analog filtering: A low-pass anti-aliasing filter removes high-frequency noise before sampling.
- Input protection: Resistors, clamping diodes, and transient suppressors protect the ADC input.
- ADC: Samples and quantizes the conditioned analog voltage.
- Microcontroller processing: Converts the ADC code into a physical measurement using calibration coefficients.
- Digital filtering and communication: The result may be filtered and transmitted to an IoT gateway or cloud platform.
The conditioned voltage must remain within the ADC range:
A carefully designed signal chain improves sensitivity, accuracy, stability, and noise immunity.
Explain how an analog gas sensor can be interfaced with a microcontroller. Include calibration and safety considerations.
Many gas sensors, such as metal-oxide semiconductor sensors, change their sensing resistance when exposed to a target gas.
Interfacing procedure:
- A heater supply is provided because many gas sensors require an internal heater.
- The sensing resistance is connected with a load resistance to form a voltage divider.
- The divider output is connected to the microcontroller ADC.
- If is the circuit voltage and is the measured output, the sensing resistance may be calculated as:
- The ratio is determined, where is the sensor resistance under a specified reference condition.
- A calibration curve from the datasheet or experimental measurements is used to estimate gas concentration, commonly in parts per million.
Calibration steps:
- Allow the sensor to complete its burn-in and warm-up period.
- Determine in clean air or a known reference gas.
- Expose the sensor to known concentrations.
- Fit a curve relating to concentration.
- Compensate for temperature and humidity if necessary.
Safety and reliability considerations:
- Do not treat a low-cost sensor as a certified safety alarm unless it meets the required standard.
- Protect the ADC from voltages above its rating.
- Account for cross-sensitivity to other gases.
- Detect heater or sensor failure.
- Perform periodic recalibration because sensor characteristics drift over time.
Compare the interfacing of a thermistor, an analog temperature sensor, and a digital temperature sensor.
Thermistor:
- A thermistor changes resistance with temperature.
- It is generally connected as a voltage divider and measured by an ADC.
- For a divider with a fixed resistor , supply , and thermistor connected to ground, its resistance is:
- Temperature is obtained using a lookup table, the beta equation, or the Steinhart-Hart equation.
- It is inexpensive and sensitive but nonlinear.
Analog temperature sensor:
- Produces a voltage proportional to temperature.
- It connects directly to an ADC if its output is within the ADC range.
- For a linear sensor:
where is sensitivity in volts per degree.
- It is simpler to calculate than a thermistor but may require amplification for small signals.
Digital temperature sensor:
- Contains an internal sensing element, ADC, calibration circuit, and digital interface.
- It communicates through I2C, SPI, or 1-Wire.
- It provides better integration and simpler wiring to the ADC stage but generally has a higher cost and protocol overhead.
The choice depends on cost, accuracy, temperature range, power consumption, calibration requirements, and available microcontroller interfaces.
Describe the operating principles and interfacing methods of resistive and capacitive humidity sensors.
Resistive humidity sensors change electrical resistance as relative humidity changes. Their sensing layer absorbs water vapor, altering ionic conductivity.
- They are measured using a voltage divider or resistance-measurement circuit.
- Alternating excitation may be used to reduce polarization and electrode degradation.
- Their response may be nonlinear and affected by temperature.
Capacitive humidity sensors use a moisture-sensitive dielectric material between conductive electrodes. Absorbed water changes the dielectric constant and therefore the capacitance:
where is dielectric permittivity, is electrode area, and is separation.
Capacitance can be measured using:
- An RC timing circuit
- An oscillator whose frequency varies with capacitance
- A capacitance-to-digital converter
- A dedicated sensor interface IC
Modern digital humidity sensors usually integrate a capacitive element, temperature sensor, ADC, calibration memory, and I2C or similar interface.
For accurate humidity measurement:
- Allow air circulation around the sensor.
- Avoid direct condensation.
- Apply temperature compensation.
- Follow the specified response time.
- Protect the sensor from dust and chemical contamination without blocking moisture transfer.
Explain the interfacing of a bridge-based pressure sensor with an ADC. Why are amplification and calibration required?
A bridge-based pressure sensor commonly uses four piezoresistive elements arranged as a Wheatstone bridge. Applied pressure changes the resistances and produces a small differential output voltage.
The bridge output can be represented approximately as:
where is pressure sensitivity, is applied pressure, is bridge excitation voltage, and is offset voltage.
Interfacing stages:
- Supply the bridge using a stable excitation voltage or current.
- Connect the differential output to an instrumentation amplifier.
- Select gain so that the maximum sensor output uses most of the ADC range.
- Apply a low-pass filter to reduce noise.
- Connect the amplifier output to a single-ended ADC, or use a differential ADC.
- Convert the ADC result to pressure using calibration coefficients.
Amplification is required because bridge outputs are often only a few millivolts. Direct connection would use only a small portion of the ADC range and result in poor effective resolution.
Calibration is required to correct:
- Zero-pressure offset
- Sensitivity or span error
- Bridge imbalance
- Temperature dependence
- Mechanical nonlinearity
Two-point calibration corrects offset and gain, while multipoint calibration can also compensate for nonlinearity.
Compare inductive, capacitive, infrared, and ultrasonic proximity sensors in terms of operation and applications.
Inductive proximity sensor:
- Produces an electromagnetic field and detects eddy-current losses caused by a nearby metal object.
- Detects only metallic targets.
- Offers reliable operation in dusty and industrial environments.
- Commonly used for machine position detection.
Capacitive proximity sensor:
- Detects a change in capacitance caused by a nearby object.
- Can detect metals, liquids, plastics, powders, and other dielectric materials.
- It is sensitive to moisture and environmental contamination.
Infrared proximity sensor:
- Emits infrared light and measures reflected light or beam interruption.
- It is inexpensive and provides fast detection.
- Its performance is affected by target color, surface reflectivity, sunlight, and dust.
Ultrasonic proximity sensor:
- Emits an ultrasonic pulse and measures echo travel time.
- Distance is calculated as:
- It detects many object materials and provides distance rather than simple presence information.
- Its performance can be influenced by air temperature, soft surfaces, target angle, and acoustic interference.
The appropriate sensor is selected according to target material, required range, environmental conditions, response time, power consumption, and cost.
Distinguish between I2C, SPI, UART, and 1-Wire interfaces for connecting digital sensors to an IoT controller.
I2C:
- Uses two lines: serial data and serial clock.
- Supports multiple addressed devices on the same bus.
- Requires pull-up resistors.
- Suitable for short-distance, moderate-speed sensor networks on a circuit board.
SPI:
- Typically uses clock, controller-output, controller-input, and one chip-select line per device.
- Provides high speed and full-duplex communication.
- Requires more pins than I2C.
- Suitable for high-rate ADCs and sensors.
UART:
- Uses transmit and receive lines and does not require a shared clock.
- Both devices must use matching parameters such as baud rate and frame format.
- Useful for modules such as GPS receivers and serial gas sensors.
1-Wire:
- Uses a single data line plus ground.
- Devices may have unique addresses, allowing multiple sensors on one bus.
- Supports low wiring complexity but generally offers lower speed.
- Some devices can obtain parasitic power from the data line.
Selection depends on data rate, number of sensors, wiring distance, available pins, energy consumption, protocol support, and required reliability.
Explain the importance of sampling frequency and anti-aliasing in sensor data acquisition. State the Nyquist sampling condition.
Sampling converts a continuous sensor signal into a sequence of discrete measurements. The sampling frequency must be high enough to capture the fastest meaningful variations in the signal.
For a band-limited signal with maximum frequency , the Nyquist condition is:
where is the sampling frequency.
If this condition is violated, aliasing occurs. High-frequency components then appear as incorrect lower-frequency components in the sampled data. Once aliasing occurs, it generally cannot be removed by later digital filtering.
An analog anti-aliasing low-pass filter is therefore placed before the ADC. It attenuates signal and noise components above the desired bandwidth.
In practical systems, is selected higher than the theoretical Nyquist rate because real filters do not have an abrupt cutoff. For example, a sensor signal with useful content up to may be sampled at after suitable analog filtering.
A very high sampling rate is not always desirable because it increases processor activity, memory use, communication load, and energy consumption. The sampling frequency should therefore balance signal fidelity and resource usage.
Describe sensor calibration and explain offset, gain, nonlinearity, hysteresis, drift, and repeatability errors.
Calibration is the process of comparing a sensor output with a known reference and determining the relationship between the measured signal and the actual physical quantity.
For a linear sensor, a calibration model may be written as:
where is raw sensor output, is the gain correction, is the offset correction, and is the calibrated value.
Important errors include:
- Offset error: A constant difference between the indicated and true values.
- Gain error: An incorrect slope or sensitivity after offset is removed.
- Nonlinearity: Deviation of the sensor response from the selected straight-line model.
- Hysteresis: Different outputs for the same input depending on whether the input is increasing or decreasing.
- Drift: Gradual change in output over time despite a constant input.
- Repeatability error: Variation among repeated measurements under identical conditions.
Calibration procedure:
- Apply one or more accurately known input values.
- Record raw sensor outputs.
- Determine offset, gain, or polynomial coefficients.
- Store the coefficients in nonvolatile memory.
- Apply corrections in firmware.
- Validate the sensor using independent test points.
Periodic recalibration may be required because aging and environmental conditions can change sensor behavior.
Explain the major low-power sensor operation strategies used in battery-powered IoT systems.
Major strategies for reducing sensor-node energy consumption include:
- Duty cycling: Keep the sensor and processor asleep most of the time and activate them only for measurement.
- Power gating: Disconnect sensor power using a transistor or load switch when the sensor is not required.
- Low-power modes: Use sleep, standby, or shutdown modes provided by sensors and microcontrollers.
- Adaptive sampling: Reduce the sampling rate when measurements are stable and increase it when rapid changes are detected.
- Event-driven sensing: Wake the system only when an interrupt, threshold crossing, or motion event occurs.
- Batching: Store several measurements and transmit them together to reduce radio start-up overhead.
- Local processing: Filter or summarize data locally so that fewer bytes are transmitted.
- Efficient interfaces: Use suitable clock rates, disable pull-ups when possible, and avoid leaving communication peripherals active.
- Voltage and frequency scaling: Operate the controller at the lowest voltage and speed that meet timing requirements.
- Efficient sensor selection: Choose sensors with low active current, low standby current, and short start-up time.
The average power is:
where and are the duty fraction and power of operating state . In many IoT nodes, reducing radio transmissions provides a larger energy saving than reducing computation.
A sensor consumes for during each measurement and while sleeping. It takes one measurement every . Calculate the duty cycle and average current. Estimate ideal battery life using a battery.
The measurement period is:
The active time is:
Therefore, the active duty cycle is:
Thus, the duty cycle is:
The sleep current is:
The average current is:
Substituting the values:
Therefore:
The ideal battery life is:
In days:
Thus, the ideal battery life is approximately 137 days. Actual life will be lower because of battery self-discharge, voltage-converter losses, temperature, radio activity, and battery capacity variation.
Discuss the design trade-offs involved in power gating a sensor in a low-power IoT node.
Power gating disconnects a sensor from its supply when it is not being used. Although it can greatly reduce sleep current, the following trade-offs must be considered:
- Warm-up time: Some sensors require milliseconds, seconds, or minutes to stabilize after power is applied.
- Warm-up energy: Frequent power cycling may consume more energy than leaving the sensor in standby.
- Measurement quality: Readings taken before stabilization may be inaccurate.
- Configuration loss: Register settings may be lost and must be rewritten after every power-up.
- Inrush current: Charging internal and external capacitors can produce current spikes.
- Signal back-powering: An active communication or analog line can unintentionally power an unpowered sensor through protection diodes.
- Switch losses: The load switch or MOSFET introduces resistance and leakage.
- Sensor life: Some sensing elements, especially heated gas sensors, may not tolerate rapid power cycling or may need continuous operation.
If the sensor consumes in standby, the energy saved during an off interval is approximately . Power gating is beneficial only when this saving exceeds the start-up and reconfiguration energy.
Good design practices include placing interface pins in a high-impedance state, using load switches with low leakage, observing start-up delays, and validating the first measurement after power-up.
Define a simple moving average filter and derive its equation for a window of samples. Explain how it reduces sensor noise.
A simple moving average filter replaces each sample with the arithmetic mean of the most recent input samples.
If the input samples are , the filtered output is:
For example, with :
An efficient recursive implementation is obtained by subtracting the oldest sample and adding the newest sample:
This method requires a buffer containing the last samples but avoids calculating the entire sum again.
The filter reduces random, zero-mean, uncorrelated noise because positive and negative noise variations tend to cancel during averaging. If each sample has independent noise variance , the output noise variance is approximately:
Therefore, the noise standard deviation is reduced to:
A larger window produces stronger smoothing, but it also increases delay and reduces the ability to follow rapid sensor changes.
Apply a 4-sample moving average filter to the sequence . Calculate all valid filtered outputs and interpret the result.
For a 4-sample moving average, the filter output is:
The first valid output uses the samples :
The second valid output uses :
The third valid output uses :
Therefore, the valid filtered sequence is:
Interpretation:
- The original sequence contains short-term variations between adjacent samples.
- The filtered sequence changes more smoothly.
- A single high or low sample has less influence because it is averaged with three neighboring samples.
- The output starts only after four samples have been collected, unless a special initialization method is used.
- The smoothing also introduces delay, so the filtered output responds more slowly to a genuine sudden change.
Analyze the effect of moving-average window size on noise suppression, delay, memory, and signal bandwidth.
The window size determines the behavior of a moving average filter.
When is increased:
- More samples are averaged, so random noise is reduced more strongly.
- For independent noise, the output standard deviation is approximately reduced by a factor of .
- More memory is required to store old samples in an efficient implementation.
- The output responds more slowly to real changes.
- The filter bandwidth becomes narrower, so rapid variations are attenuated.
- Delay increases. The approximate group delay of an -sample moving average is:
where is the sampling interval.
When is decreased:
- The response becomes faster.
- Less memory is needed.
- More measurement noise remains in the output.
- Rapid variations are preserved more effectively.
The window should therefore be selected according to the dynamics of the physical process. Slowly changing temperature data can use a relatively large window, whereas motion or safety-critical event detection requires a smaller window to avoid excessive delay.
Derive and explain the prediction and update equations of a one-dimensional Kalman filter for a sensor measuring a slowly varying quantity.
Consider a scalar system described by:
where is the true state, is the measurement, is the state-transition factor, maps the state to the measurement, is process noise with variance , and is measurement noise with variance .
For a directly measured, slowly varying quantity, and are commonly used.
1. State prediction:
This estimates the current state before using the new measurement.
2. Error covariance prediction:
The process-noise variance increases uncertainty because the state may change between samples.
3. Kalman gain:
For :
4. State update:
The term in parentheses is the measurement innovation or residual.
5. Covariance update:
A large indicates an unreliable sensor and produces a smaller Kalman gain. A large indicates that the true state may change quickly, causing the filter to respond more strongly to new measurements.
A scalar Kalman filter has previous estimate , previous covariance , process-noise variance , measurement-noise variance , and a new measurement . Assuming , calculate the predicted estimate, Kalman gain, updated estimate, and updated covariance.
Given:
- Previous estimate:
- Previous covariance:
- Process-noise variance:
- Measurement-noise variance:
- Measurement:
1. Predicted estimate:
2. Predicted covariance:
3. Kalman gain:
4. Measurement residual:
5. Updated estimate:
Thus:
6. Updated covariance:
Therefore, the filter updates the estimate from to approximately , rather than immediately accepting the noisy measurement value of .
Define analog and digital sensors. Distinguish between their interfacing requirements in an IoT sensor node.
Analog sensors produce a continuous electrical output, such as voltage, current, resistance, or capacitance, that varies with the measured physical quantity. Examples include thermistors, gas sensors, and analog pressure sensors.
Digital sensors provide measurements in a discrete digital format through interfaces such as I2C, SPI, UART, or 1-Wire. Examples include the DHT22 humidity sensor and digital temperature sensors.
Key differences:
- Signal conversion: Analog sensors generally require an ADC, whereas digital sensors contain internal conversion circuitry.
- Signal conditioning: Analog sensors may require amplification, filtering, linearization, or impedance matching. Digital sensors usually require fewer external components.
- Noise immunity: Analog signals are more susceptible to noise, especially over long connections. Digital communication provides better noise immunity.
- Microcontroller connection: Analog sensors connect to ADC input pins, while digital sensors connect to communication or GPIO pins.
- Processing: Analog sensor data must be converted into engineering units using calibration equations. Digital sensors may directly provide calibrated values.
Thus, digital sensors simplify interfacing, while analog sensors offer flexibility and may be more suitable for simple or low-cost sensing applications.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →