Electronics & Circuits · Study deck

Analog-Digital Boundaries: Signal Contracts

An ADC value is not trustworthy until its bandwidth, filter, rate, and time window are named.

Voltage Vera is your guide for this deck.

analogdigitalnyquist
Voltage Vera, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Specify an analog-to-digital contract with bandwidth, filter, rate, and duration.
  • Diagnose aliasing caused by marginal rates and missing filters.
  • Distinguish amplitude quantization from time sampling in an IoT signal chain.
  • Explain why digitizing near the sensor can make a long cable more robust.
iotclass.org

Major section

Analog-Digital Signal Boundary Contracts

Sampling rate means how often a signal is measured.

  • Firmware is the code stored on the device.
  • Modulation means changing a signal to carry or control information.
  • Pulse width modulation (PWM) is a timed on-and-off output used to imitate a changing level.
  • These trials do not capture every source of drift or timing error.

Why it matters

Debugging mixed-signal hardware is easier when you always know whether the signal in front of you is analog or digital, because each domain fails differently and responds to different fixes.

Signal-processing boundary map linking sampling, conversion, filtering, frequency analysis, and signal quality.
Signal-processing boundary map linking sampling, conversion, filtering, frequency analysis, and signal quality.
iotclass.org

Major section

Analog-Digital Signal Boundary Contracts (continued)

A microcontroller is digital: it works with a finite set of numbers, updated at discrete instants.

  • The boundary must decide what range, step size, noise margin, and sampling rate are acceptable before firmware treats the value as truth.
  • Here, 50.0 mV means 5.00°C of analog error but uses only 12.5% of a 400 mV digital margin.
  • Quantization (amplitude) A continuous voltage is snapped to one of a finite set of levels.
iotclass.org

Major section

Analog-Digital Signal Boundary Contracts (continued)

Almost every physical quantity a sensor measures — temperature, pressure, light, sound, acceleration — is analog: continuous in both time and amplitude, taking infinitely many values that change smoothly.

  • An N -bit converter has 2^N levels, so the smallest step it can represent is one LSB.
  • Sampling (time) The signal is measured only at discrete instants, fs times per second.
  • Between samples, the digital record simply has no information.
  • The amplitude side is a rounding contract.
iotclass.org

Major section

Analog-Digital Signal Boundary Contracts (continued)

The boundary contract names those failure modes while the design is still reviewable.

  • A digital HIGH/LOW is read with margin, so noise below that margin is rejected.
  • The payoff: regeneration Each digital stage re-decides 0 or 1 and outputs a clean signal, so error does not accumulate.
  • An analog chain has no such boundary.
iotclass.org

Major section

Analog-Digital Signal Boundary Contracts (continued)

That agreement, plus margin, is the entire source of noise immunity.

  • The boundary contract becomes easier to audit when its amplitude and timing decisions sit on one map.
  • The dashed dependencies show why those choices cannot be isolated: sampling rate sets FFT resolution, while filtering improves SNR.
  • Digital regeneration is a separate but related contract.
iotclass.org

Major section

Analog-Digital Signal Boundary Contracts (continued)

The map therefore turns “digitize early” into a qualified rule—the analogue boundary still needs an anti-aliasing filter, and the chosen rate and bit depth must preserve the evidence the application needs.

  • The contract is therefore not "analog bad, digital good." It is a handoff rule.
  • At the ADC, it deliberately chooses what amplitude steps and time points will survive.
  • That error is acceptable only if it is smaller than the measurement tolerance.
iotclass.org

Major section

Analog-Digital Signal Boundary Contracts (continued)

If any one of those is implicit, teams debug symptoms instead of the boundary.

  • After the ADC, the design must protect codes, timestamps, calibration metadata, and validity flags.
  • A later dashboard can only be as trustworthy as the weakest boundary in that chain.
  • Firmware means the program stored on a device to control its hardware.
iotclass.org

Major section

Analog-Digital Signal Boundary Contracts (continued)

A "digital" signal is still physically an analog voltage — a 3.3 V logic HIGH is a real 3.3 V.

  • If they are explicit, the oscilloscope trace, ADC register value, packet field, and cloud record can be compared against the same contract.
  • Digitizing does not make a signal perfect — it makes its error bounded and known.
  • The bytes are not wrong; the decoder forgot signedness, width, byte order, or scale.
iotclass.org

Major section

Analog-Digital Signal Boundary Contracts (continued)

An ideal unipolar ADC with N bits and reference Vref maps a range of input voltages onto 2^N codes, so the unavoidable conversion uncertainty is about half a code step.

  • A receiver does not preserve the exact analog waveform on the wire; it promises to classify voltages below the LOW threshold as 0 and voltages above the HIGH threshold as 1.
  • Noise that stays inside the margin is discarded at the decision point, and the next driver emits a fresh clean LOW or HIGH.
  • The mathematical gist.: A 12-bit two's-complement field has 4,096 codes.
iotclass.org

Major section

Analog-Digital Signal Boundary Contracts (continued)

Noise that crosses the threshold is no longer "small analog error" — it has become a wrong bit, which is why checksums, retries, and timing margins still matter.

  • Each amplifier, connector, and long trace adds its own noise, offset, and distortion, and those errors accumulate with every stage — there is no point at which the signal is re-decided and cleaned.
  • An analog-to-digital converter means the circuit that turns a measured voltage into a number; it is shortened to ADC.
  • Signed decoding fails when firmware performs the right operation at the wrong stage.
iotclass.org

Deck summary

Key takeaways

Sampling rate means how often a signal is measured.

  • A microcontroller is digital: it works with a finite set of numbers, updated at discrete instants.
  • Almost every physical quantity a sensor measures — temperature, pressure, light, sound, acceleration — is analog: continuous in both time and amplitude, taking infinitely many values that change smoothly.
  • The boundary contract names those failure modes while the design is still reviewable.
  • That agreement, plus margin, is the entire source of noise immunity.
iotclass.org

Retrieval practice

Recall check 1 of 6

Voltage Vera says: answer from memory, then check your reasoning.

Q1Why do robust IoT sensor designs convert an analog reading to digital as close to the sensor as possible?

ADigital signals travel faster than analog signals through copper.
BConverting to digital increases the sensor's measurement accuracy beyond its analog limit.
COnce a reading is a digital number, small voltage noise can no longer change it.
DDigital circuits do not use any voltage, so noise cannot affect them.
Show answer

Answer: C Digitizing at the source captures the value before a long wire adds noise; digital signals are read with margin and regenerated, so they do not degrade the way an analog voltage does.

iotclass.org

Retrieval practice

Recall check 2 of 6

Voltage Vera says: answer from memory, then check your reasoning.

Q2A digital signal is called 'noise-immune,' yet the wire physically carries ordinary analog voltages. What actually provides the immunity?

AThe receiver decides HIGH or LOW using thresholds with margin and regenerates a clean output
BDigital wires carry no voltage, so there is nothing for noise to disturb.
CDigital transmission is completely free of noise on the wire.
DDigital signals always use a higher voltage that overpowers any noise.
Show answer

Answer: A The analog voltage still exists, but sub-margin perturbations do not change the decoded bit, and regeneration at each stage stops error from accumulating.

iotclass.org

Retrieval practice

Recall check 3 of 6

Voltage Vera says: answer from memory, then check your reasoning.

Q3A 12-bit two's-complement temperature sensor (0.0625 degC/LSB) returns 0xFFF, but the firmware prints +255.94 degC instead of a small negative temperature. What went wrong?

AThe 12-bit value was treated as unsigned
BThe sensor is broken and should be replaced.
CThe 0.0625 degC/LSB scale factor is wrong.
DThe I2C read returned the bytes in the wrong order.
Show answer

Answer: A 0xFFF is -1 in 12-bit two's complement (-0.0625 degC). Read as unsigned it is 4095, and 4095 x 0.0625 = 255.94 degC. The fix is to sign-extend bit 11 before scaling.

iotclass.org

Retrieval practice

Recall check 4 of 6

Voltage Vera says: answer from memory, then check your reasoning.

Q4What happens when you sample a 2 kHz signal at 3 kHz (below the Nyquist rate of 4 kHz)?

ASignal is perfectly reconstructed
BAliasing occurs -- the signal appears as 1 kHz instead of 2 kHz
CThe signal is lost completely
DThe sampling rate is adequate since 3 kHz > 2 kHz
Show answer

Answer: B The Nyquist minimum is 2 x 2 kHz = 4 kHz.

iotclass.org

Retrieval practice

Recall check 5 of 6

Voltage Vera says: answer from memory, then check your reasoning.

Q5An audio IoT device samples a microphone signal at 8 kHz (telephone quality). A nearby machine emits a 6 kHz tone that appears in the recorded audio as a 2 kHz tone. What phenomenon is this, and how should it be prevented?

AHarmonic distortion from the microphone -- use a higher quality microphone
BAliasing
CQuantization noise from insufficient ADC bit depth
DIntermodulation distortion between the machine tone and the sampling clock
Show answer

Answer: B This is classic aliasing.

iotclass.org

Retrieval practice

Recall check 6 of 6

Voltage Vera says: answer from memory, then check your reasoning.

Q6Which of the following best describes the purpose of oversampling in IoT sensor design?

ATo increase the maximum frequency the ADC can digitize
BTo eliminate the need for any analog filtering
CTo give anti-alias filter margin and improve effective SNR
DTo reduce the ADC's power consumption per sample
Show answer

Answer: C Oversampling provides margin for anti-aliasing filter roll-off and improves effective SNR by ~3 dB per doubling of the sampling rate.

iotclass.org

Print reference

Answers 1 of 2

Answer key.

  1. C · Digitizing at the source captures the value before a long wire adds noise; digital signals are read with margin and regenerated, so they do not degrade the way an analog voltage does.
  2. A · The analog voltage still exists, but sub-margin perturbations do not change the decoded bit, and regeneration at each stage stops error from accumulating.
iotclass.org

Print reference

Answers 2 of 2

Answer key.

  1. A · 0xFFF is -1 in 12-bit two's complement (-0.0625 degC). Read as unsigned it is 4095, and 4095 x 0.0625 = 255.94 degC. The fix is to sign-extend bit 11 before scaling.
  2. B · The Nyquist minimum is 2 x 2 kHz = 4 kHz.
  3. B · This is classic aliasing.
  4. C · Oversampling provides margin for anti-aliasing filter roll-off and improves effective SNR by ~3 dB per doubling of the sampling rate.
iotclass.org