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.

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.
Major section
Analog-Digital Signal Boundary Contracts
That value is not trustworthy until the signal's bandwidth, the range of frequencies to measure, is known.
- 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.
- These trials do not capture every source of drift or timing error.
Major section
Analog-Digital Signal Boundary Contracts (continued)
Between samples, the digital record simply has no information.
- Pulse width modulation (PWM) is a timed on-and-off output used to imitate a changing level.
- The boundary must decide what range, step size, noise margin, and sampling rate are acceptable before firmware treats the value as truth.
- This gives the rate a sound highest frequency.
Major section
Analog-Digital Signal Boundary Contracts (continued)
The anti-alias filter limits what can reach the ADC.
- Here, 50.0 mV means 5.00°C of analog error but uses only 12.5% of a 400 mV digital margin.
- A microcontroller is digital: it works with a finite set of numbers, updated at discrete instants.
- The amplitude side is a rounding contract.
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.
- Quantization (amplitude)A continuous voltage is snapped to one of a finite set of levels.
- 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.
Major section
Analog-Digital Signal Boundary Contracts (continued)
A digital HIGH/LOW is read with margin, so noise below that margin is rejected.
- The payoff: regenerationEach digital stage re-decides 0 or 1 and outputs a clean signal, so error does not accumulate.
- Bit depth sets a separate limit on small changes in level.
- Digital regeneration is a separate but related contract.
Major section
Analog-Digital Signal Boundary Contracts (continued)
The units show the Nyquist bound: two samples per cycle times fmax cycles per second gives 2fmax samples per second.
- Rate and bit depth must therefore follow the filter and the proof the app needs to keep.
- 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.
- An analog chain has no such boundary.
Major section
Analog-Digital Signal Boundary Contracts (continued)
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.
- The boundary contract names those failure modes while the design is still reviewable.
- That agreement, plus margin, is the entire source of noise immunity.
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 any one of those is implicit, teams debug symptoms instead of the boundary.
- If they are explicit, the oscilloscope trace, ADC register value, packet field, and cloud record can be compared against the same contract.
- That error is acceptable only if it is smaller than the measurement tolerance.
Major section
Signed Sensor Decoding Contracts
The bytes are not wrong; the decoder forgot signedness, width, byte order, or scale.
- An analog-to-digital converter means the circuit that turns a measured voltage into a number; it is shortened to ADC.
- Firmware means the program stored on a device to control its hardware.
Major section
Signed Sensor Decoding Contracts (continued)
Quantisation still contributes q/12=0.0180°C rms, and a 1 Hz poll can only preserve real temperature content below 0.5 Hz.
- Binary Number Systems teaches place value, powers of two, ADC count ranges, and the precision limits that show up in IoT data.
- The mathematical gist: A 12-bit two's-complement field has 4,096 codes.
- Signed decoding fails when firmware performs the right operation at the wrong stage.
Major section
Sign bit · Sign extension
In an N -bit two's-complement value, bit N−1 set means negative; the range is −2^(N−1) to +2^(N−1)−1.
- Widening a signed value must copy the sign bit into the new high bits — or a negative reading turns into a huge positive one.
- The expected signed outputs are 0, 1, 2047, -2048, and -1.
- Both results came from the same twelve bits.
Major section
Anti-Alias Filters for Signals · Sampling Rate vs Duration
A 1 Hz temperature signal sampled at 10 Hz is contaminated by 50 Hz mains hum folded to 0 Hz DC offset if no anti-aliasing filter is present.
- Sampling rate (samples per second) and sample acquisition time (how long each sample takes) are different concepts.
- The ESP32 ADC has a maximum sampling rate of approximately 100 kSps, but each conversion takes approximately 10 us.
- Triggering conversions faster than the ADC can complete them causes invalid readings.
Deck summary
Key takeaways
That value is not trustworthy until the signal's bandwidth, the range of frequencies to measure, is known.
- Between samples, the digital record simply has no information.
- The anti-alias filter limits what can reach the ADC.
- 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.
- A digital HIGH/LOW is read with margin, so noise below that margin is rejected.
Retrieval practice
Recall check 1 of 6

Voltage Vera says: answer from memory, then check your reasoning.
Q1A vibration trace looks plausible, but its sampling plan is undocumented. Which record makes the ADC result reviewable?
Show answer
Answer: B These fields tie the physical signal to the digital record.
Retrieval practice
Recall check 2 of 6

Voltage Vera says: answer from memory, then check your reasoning.
Q2An analog sensor's raw output travels a long cable to the MCU and picks up hum. An ADC next to the sensor sends the digital value over that cable, where measured interference stays below the receiver's logic noise margin. Why does this avoid the false analog reading?
Show answer
Answer: B Digitizing at the source means the long, noisy run now carries a signal read with margin, so sub-margin interference is rejected instead of being read as false analog wander.
Retrieval practice
Recall check 3 of 6

Voltage Vera says: answer from memory, then check your reasoning.
Q3The 8-bit pattern 1111 1111 is read two ways. What are its unsigned and two's-complement signed values?
Show answer
Answer: D All-ones is the maximum 255 when unsigned, and -1 in two's complement (the pattern just below zero, since adding 1 wraps to 0).
Retrieval practice
Recall check 4 of 6

Voltage Vera says: answer from memory, then check your reasoning.
Q4A register read gives a 12-bit two's-complement code as an unsigned value 'raw' (0 to 4095). Which expression correctly converts it to a signed integer?
Show answer
Answer: D If bit 11 is set (raw >= 2048 = 2^11), the value is negative, recovered by subtracting 2^12 = 4096; otherwise it is already the positive value.
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?
Show answer
Answer: A This is classic aliasing.
Retrieval practice
Recall check 6 of 6

Voltage Vera says: answer from memory, then check your reasoning.
Q6For a fixed sensor signal band with credible out-of-band interference, and suitable averaging or decimation after conversion, which purpose of oversampling best supports a practical ADC design?
Show answer
Answer: D Oversampling provides margin for analog anti-alias filter roll-off.
Print reference
Answers 1 of 2
Answer key.
- B · These fields tie the physical signal to the digital record.
- B · Digitizing at the source means the long, noisy run now carries a signal read with margin, so sub-margin interference is rejected instead of being read as false analog wander.
- D · All-ones is the maximum 255 when unsigned, and -1 in two's complement (the pattern just below zero, since adding 1 wraps to 0).
Print reference
Answers 2 of 2
Answer key.
- D · If bit 11 is set (raw >= 2048 = 2^11), the value is negative, recovered by subtracting 2^12 = 4096; otherwise it is already the positive value.
- A · This is classic aliasing.
- D · Oversampling provides margin for analog anti-alias filter roll-off.