UNIT 11 · MOVING AND PROCESSING DATA

Analog Signals and Conversion

Turn voltages into numbers, and numbers back into voltages.

6 lessons24 guided experiments35 min full read

Temperature, light, current, sound and position all reach firmware as voltages, and an analog-to-digital converter turns them into numbers at chosen instants. Each step can quietly lose information: a signal sampled too slowly turns into a different one, a 12-bit converter delivers fewer than 12 useful bits, a high-impedance sensor leaves the sample capacitor half charged, and a software-timed loop smears the timing. The same care applies on the way out, when PWM or a DAC turns numbers back into voltages.

Start with lesson 1 →

The unit in six ideas

  1. 1A sampled signal is described completely only if it contains nothing above the Nyquist frequency f_s / 2.
  2. 21 LSB = Vref / 2^N; code = ⌊Vin / Vref × 2^N⌋, limited to 2^N − 1.
  3. 3Every code is a fraction of Vref: reference errors are gain errors in every reading.
  4. 4Start conversions from a timer or run the ADC free; software-timed sampling carries all the code’s jitter.
  5. 5A moving average of N reduces random noise by √N and delays a step by (N − 1)/2 samples.
  6. 6Filtered PWM gives D × V_supply plus ripple ≈ V_supply D(1 − D) T / τ for T ≪ τ.

Lessons

  1. LESSON 01 · 4 EXPERIMENTS · 6 MIN

    Sampling, Aliasing, and Bandwidth

    How can an ADC report a frequency that is not there, and how do you stop it?

  2. LESSON 02 · 4 EXPERIMENTS · 6 MIN

    Resolution, Quantization, and Accuracy

    What does “12 bits” actually promise?

  3. LESSON 03 · 4 EXPERIMENTS · 6 MIN

    References, Input Impedance, and Acquisition Time

    What are the ADC’s reference and input really doing?

  4. LESSON 04 · 4 EXPERIMENTS · 5 MIN

    Triggered Sampling and Conversion Sequences

    Getting samples at the right moments and out of the ADC in time: software-started, free-running and timer-triggered conversions, why sampling-time jitter limits accuracy, sequences and round-robin scans over several inputs and the skew between them, and collecting results through FIFOs, interrupts and DMA without overruns.

  5. LESSON 05 · 4 EXPERIMENTS · 6 MIN

    Digital Filtering and Sensor Calibration

    How do you tell them apart, and fix each?

  6. LESSON 06 · 4 EXPERIMENTS · 6 MIN

    Analog Outputs and PWM Filtering

    Where is the balance?