[RL25] - Grade 2 - Session 5

Session 5: Problem-Solving Robot

Session Architect: Muhammad Bilal
Session Length: 50-60 minutes

Objective:

Students will learn the purpose of if-then logic (conditional statements) and how it helps robots make decisions. They will use simple if-then logic blocks in code to control their robot’s behavior. The session will include a fun activity to apply these concepts in a playful and engaging way.

Equipment Required:

  • M3D Robotics kit (including M3D Go, its attachments, and necessary connections).
  • Laptops with Scratch pre-installed.
  • Paper and pencils for students to document their discoveries and ideas.
  • Markers and small obstacles for robot navigation.
  • Problem sheet with simple addition and subtraction problems.

Key Concepts:

  • Introduction to if-then logic.
  • Using simple conditional blocks to control robot movement.
  • Hands-on problem-solving activity.

Resources:

Scratch Code File:
Grade 2 Session 5.sb3 (317.2 KB)


Lesson Plan:

1. Introduction to If-Then Logic (5-10 minutes)

Activity:
Introduce the concept of if-then logic by relating it to real-life examples. Explain that if-then logic allows the robot to make decisions based on certain conditions (e.g., “If the robot hits an obstacle, then it will stop”).

Teacher’s Role:
You may start by giving simple examples from everyday life to explain the concept of conditional statements:

“If it’s raining, then we’ll use an umbrella.”
“If you finish your homework, then you can play.”

Once the students are familiar with real-world if-then statements, you can transition to how robots can use similar logic to solve problems:

“Now, robots can use if-then logic too! For example, ‘If the robot hits a wall, then it will stop.’”

“If the Up Arrow key is pressed, then the robot should move forward.”

You may show the If-then code block on the projector screen and say,

“This block helps the robot decide what to do when certain conditions are met. For example, if the robot reaches a wall, then it will stop moving.”

Goal:
Help students understand the basic concept of conditional logic and why it is useful for robots to make decisions.


2. Guided Activity: Using If-Then Blocks (15-20 minutes)

Activity:
Students will program simple if-then statements using Scratch or any block-based coding tool.

Instructions:

  1. Show the different blocks they can use in the if-then code block and explain what condition they check. For example,

“This block checks if something happens. If it does, it tells the robot to perform an action.”

  1. Demonstrate how to use if-then blocks in Scratch by saying,

“Now, let’s program the robot: It checks our answer and moves.”

  1. Provide students with a problem sheet containing addition and subtraction problems. Encourage them to use the answer to their math problems to make the robot perform a task if the answer is correct.

    “You can use these math problems to create if-then conditions. For example, ‘If the answer is correct, then make the robot move.’”

You may guide the students step-by-step through creating their first if-then statement

Encourage them to try different code blocks (e.g., move, rotate, express) with loops and if-then blocks:

“What happens if we use the ‘Express’ block with the if-then block? Can the robot show a smiley face if the answer is correct?”

Goal:
Ensure students understand how to use if-then blocks in a simple program. Keep it light and ensure each student is comfortable with the concept.


3. Fun Activity: Robot Decision Challenge (15-20 minutes)

Activity:
Set up a “Robot Decision Challenge” where students use if-then logic to guide their robots through an obstacle course. Each group or individual will code the robot to make decisions based on what it encounters (e.g., “If the robot reaches a wall, then it turns left”).

Instructions:

  1. Divide students into small groups or allow them to work individually.

  2. Each group will have a straight path and an obstacle at the end which could be any simple classroom object (e.g., blocks, books, or paper).

  3. Students will then program their robot using if-then logic to make decisions while navigating the course.

  4. The if-then blocks will use the custom block “Start Obstacle Detection” to check if robot’s path is blocked and “Evade” block to change its course if it detects an obstacle..


  5. This block comes with a state of it’s own called “Obstacle Detected”.
    {208ED1B3-C27E-4CEC-A27C-09012F57E242}

  6. Students will check this state when using if-then code block. You may ask them to code such that if the robot detects a book, it rotates as follows:

  7. First guide them verbally through each step that the robot should take. You may start a discussion with them such as:

“If we want the robot to know how to avoid any obstacles, what does it have to do?”

Wait for their answers and build up on that. You may continue then as

“First it needs to stop when it knows there is an obstacle. Then it needs to rotate enough to change it’s direction so that its path is clear”.

  1. Explain to them how all these steps can be done by one block called “Evade”. So, we just need to check if there is an obstacle.
  2. Once they understand the idea, they can start using these blocks to program their robot.
  3. Once they understand the the logic behind it, you can start a discussion about how we detect obstacles. You may say:

“When we want to avoid something, do we look only once? Or do we keep checking for obstacles to choose the right path?”

Wait for their answers and build up on that:

“Yes! We need to check again and again. So does our robot. So, we make can use a block called “Repeat forever” to make the robot constantly check for obstacles:"”

Teacher’s Role:
Provide guidance and help with troubleshooting. Encourage students to be creative with the obstacles and decisions they program. Make the activity light and fun by turning it into a “Robot Maze Challenge.”


4. Reflection and Sharing (5-10 minutes)

Activity:
After completing the challenge, students will come together and share their experience of using if-then logic to solve problems. They will explain how their robot made decisions and what challenges they encountered.

Reflection Questions:
You can ask:

“What decision did your robot make using if-then logic?”
“Was there anything difficult about programming the robot to solve the problem?”
“What was the most fun part of controlling your robot with if-then logic?”
“Was it difficult to understand how the blocks worked?”

Teacher’s Role:
Facilitate the sharing and reflection, encouraging students to discuss how they used if-then logic to make their robots smarter. Offer positive feedback for creativity and problem-solving.

Goal:
Encourage students to reflect on their learning and share their experiences with the class.


5. Conclusion and Wrap-Up (5 minutes)

Activity:
Wrap up the session by summarizing the importance of if-then logic in making robots more responsive and intelligent. Reinforce that conditional logic helps robots solve problems based on their surroundings.

Wrap-Up Summary:
Congratulate students on successfully using if-then logic and completing their first problem-solving challenge with the robot. Let them know that in future sessions, they will use even more tools to help their robots complete different tasks.

Goal:
End the session by emphasizing how learning to program robots with if-then logic can help them solve complex problems and make decisions based on real-world conditions.


Learning Outcome:

By the end of the session, students will understand how if-then logic works and how it can be used to make robots solve problems. They will have hands-on experience programming simple conditions and will feel more confident in using basic logic blocks.