Guided lab · ECE 2
Sampling with a microcontroller: RMS, frequency and FFT
Feed the bench generator into a real ADC and let MicroPython do the DSP
- Time
- 50 min
- Bench
- Emona kit bench
Free. The lab opens after Google sign-in, which also keeps your progress.

What you do in this lab
The function generator drives ADC0 of a Raspberry Pi Pico running MicroPython. A program samples it at a fixed rate and prints the mean, RMS, peak-to-peak and frequency; another one runs a 256-point FFT. You will check the numbers against theory, then raise the input frequency past fs/2 and watch the FFT peak fold back (aliasing).
Objectives
- Bias an AC signal into the ADC range and convert codes to volts.
- Compute mean, RMS and frequency from samples, and check RMS = Vpp/(2√2) for a sine.
- Read an FFT: bin width fs/N, window side-lobes, amplitude of a peak.
- Predict aliases: a tone at f > fs/2 appears at |f − k·fs|.
Inside the lab
Step-by-step instructions with wiring checks, the readings you should get, questions with model answers and a short quiz. Sign in to open it.
Related labs

Microcontroller: drive a transistor and LED, read a sensor divider
A Raspberry Pi Pico runs real MicroPython on the circuit bench: its ADC reads a voltage divider on the breadboard and a GPIO pin switches an LED through an NPN transistor
45 minCircuit bench

Serial protocols 1: UART frames and errors
Generate real 8N1, 8E1 and 7O2 frames, decode them, then break them on purpose
45 minEmona kit bench

Serial protocols 2: the I²C bus
START, address, ACK, data, STOP, repeated START, NACK and clock stretching
55 minEmona kit bench

Serial protocols 3: SPI modes and chip select
Four wires, four modes: CPOL, CPHA, MOSI, MISO and CS
45 minEmona kit bench
Unofficial, free student project. Not affiliated with Emona Instruments or with any university. Emona and ETT-101 are trademarks of their owner.