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.
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.
Gestures
Angles from gravity, poses past a threshold, a window that tells a flick from a tilt, and spells from a spellbook.
| Lesson | Time | What 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 |
|
| 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 |
|
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".
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.
| Lesson | Time | What 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 |
|
| 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 |
|
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".
Build it
A LiPo read, budgeted and put to sleep, and a box that opens only for your secret spell.
| Lesson | Time | What 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 |
|
| 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 |
|
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".
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.