Addressable LEDs: strips and matrices lesson plan
WS2812B strips, rings and panels on the Uno: the one-wire timing, NeoPixel basics, FastLED with HSV and palettes, mapping a serpentine matrix, power budgets and injection, and a sound-reactive aurora wall for the boss.
Objectives and materials
By the end, students can
- How the WS2812B signal works, and the NeoPixel library.
- FastLED, hue and saturation, palettes and smooth blends.
- Folding a strip into a matrix, and feeding it safely.
- A light wall that dances to the room.
Materials for the whole unit
- Addressable RGB LEDs
- Arduino Uno R3
- Half breadboard
- Potentiometer
- Pushbutton
- Resistor
- 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.
One wire, many lights
How the WS2812B signal works, and the NeoPixel library.
| Lesson | Time | What students do |
|---|---|---|
| WS2812 timing: one wire, many lightsHow sixteen LEDs share one data wire: 24 bits each in GRB order at 800 kHz, each LED keeping its own and passing the rest on, and what show() costs in microseconds. | 55 min |
|
| NeoPixel basics: a fuel gaugeAdafruit_NeoPixel as a rocket fuel gauge: setPixelColor, Color, setBrightness and show, a bar from red to green on a knob, and a launch that drains it. | 50 min |
|
Materials
- Addressable RGB LEDs
- Arduino Uno R3
- Half breadboard
- Potentiometer
- Pushbutton
- Resistor
Check for understanding
Each student finishes "NeoPixel basics: a fuel gauge" 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: "Three bytes an LED".
Color like a pro
FastLED, hue and saturation, palettes and smooth blends.
| Lesson | Time | What students do |
|---|---|---|
| FastLED and HSV: a color wheelFastLED on a 16 LED ring: CRGB and CHSV, hue as one byte that wraps by itself, a spinning rainbow, and saturation on a knob from vivid down to white. | 50 min |
|
| Palettes and blendingOcean waves from a 16-color palette with linear blending, a button that crossfades to lava, forest and a custom aurora palette, and how many frames a blend takes. | 50 min |
|
Materials
- Addressable RGB LEDs
- Arduino Uno R3
- Half breadboard
- Potentiometer
- Pushbutton
- Resistor
Check for understanding
Each student finishes "Palettes and blending" 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: "A palette of your own".
Panels and power
Folding a strip into a matrix, and feeding it safely.
| Lesson | Time | What students do |
|---|---|---|
| Matrix mapping: a serpentine panelA 16x8 panel is one long strip folded into rows: an XY() function, the zigzag of a serpentine panel, and a pixel-art spaceship flying over the stars. | 50 min |
|
| Power budget and injectionWhy 128 LEDs could pull 7.7 A from a 500 mA port: adding up a frame, limiting the brightness to a budget, sizing a supply, and injecting power along a long strip. | 50 min |
|
Materials
- Addressable RGB LEDs
- Arduino Uno R3
- Half breadboard
- Potentiometer
- Pushbutton
- Resistor
Check for understanding
Each student finishes "Power budget and injection" 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: "Power injection".
Boss project
A light wall that dances to the room.
| Lesson | Time | What students do |
|---|---|---|
| Boss: a reactive light wallAn aurora light wall that listens: green and violet curtains over the stars that climb with the sound level from a KY-038, and a meteor on every clap. | 65 min |
|
Materials
- Addressable RGB LEDs
- Arduino Uno R3
- Half breadboard
- Resistor
- Sound sensor, KY-038
Check for understanding
Each student finishes "Boss: a reactive light wall" 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 your wall".
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.