Module 3: Giving Smarter Instructions

Learn to create multi-step instructions with conditions and debug programs to make robots work smarter!

Learning Objectives

Create multi-step instructions with proper sequencing
Understand and create conditional (IF-THEN) instructions
Debug and fix errors in simple programs

Activity 1: Multi-Step Instruction Builder

Drag and drop the steps into the correct order to create a complete program for a robot. The right sequence is important!

Build a Robot Morning Routine

Help Robo the Robot complete his morning routine by arranging the steps in the correct order!

Available Steps

1
Turn on power
2
Check battery level
3
If battery is low, go to charger
4
Greet the family with "Good morning!"
5
Scan the room for cleaning tasks
6
If floor is dirty, start cleaning
7
Report status to owner
8
Return to charging station

Robot Program Sequence

Drag steps here to build your program

Activity 2: Conditional Instructions

Create IF-THEN statements by matching conditions with appropriate actions. Help the robot make smart decisions!

Create Smart Robot Rules

Match conditions with actions to create smart rules for different robots.

IF (Conditions)

It is raining
It is dark
Floor is dirty
Obstacle detected
Battery is low
Person detected

THEN (Actions)

Use umbrella
Turn on lights
Start cleaning
Change direction
Go charge
Say hello
Your Robot Rules
Your IF-THEN rules will appear here

Activity 3: Debugging Instructions

Find and fix errors in robot programs. Debugging is an important skill for all programmers!

Debug the Robot Program

Find the errors in this robot cleaning program and fix them to make it work correctly.

1
PROGRAM CleanTheRoom
2
START
3
MOVE "forward" # Robot should move forward
4
IF sensor_dirty() == TRUE
5
  THEN stop_cleaning() # Should start cleaning when dirty
6
END IF
7
TURN "left"
8
MOVE "backward" # Should move forward again
9
IF battery_level() < "20%"
10
  THEN go_to_charger()
11
END IF
12
REPEAT "3 times" # Missing what to repeat
13
END PROGRAM
Line 3: Move command is correct
Line 3: Change 'forward' to 'backward'
Line 3: Add distance: MOVE 'forward 5 steps'
Line 5: stop_cleaning is correct
Line 5: Change to start_cleaning
Line 5: Change to check_battery
Line 8: 'backward' is correct
Line 8: Change 'backward' to 'forward'
Line 8: Remove this line
Line 12: REPEAT is correct
Line 12: Add what to repeat: REPEAT cleaning 3 times
Line 12: Change to STOP
🤖
Ready to debug!

Teacher's Guide

Learning Objectives & IB Connections

IB PYP Transdisciplinary Theme: How We Express Ourselves

Central Idea: Clear, logical instructions enable effective communication with machines and people.

Key Concepts: Function (How do instructions work?), Connection (How are programming and language similar?), Reflection (How can we improve instructions?)

IB Learner Profile: Thinkers, Communicators, Reflective

Approaches to Learning: Thinking Skills (Critical thinking, Creative thinking), Communication Skills (Writing, Presenting)

Lesson Duration & Structure

Total Time: 3 periods (60 minutes each)

Period 1: Multi-step instructions and sequencing (Activity 1)

Period 2: Conditional instructions and decision-making (Activity 2)

Period 3: Debugging and error correction (Activity 3 and review)

Teaching Methodology

Constructivist Learning: Students build their understanding through hands-on activities with immediate feedback.

Problem-Based Learning: Each activity presents a programming problem to solve.

Collaborative Learning: Students can work in pairs to discuss and solve debugging challenges.

Scaffolded Instruction: Activities progress from simple sequencing to more complex conditional logic.

Differentiation Strategies: Provide visual aids for sequencing, simplified conditions for beginners, and more complex debugging for advanced students.

Materials & Resources

  • Interactive whiteboard or projector for demonstrating activities
  • Tablets or computers for each student or pair
  • Printed sequencing cards for offline activity
  • "If-Then" scenario cards for role-playing
  • Whiteboards or paper for students to write their own programs
  • Simple physical robots or programmable toys (optional, for extension)

Key Discussion Questions

  1. Why is the order of steps important in a program?
  2. What are some examples of IF-THEN rules in your daily life?
  3. How is debugging a program like fixing a mistake in a story or recipe?
  4. What happens if a robot follows instructions in the wrong order?
  5. Can you think of a situation where a robot would need to use an IF-THEN rule?
  6. Why do programmers need to test and debug their programs?
  7. How is giving instructions to a robot similar to teaching a friend a new game?

Extension Activities

  • Robot Dance Program: Students create a multi-step dance routine for a robot.
  • Weather Robot: Design a robot that responds to different weather conditions with IF-THEN rules.
  • Debugging Challenge: Create programs with intentional errors for other students to debug.
  • Real-World Sequencing: Have students sequence their morning routine or a recipe.
  • Conditional Story Writing: Write a story where the plot changes based on IF-THEN decisions.
  • Robot Theater: Act out robot programs with students playing robots following instructions.

Assessment Strategies

  • Formative Assessment: Observation during interactive activities, questioning during discussions.
  • Summative Assessment: Success in completing the debugging challenge, creating accurate IF-THEN pairs.
  • Performance Task: Students create their own simple program with sequencing and one conditional.
  • Peer Assessment: Students exchange programs and debug each other's code.
  • Self-Assessment: "Programming Progress" checklist where students rate their skills.

Common Misconceptions to Address

  • All instructions must be followed in the order written (sometimes conditions change the flow).
  • IF-THEN rules only have one possible action (introduce ELSE for alternative actions).
  • Debugging means the programmer made a "mistake" (frame it as improving the program).
  • Programs either work perfectly or not at all (discuss partial success and incremental improvement).
  • Only computers use conditional logic (show examples from daily life).

Cross-Curricular Connections

  • Language Arts: Sequencing in stories, conditional sentences, clear instructions.
  • Mathematics: Logical thinking, patterns, order of operations.
  • Science: Cause and effect, following procedures in experiments.
  • Social Studies: Following rules and laws (like IF-THEN statements).
  • Physical Education: Following multi-step instructions in games and activities.

Programming Concepts Introduced

  • Sequencing: Putting instructions in the correct order
  • Conditionals: IF-THEN statements for decision making
  • Debugging: Finding and fixing errors in code
  • Syntax: The structure and rules of programming languages
  • Logic: Making decisions based on conditions