AI Lab - Session 7 - How our bodies move

AI Lab – Lesson 7: Body Coordinates & Emotional Robotics

M3D RoboticsLab – Grades 6–8
Session Architect: Muhammad Bilal
Duration: 50–60 minutes


:bullseye: Learning Objectives (short)

By the end of this session students will be able to:

  1. Use body and face sensing to control the robot’s behaviour.
  2. Translate coordinate changes into robot actions (move, turn, change speed, show emoji, activate attachment).
  3. Combine multiple inputs (body + face) to code a personality to the robot.
  4. Debug, tune and explain why their robot reacted the way it did.

:toolbox: Equipment

  • M3D Robotics Kit (robot with wheels, display attachment, pen/servo if available)
  • Laptops with Scratch + Body Sensing and Face Sensing extensions enabled
  • Webcam (built-in laptop camera is fine)
  • Small obstacles, open floor area for safe movement
  • Whiteboard & markers; sticky notes for mapping gestures → actions
  • Paper and pencils for observations

Resources:

Scratch code file for the session: AI Session 7.sb3 (59.8 KB)


1. Introducing today’s lesson: (5 minutes)

“We’ve already seen how numbers can represent position of something in the form of coordinates right? They can tell the robot where your hand is. In the previous class, we used our hands. In the lesson before that, we used our expression. Today, let’s use our entire body as the robot’s remote control.”

Ask students to suggest simple mappings aloud (record answers on board):

What motions can we use to control the robot? Let’s decide the gestures and what they would tell the robot to do.

  • Raise right hand → move forward
  • Raise left hand → turn left
  • Smile → show happy emoji
  • Right knee up→ speed up
  • Left knee up→ speed down

“When we map a body signal to a robot action, what safety or timing concerns should we think about? (e.g., delay, false triggers, movement speed.)”

Have we coded a stop? What gesture would signal that?

This is a common step that students often miss and a good learning opportunity for them to revise that the machines are very dumb on their own. If we don’t tell it to stop, it’ll just keep moving.


2. Quick demo (5 minutes)

  • Turn on robot and show a quick demo to the students so that they can visualise the behaviour they will code in the session:
  • raise a hand → robot moves forward slowly;
  • smile → robot shows :grinning_face:.

3. Discover body coordinates — (15 minutes)

  • Enable Body Sensing UI and show live body point coordinates.

  • Ask one volunteer to perform small gestures (move left hand and right hand). Students observe which x/y numbers change.

Teacher guidance (during observation):

“Notice the Y increases when the hand is raised — that numeric change is what we’ll use to trigger movement. Record a few example values for ‘hand up’ and ‘hand down’ on a sheet of paper.”

  • Encourage students to use different sprites for each body part just like they see on the attached code(two sprites for left and right hand).

  • This makes it easier for us to manage codes for different parts of our body.

  • It also helps us assign a sprite to each body part which tracks it’s position and show it’s coordinates.


4. Map coordinates to robot outputs (15 minutes)

“Now, we need to convert these coordinates into actions for the robot. Last time, we divided the screen into four parts or quadrants as follows:”

  • Quadrant I: x+, y+ (Top-right)
  • Quadrant II: x-, y+ (Top-left)
  • Quadrant III: x-, y- (Bottom-left)
  • Quadrant IV: x+, y- (Bottom-right)

You may write/show this on the board/screen for recall.

“We can use the same technique today as well. But, since we are tracking multiple body parts, it might get complex to handle multiple coordinates. But, we can use that to our advantage as well.”

“For example, if we want to check if the left hand is up, we can check in which quadrant the hand actually is. Another way of doing it is, we check whether it’s position is higher than that of left shoulder. Makes sense right?”

Step A — decide mappings (5 minutes)

Teacher prompts while pairs plan:

“How will you avoid accidental triggers? Can you add a small wait or require a gesture to be held for 0.5 seconds?”


5. Combine face sensing + body control: expressive robot (8–10 minutes)


6. Mini-challenges & extensions (6–8 minutes)

Give each group one of the following 2–3 minute challenges (rotate or let groups choose):

  1. Steady Walker: robot moves forward only while the right hand remains above shoulder level. Measure how long they can hold it steadily.
  2. Mood Patrol: robot patrols slowly; if the student smiles, robot speeds up; if the student frowns, robot slows and shows sad emoji.
  3. Emergency Stop: design a gesture (e.g., both hands crossed above head) that triggers immediate stop and disables motion until reset.

Teacher coaching lines:

“Make a hypothesis: will the robot stop faster when you lower your hand quickly or when you drop both hands? Test and report.”


7. Wrap-up (5 minutes)

Activity:
Summarize the key concepts learned today and allow time for reflection.

Reflection Questions:

  • Which gestures were reliable?
  • What thresholds needed adjustment?
  • Any unexpected behaviour or false triggers?
  • Explain one tweak you made and why it improved reliability.”
  • How might this mapping be useful for real-world robots (assistive robots, games, physical therapy)?”