Lesson plan

Build a 4x4x4 LED cube lesson plan

Sixty-four LEDs from twenty wires in three builds: a shift register, multiplexing slowed down, then a cube full of animations.

1 chapter, 3 lessons, about 3 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

  • Get eight outputs from three pins, light the cube a layer at a time, then make it dance.

Materials for the whole unit

  • 74HC595 shift register x 2
  • Arduino Uno R3
  • Full-size breadboard x 3
  • LED x 64
  • Pushbutton
  • Resistor x 20
  • Transistor (NPN or PNP) x 4

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 3 h 5 min

Shift, multiplex, animate

Get eight outputs from three pins, light the cube a layer at a time, then make it dance.

LessonTimeWhat students do
Eight outputs from three pinsA 74HC595 shift register turns three Uno pins into eight outputs. The cube needs sixteen columns, so this is where it starts.55 min
  1. Three wires in
  2. One clock tick, one bit
  3. The latch
  4. A full bar
  5. Two chips, sixteen columns
One layer at a timeThe real cube, with its trick slowed down. Sixteen columns, four layer transistors, and the moment the layers start switching faster than your eye.55 min
  1. Columns and layers
  2. The top layer
  3. A transistor per layer
  4. Faster than your eye
  5. All four at once
Bring the cube to lifeThe finished cube: a frame of four 16-bit numbers, a refresh that never stops, and four animations, rain, a plane sweep, a spiral and sparkle.75 min
  1. Ready
  2. The refresh
  3. Rain
  4. Plane sweep
  5. A full floor
  6. Spiral
  7. Sparkle

Materials

  • 74HC595 shift register x 2
  • Arduino Uno R3
  • Full-size breadboard x 3
  • LED x 64
  • Pushbutton
  • Resistor x 20
  • Transistor (NPN or PNP) x 4

Check for understanding

Each student finishes "Bring the cube to life" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

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

Your class

Teach this unit as a class

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