Source: https://mokxi.com/teachers/plans/dsp-on-microcontrollers
Updated: 2026-11-19

Lesson plan

# Digital signal processing lesson plan

Signals into numbers and back, on the Uno and the ESP32: sampling and aliasing, moving averages and FIR filters, IIR filters, the FFT, windows and leakage, pitch and beat detection, and a guitar tuner on a microphone and a TFT.

4 chapters, 7 lessons, about 7 hours, on the Arduino Uno R3. Every lesson runs in the browser, with nothing to install.

Start a class from this course

The unit

## Objectives and materials

### By the end, students can

- What a fixed sample rate can see, and what it gets wrong.
- Moving average, FIR and IIR, measured on real hum and steps.
- The FFT, windows, and finding pitch and beat.
- A guitar tuner from microphone to needle.

### Materials for the whole unit

- Arduino Uno R3
- ESP32 DevKit V1
- Function generator x 2
- I2S microphone, INMP441
- Oscilloscope
- Resistor x 2
- TFT display, 240x320

Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.

Chapter 1. About 1 h 5 min

## Sampling

What a fixed sample rate can see, and what it gets wrong.

Lesson | Time | What students do

Sampling and Nyquist An Uno samples a signal generator at exactly 1000 Hz and finds the frequency in its samples: right up to 500 Hz, and a false, lower one above it. Aliasing, seen and measured. | 65 min

- How fast can an Uno sample?
- Samples on a clock
- Close to the limit
- An alias
- Folded all the way down
- Sample faster
- The anti-aliasing filter

### Materials

- Arduino Uno R3
- Function generator
- Oscilloscope

### Check for understanding

Each student finishes "Sampling and Nyquist" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "The anti-aliasing filter".

Chapter 2. About 1 h 50 min

## Filters

Moving average, FIR and IIR, measured on real hum and steps.

Lesson | Time | What students do

Moving average and FIR A slow sensor with mains hum on top, at 500 samples a second: a 10-point moving average that cancels 50 Hz exactly, a 15-tap FIR low-pass, and what happens at 60 Hz. | 55 min

- A sensor with hum
- The moving average
- An FIR low-pass
- American hum
- Designing an FIR
- Fit the hum

IIR filters The exponential moving average: one line, one variable, and a memory that never quite forgets. Its time constant measured on a square wave, and the trade between smoothing and lag. | 55 min

- A filter with a memory of one
- The time constant
- Up and down alike
- Infinite, but fading
- Smoother and slower
- Which filter when

### Materials

- Arduino Uno R3
- Function generator x 2
- Oscilloscope
- Resistor x 2

### Check for understanding

Each student finishes "IIR filters" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Which filter when".

Chapter 3. About 3 h 5 min

## The spectrum

The FFT, windows, and finding pitch and beat.

Lesson | Time | What students do

The FFT 128 samples at 4000 Hz through arduinoFFT on an Uno: bins 31.25 Hz apart, the biggest one is the pitch, a square wave shows its odd harmonics, and a tone above Nyquist folds into the spectrum. | 65 min

- From time to frequency
- The biggest bin
- The harmonics of a square wave
- High in the spectrum
- Folded into the spectrum
- Finer bins
- What the FFT is for

Windowing A tone between two bins smears across the whole spectrum. The same capture through the FFT with no window and with a Hamming window, and the leakage eight bins away measured both ways. | 55 min

- One capture, two spectra
- Leakage
- A window
- A tone on a bin
- A family of windows
- Try Blackman

Pitch and beat detection Autocorrelation finds the pitch of a note on A0 whatever its wave shape, and an onset detector on A1 finds a drum’s beat and its tempo, measuring pitch in the quiet between beats. | 65 min

- A note and a drum
- Autocorrelation
- Any shape
- Onsets
- Tempo
- Speed up the drum
- Octave errors

### Materials

- Arduino Uno R3
- Function generator x 2
- Oscilloscope

### Check for understanding

Each student finishes "Pitch and beat detection" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Octave errors".

Chapter 4. About 1 h 10 min

## Boss project

A guitar tuner from microphone to needle.

Lesson | Time | What students do

Boss: a guitar tuner An ESP32 listens through an INMP441, decimates, autocorrelates, names the nearest guitar string and shows the cents on an ILI9341 with a needle that turns green in tune. | 70 min

- Tuner on
- The screen
- The A string
- The low E
- Sharp
- Flat
- Tune to 432
- Make it yours

### Materials

- ESP32 DevKit V1
- I2S microphone, INMP441
- TFT display, 240x320

### Check for understanding

Each student finishes "Boss: a guitar tuner" on their own, without opening the hints. The simulator checks 8 of its 8 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Make it yours".

Your class

## Teach this unit as a class

Start a class from this course and its 7 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.

The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.

Start a class from this course See the demo class

More units

## Other lesson plans

Electronics basics 20 lessons, about 10 h. Embedded on the Arduino Uno 16 lessons, about 12 h. Embedded on the ESP32-C3 13 lessons, about 11 h. Embedded on the Raspberry Pi Pico 7 lessons, about 6 h. Build your own fight stick 5 lessons, about 4 h. Embedded on the STM32F411 6 lessons, about 6 h. C++ on a board 13 lessons, about 10 h. Digital logic and memory 4 lessons, about 4 h. Interactive devices on the Uno 9 lessons, about 8 h. From gates to a computer 23 lessons, about 16 h. Build a claw machine 8 lessons, about 6 h. Every unit All the courses as ready-made units, on the teachers page.
