Lesson plan

Build a cat laser toy lesson plan

Your first robot: a pan and tilt laser turret on two servos that plays with a cat on its own, with random glides, tuned speed and pauses, real laser eye safety, a session timer, and a toy at the end of every game.

3 chapters, 7 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

  • What a servo is, the pulse that steers it, and a pan and tilt turret that puts a dot exactly where the math says.
  • Random paths that only look random, glide speed you can time, the servo’s own limit, and pauses that make a cat pounce.
  • Laser classes and a beam that stays on the floor, a timer that never blocks, and a full play session that ends on a real toy.

Materials for the whole unit

  • Arduino Uno R3
  • Half breadboard
  • Hobby servo x 2
  • Laser module, KY-008
  • Pushbutton

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 30 min

Two servos

What a servo is, the pulse that steers it, and a pan and tilt turret that puts a dot exactly where the math says.

LessonTimeWhat students do
A servo from scratchMeet the motor that goes to an angle and stays there: what is inside a servo, the pulse that steers it fifty times a second, and the math from an angle to a pulse width.45 min
  1. Run it
  2. What is inside a servo
  3. Turn it all the way
  4. And back the other way
  5. From an angle to a pulse
Pan, tilt and where the dot landsTwo servos make a turret: pan turns it left and right, tilt points it up and down. Work out where the dot lands on the floor with one line of trigonometry, then switch the laser on.45 min
  1. Two axes
  2. Where the dot lands
  3. Predict, then aim
  4. Laser on
  5. Home

Materials

  • Arduino Uno R3
  • Half breadboard
  • Hobby servo x 2
  • Laser module, KY-008
  • Pushbutton

Check for understanding

Each student finishes "Pan, tilt and where the dot lands" 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: "Home".

Chapter 2. About 1 h 30 min

Make it play

Random paths that only look random, glide speed you can time, the servo’s own limit, and pauses that make a cat pounce.

LessonTimeWhat students do
Random pathsThe gallery sketch makes the dot wander on its own with random(). Learn why the numbers only look random, pin the dance down with a seed, and shrink the play box.45 min
  1. Run it
  2. Where the randomness lives
  3. Same seed, same dance
  4. Shrink the box
  5. A shorter round
Speed and pausesHow fast the dot moves and how long it freezes is what makes a cat chase. Time a glide, make it faster, find the servo’s own speed limit, and tune the pauses.45 min
  1. Run it
  2. Time a glide
  3. Faster
  4. The servo has a speed limit
  5. Freeze

Materials

  • Arduino Uno R3
  • Half breadboard
  • Hobby servo x 2
  • Laser module, KY-008
  • Pushbutton

Check for understanding

Each student finishes "Speed and pauses" 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: "Freeze".

Chapter 3. About 2 h 15 min

Safe, timed and kind

Laser classes and a beam that stays on the floor, a timer that never blocks, and a full play session that ends on a real toy.

LessonTimeWhat students do
Safety for eyesA laser is not a flashlight. Laser classes in real milliwatts, why a pet toy uses class 2 or less, a beam that cannot leave the floor, and a kill switch.45 min
  1. Laser classes
  2. Turn it down
  3. The dot stays on the floor
  4. Steeper is safer
  5. A kill switch
A timerSessions that end on their own, a length that does not overflow, a button that still works mid-game because nothing blocks, and a rest between games.45 min
  1. How long is a session
  2. Big numbers on a small chip
  3. Time is up
  4. The button still works
  5. A rest between games
Project: a play sessionPut it all together into a session a cat will love: a warm up, a timed chase, a cool down, and the dot parked on a real toy so every game ends in a catch.45 min
  1. The plan
  2. The chase
  3. End on the toy
  4. Move the toy
  5. Enough for today

Materials

  • Arduino Uno R3
  • Half breadboard
  • Hobby servo x 2
  • Laser module, KY-008
  • Pushbutton

Check for understanding

Each student finishes "Project: a play session" 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: "Enough for today".

Your class

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.