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.

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.

LessonTimeWhat students do
Microphone levelsSample 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
  1. Sound as numbers
  2. A loud room
  3. A clap
  4. The line in
  5. Mute the treble
Bands with FFTSplit 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
  1. Bins
  2. Two notes
  3. Bands, an octave apart
  4. Move the bass
  5. 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.

LessonTimeWhat students do
Beat flashFind 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
  1. Louder than usual
  2. Clap
  3. Flash
  4. Tempo
Matrix barsDraw 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
  1. A spectrum analyzer
  2. Two bars
  3. Count the LEDs
  4. 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.

LessonTimeWhat students do
Color themesColor 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
  1. Fire
  2. Ocean
  3. Rainbow
  4. Same bars, new colors
Project: a party wallEverything 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
  1. Turn it on
  2. Auto gain
  3. Beats on top
  4. Pick a theme
  5. 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.