Lesson plan

Build a gesture magic wand lesson plan

A wand that turns flicks into spells: angles from an MPU6050, poses, a time window and a state machine that recognize spells, LED effects, an IR cast that opens a box, and a battery that lasts.

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

  • Angles from gravity, poses past a threshold, a window that tells a flick from a tilt, and spells from a spellbook.
  • Effects on eight WS2812 LEDs, a spell of your own, and an NEC code at 38 kHz that opens a servo latch.
  • A LiPo read, budgeted and put to sleep, and a box that opens only for your secret spell.

Materials for the whole unit

  • Accelerometer and gyroscope, MPU6050
  • Addressable RGB LEDs
  • Arduino Uno R3 x 2
  • Battery: AA, coin cell, LiPo
  • Hobby servo
  • Infrared LED, 940 nm
  • Infrared receiver, VS1838B
  • Resistor

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

Gestures

Angles from gravity, poses past a threshold, a window that tells a flick from a tilt, and spells from a spellbook.

LessonTimeWhat students do
Motion as gesturesAn accelerometer in the wand’s tip feels which way is down. Turn that into angles, angles into poses, and tell a flick from a slow tilt with a time window.55 min
  1. Run it
  2. Down is a direction
  3. A flick, not a tilt
  4. Twist
  5. Tune the threshold
Recognizing spellsString flicks into spells with a tiny state machine and a pause that ends each one, look them up in a spellbook, and see how the big systems do it with dynamic time warping.55 min
  1. Lumos
  2. Nox
  3. Two moves
  4. Not a spell
  5. A faster finish

Materials

  • Accelerometer and gyroscope, MPU6050
  • Addressable RGB LEDs
  • Arduino Uno R3 x 2
  • Battery: AA, coin cell, LiPo
  • Hobby servo
  • Infrared LED, 940 nm
  • Infrared receiver, VS1838B
  • Resistor

Check for understanding

Each student finishes "Recognizing spells" 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: "A faster finish".

Chapter 2. About 1 h 30 min

Light and casting

Effects on eight WS2812 LEDs, a spell of your own, and an NEC code at 38 kHz that opens a servo latch.

LessonTimeWhat students do
Light effectsEvery spell needs a look: a white glow, darkness, a blue cast and a flickering fire on eight WS2812 LEDs, and a new spell of your own in the spellbook.45 min
  1. Lumos lights all eight
  2. Incendio
  3. Flicker
  4. Write a spell
IR castingA spell that leaves the wand: an NEC code flashed at 38 kHz through an infrared LED, decoded by the box, which opens its latch only for the right address and command.45 min
  1. Cast it
  2. The box hears it
  3. The latch
  4. Lock it again

Materials

  • Accelerometer and gyroscope, MPU6050
  • Addressable RGB LEDs
  • Arduino Uno R3 x 2
  • Battery: AA, coin cell, LiPo
  • Hobby servo
  • Infrared LED, 940 nm
  • Infrared receiver, VS1838B
  • Resistor

Check for understanding

Each student finishes "IR casting" 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: "Lock it again".

Chapter 3. About 1 h 40 min

Build it

A LiPo read, budgeted and put to sleep, and a box that opens only for your secret spell.

LessonTimeWhat students do
BatteryA wand runs on a 500 mAh LiPo. Read the cell, budget the LEDs’ current, dim when the cell runs low, and sleep when nobody is casting.55 min
  1. Read the cell
  2. The current budget
  3. Running low
  4. Sleep
  5. Wake on a flick
Project: a spell that opens a boxMake the box yours: a secret three-move spell to open it, a spell to lock it, and a wand that sleeps between uses.45 min
  1. The box
  2. A secret spell
  3. Lock it
  4. Ready for the shelf

Materials

  • Accelerometer and gyroscope, MPU6050
  • Addressable RGB LEDs
  • Arduino Uno R3 x 2
  • Battery: AA, coin cell, LiPo
  • Hobby servo
  • Infrared LED, 940 nm
  • Infrared receiver, VS1838B
  • Resistor

Check for understanding

Each student finishes "Project: a spell that opens a box" 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: "Ready for the shelf".

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.