Source: https://mokxi.com/teachers/plans/build-music-visualizer
Updated: 2026-11-19

Lesson plan

# Build a music visualizer lesson plan

Turn sound into light: levels, a fixed-point FFT into octave bands, beat detection, LED matrix bars, color themes and a party wall.

3 chapters, 6 lessons, about 5 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

- Levels, then frequencies with an FFT.
- Beats that flash, and bars that dance.
- Colors, then the whole wall.

### Materials for the whole unit

- Addressable RGB LEDs
- Arduino Uno R3
- Full-size breadboard
- Function generator x 2
- Pushbutton
- Resistor x 2
- Sound sensor, KY-038

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 50 min

## Hear the music

Levels, then frequencies with an FFT.

Lesson | Time | What students do

Microphone levels Sample sound 4000 times a second and measure it: the resting level, the RMS and the peak, and why a bare electret microphone barely moves the ADC. | 55 min

- Sound as numbers
- A loud room
- A clap
- The line in
- Mute the treble

Bands with FFT Split sound into frequencies with a 64 point FFT in whole numbers: 62.5 Hz bins, the loudest found, bins gathered into octave-wide bands, and aliasing. | 55 min

- Bins
- Two notes
- Bands, an octave apart
- Move the bass
- Aliasing

### Materials

- Addressable RGB LEDs
- Arduino Uno R3
- Full-size breadboard
- Function generator x 2
- Pushbutton
- Resistor x 2
- Sound sensor, KY-038

### Check for understanding

Each student finishes "Bands with FFT" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.

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

Chapter 2. About 1 h 30 min

## Show the music

Beats that flash, and bars that dance.

Lesson | Time | What students do

Beat flash Find the beat: a block of sound much louder than the running average flashes the panel, with a lockout, and a few beats give the tempo. | 45 min

- Louder than usual
- Clap
- Flash
- Tempo

Matrix bars Draw the spectrum on a 16 x 8 WS2812 panel: eight bands as bars two columns wide, 4 dB a LED, with peak dots that hold and fall. | 45 min

- A spectrum analyzer
- Two bars
- Count the LEDs
- Bass only

### Materials

- Addressable RGB LEDs
- Arduino Uno R3
- Full-size breadboard
- Function generator x 2
- Pushbutton
- Resistor x 2
- Sound sensor, KY-038

### Check for understanding

Each student finishes "Matrix bars" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.

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

Chapter 3. About 1 h 40 min

## Throw the party

Colors, then the whole wall.

Lesson | Time | What students do

Color themes Color the bars three ways on a button: fire and ocean by height, rainbow by column on a hue wheel, every color worked out per LED. | 45 min

- Fire
- Ocean
- Rainbow
- Same bars, new colors

Project: a party wall Everything at once: bars, themes, a beat flash from the microphone, and an automatic gain so quiet and loud music both fill the wall. | 55 min

- Turn it on
- Auto gain
- Beats on top
- Pick a theme
- Share the wall

### Materials

- Addressable RGB LEDs
- Arduino Uno R3
- Full-size breadboard
- Function generator x 2
- Pushbutton
- Resistor x 2
- Sound sensor, KY-038

### Check for understanding

Each student finishes "Project: a party wall" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.

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

Your class

## Teach this unit as a class

Start a class from this course and its 6 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.
