Session 4: Introduction to Code Blocks – Make the Robot Come Alive
Session Architect: Muhammad Bilal
Session Length: 50-60 minutes
Objective:
Students will learn how to control the robot’s movement and actions using simple code blocks, rather than arrow keys. They will use movement, rotation, along with stop, wait, express (emoji), and show text blocks to program the robot.
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.
Key Concepts:
- Basic movement and rotation blocks.
- Using stop, wait, express, and show text blocks for additional functionality.
- Exploring how to combine blocks to create simple programs.
Resources:
Scratch Code File:
Grade 2 Session 4.sb3 (3.4 MB)
Lesson Plan:
1. Introduction to Code Blocks (10 minutes)
Activity:
Introduce the concept of controlling the robot through code blocks instead of the arrow keys. Show the different blocks students will be using: movement (Go Forward, Go Backward), rotation (Rotate Clockwise, Rotate Counter-clockwise), and actions (Stop, Wait, Express, Show Text).
Teacher’s Role:
You may begin by demonstrating how each block works by creating a simple program that makes the robot move forward, turn, and then stop. For example, say,
“Let’s start with the ‘Click Green Flag’ block. This block is how we start the robot’s actions. When we click this, the robot will begin to follow our commands.”
Then, you may show the students how to use the “Go Forward” block:
“Here, when we use the ‘Move Forward’ block, the robot will move in a straight line.”
Continue with “Turn Left” to make the robot turn, saying,
“When we use this block, the robot will rotate to the left.”
Allow them to experiment with different movement blocks.
Once that’s done, demonstrate how to add an emoji using the “Express” block and a message with the “Show Text” block. Say,
“Now, let’s make our robot smile with an emoji and display a message like ‘I’m ready to go!’ using the ‘Express’ and ‘Show Text’ blocks.”
Encourage them to experiment with all the blocks paired with “When Green Flag Clicked,” saying,
“You can try out all the blocks we’ve seen today. Play around and see what happens when we use them together!”
Goal:
Introduce students to how they can control the robot’s movement and display actions using code blocks.
2. Guided Practice: Building Simple Programs (15 minutes)
Activity:
Students will create their first simple programs by combining the blocks they’ve learned. Each student (or group) will program the robot to move forward, rotate, stop, display an emoji, and show a text message.
Instructions:
Start with a simple program: move the robot forward, make it rotate, and then stop. Guide students through each step, saying,
“Let’s start by making the robot go forward, then turn, and move back.”
Encourage students to add an emoji and a short message, such as a smiley face and “Hello!” to personalize the robot’s actions. You may say,
“Now let’s add a smiley face emoji to make the program more fun!”
Use the “Wait” block to create a short pause between movements or actions. For example,
“We can use the ‘Wait’ block to give the robot a short pause before it moves again.”
You may demonstrate this with a simple example like,
“Let’s wait for 2 seconds before the robot moves backwards.”
As students create their programs, move around and offer help as needed. You might say,
“It’s great to see your creativity! Can you think of another action the robot can do after it stops? Maybe it can wave or display a different emoji?”
Goal:
Help students get comfortable using different code blocks together to create simple sequences of movement and actions.
3. Fun Activity: Robot Adventure (20 minutes)
Activity:
In this activity, students will create a short adventure sequence for their robot using basic movement and expression blocks. The goal is to combine movements (forward, backward, rotate), stops, and expressions (emoji or text) to tell a fun, simple story or complete a short task.
Instructions:
-
Create an Adventure:
Each student (or group) will program their robot to perform a short sequence of movements and expressions. For example, their robot could “explore” a small area by moving forward, turning, expressing an emotion, and displaying text like “I’m on an adventure!” -
Planning the steps:
Encourage students to first think out all the moves/steps they want the robot to perform and write them in an order on a piece of paper. For example:“Let’s plan the robot’s journey: Go Forward, Rotate Clockwise, Stop, Express (show smiley face), Show text: ‘I’m on an adventure!’, Go Backward, Stop.”
-
Present the Adventure:
Once their robot’s adventure is planned, each group can start coding and then present their robot’s journey to the class, explaining the story or task their robot is completing. You may say,“Can you think of a fun story for your robot to tell? Maybe it’s exploring the classroom or completing a mission?”
Teacher’s Role:
- Encourage students to use their creativity to build fun, simple adventure stories for their robots. You may say,
“What kind of adventure could your robot have? Maybe it’s going on a treasure hunt, or it’s meeting new robots!”
- Guide students through using the blocks and help them troubleshoot any issues with movement or expressions.
- Celebrate each student’s work by letting them present their robot’s adventure and offering positive feedback.
Fun Element:
- Add an exploration theme, where robots “travel” around different parts of the classroom, completing their “adventure.” You can play light background music or sound effects to make it more engaging.
Goal:
Students will apply their knowledge of movement, rotation, stop, wait, express, and show text blocks to create and present a simple robot adventure.
4. Reflection, Sharing, and Conclusion (5 minutes)
Activity:
Students will reflect on their robot programming experience, focusing on how using code blocks, instead of arrow keys, made the process different or easier, what they enjoyed most, and how adding emojis and text made their program more fun.
The teacher will wrap up the session by summarizing the key concepts learned and discussing how code blocks allow for greater flexibility in controlling the robot.
Reflection Questions:
You can ask,
“What was the most fun part of programming your robot?”
“Was it easy or difficult to use code blocks to control the robot?”
“What did you like about adding emojis and text to your program?”
Wrap-Up Summary:
You may summarize the session by congratulating students on successfully using code blocks to program their robot’s movement, expressions, and text.
Reinforce that these code blocks give them more control and flexibility compared to using arrow keys, and remind them that in future sessions they will learn to use even more blocks for more complex tasks.
Teacher’s Role:
- Facilitate the reflection, encouraging students to share their experiences and feelings about using the blocks.
- Emphasize the importance of the session’s concepts and how they can apply this knowledge to real-world programming.
- Celebrate the students’ progress and encourage excitement for future sessions.
Learning Outcome:
By the end of the session, students will understand how to use basic code blocks to control the robot’s movement, rotations, and actions like showing emojis and text. They will have gained hands-on experience in creating simple programs and will feel confident using blocks to control the robot without arrow keys.








