Sampling, PWM & Conversion
Use this page to revise how analogue reality becomes numbers — and how numbers become analogue-ish outputs.
Sampling
The ADC converts a voltage to an integer. Nyquist: sample faster than twice the highest frequency you care about, or you alias. Resolution (bits) and reference voltage set the step size.
PWM
Pulse-width modulation encodes a value in duty cycle (fraction of time high). Averaged with a motor or LED inertia it looks like analogue. Frequency vs. duty cycle are different knobs.
DAC and drivers
A DAC outputs a voltage. Many MCUs fake analogue with PWM instead. Power devices still need a driver; PWM into a MOSFET gate is not the same as PWM into a speaker without a filter.
Starting Points
Key Points
- You can explain what an ADC reading means given Vref and bit width.
- You can state the Nyquist idea and what aliasing is.
- You can define PWM duty cycle and give one use (LED brightness, servo, motor).
- You can explain why a driver stage is needed between an MCU pin and a motor.