AI Lab Session 1: Getting Started with Scratch and Block Coding
Duration: 50–60 minutes
Architect: Muhammad Bilal – Markhor3D
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 solve math problems.
- Markers and small obstacles for robot navigation.
- Projector and screen (optional for the video demonstration).
Learning Objectives:
By the end of the session, students will:
- Understand the basic components of the robotics kit.
- Familiarize themselves with the Scratch interface and block coding.
- Learn to use basic movement blocks in Scratch to control the robot.
- Solve math problems and use them to program the robot’s movements.
- Develop problem-solving and logical thinking through coding.
Resources:
- Scratch Code for the session: AI Lab - Session 1.sb3 (1.6 MB)
1. Introduction to Robots and Scratch (10 minutes)
Activity:
Realistic and Engaging Introduction to Robots and Scratch Coding for Grade 5
Instructions:
“Before we get started, I want to know—what do you think a robot is? What kinds of things can robots do?”
Engage them in a discussion of their idea of a robot and where it comes from e.g. games, movies, cartoons etc. or something that they want their robot to be.
After taking in their ideas, you may build up on their ideas by saying:
“Those are some great ideas! Yes, robots can do lots of different things. Some robots help with cleaning, like robot vacuums. Some work in factories, putting together cars or even building things. And did you know that there are even robots that drive themselves, like self-driving cars? You’ve probably seen videos of robots delivering packages or even helping out in hospitals, right?”
You may play some videos on a projector screen so that students can better visualise what current robots are capable and how they are being utilised.
"Robots are everywhere—they help in factories, on farms, in stores, and even explore other planets! But what makes all these robots special? It’s that they follow instructions, just like the robots we’re going to control today.”
“Now, imagine you had a robot that listened only to you. What would you make it do? Maybe you’d have it clean up your room, help you with your homework, or even bring you a snack!”
Take in their ideas and then continue the conversation:
“Today, we’re going to learn how to give our robot instructions using something called Scratch. It’s kind of like a game controller, but instead of buttons, you’ll use blocks of code to make your robot move, turn, and even talk! Scratch is like a gamepad that lets you stack instructions on top of each other, just like building with Lego blocks.”
Some students may already know what Scratch is and may have used it to create projects. You may encourage them to share their experience and the projects they created with the rest of the class.
“Think of Scratch like building with blocks. Each block is a command, like ‘move forward’ or ‘turn left.’ When you stack them together, the robot will follow your instructions, just like when you follow steps in a game or puzzle. It’s fun and easy!”
“By the end of today, you’ll be in charge of your very own robot! You’ll decide where it goes, what it does, and even what it says on its screen. Ready to turn your robot into a cool assistant, adventurer, or even a dancer? Let’s get started and see what your robot can do!”
Teacher’s Role:
- Encourage students to share their ideas about robots and what they think they can do.
- Build on their answers with real-world examples like self-driving cars, delivery robots, and robots in factories.
- Introduce Scratch in a fun, relatable way by comparing it to a game controller or building blocks, making it easy for students to understand.
- Keep the energy fun and engaging, getting students excited to control their robots by the end of the session.
2. Hands-On Exploration with the Gamepad and Scratch Environment (15 minutes)
Activity:
Students explore the Scratch environment and control the robot using the on-screen gamepad.
Instructions:
“Before we start controlling the robot, let’s look around Scratch! This is where we’ll build our code. See all those blocks? We’ll stack them together, like building with Legos, to make our robot do different things.”
- Show them all the blocks in Scratch and how the blocks snap into each other.
- Encourage them to play around with different shaped blocks and explore which blocks fit with each other.
You may say:
“See how every block has a different shape? That tells us where it can fit in our code. Let’s play around for a minute to see what you can find!”
Once they understand how to use blocks, you may introduce sprites to them:
“Each sprite is like a different part of our program.
"For example, if you look at the bottom-right corner, you’ll see ‘My Robot.’ That sprite controls the robot. It’s kind of like how the Bluetooth button on your phone helps connect it to other devices. Here, the robot sprite helps connect us to the robot’s actions.”
“This is just like using a remote control for a toy car, but instead of physical buttons, you’ll use these controls on the screen.”
“What happens when you press the forward button? Can you get the robot to turn right?”
Keep them engaged by giving them different prompts to encourage them to explore.
“Everything you’re doing with the gamepad now, we’ll soon be able to do with our coding blocks. Isn’t that cool?”
Teacher’s Role:
- Move around the room, assisting students in getting comfortable with the Scratch environment and the gamepad.
- Encourage curiosity by asking questions about what they observe in Scratch.
- Provide gentle guidance, ensuring students are confident exploring Scratch before focusing solely on the gamepad.
3. Introduction to Movement Blocks (15 minutes)
Activity:
Introduce basic movement blocks such as “Move Forward” and “Turn Left/Right”.
Instructions:
“Instead of using the gamepad, now we’ll use these blocks to tell the robot where to go. You can make it move forward, turn, or go backward—just like you did before, but now with coding blocks!”
“Drag and drop the ‘When Green Flag Clicked’ block and connect it to a movement block. This block is like the Go signal for the robot.”
“Try stacking different blocks together to make your robot move in interesting ways. Can you make it go in a square? Or maybe a zigzag?”
Note: Students may stack movement blocks on top of each other which can cause the robot to stop responding all together. An example of such a code block is:
You can explain to the students why this code sequence can cause the robot to act weirdly. This is because we’re asking it to move in so many different directions at the same time without specifying for how long each action is to be carried out. You can even demonstrate this by giving a students multiple commands at the same time and show how we also get overwhelmed we get different instructions of the same time.
To fix this, we can add the wait_seconds block to add a small gap between each command.
They can play around with the the wait and see how the duration of each action changes.
Teacher’s Role:
- Guide students through using movement blocks and combining them for complex actions.
- Offer help as needed but encourage independent experimentation.
4. Math and Movement Challenge (15 minutes)
Activity:
Students solve simple math problems and translate them into Scratch commands.
Instructions:
“If the robot takes 3 cm long steps and it needs to travel 12 cm, how many steps will it take?”
They will use the Move ___ Steps block.
“Now, use the ‘Move _Steps’ block to make the robot move the correct number of steps based on your answer.”
“Set up markers or small objects for the robot to navigate toward. Can you get your robot to reach the target using your calculations?”
Teacher’s Role:
- Help students connect math solutions to robot movement in Scratch.
- Ensure every student has a chance to solve a problem and program the robot.
5. Student Extension (Optional, 10–15 minutes)
Activity:
Encourage students to experiment with more complex robot movements and combinations.
Instructions:
“Now that you know how to move your robot forward and turn, can you try making it draw a shape? Maybe a triangle, square, or even a star?”
Help the students attach the Pen Holder Attachment to their robot so that they can draw the shapes as well as track their robot’s motion.
“Remember, each side of the shape will need the robot to move forward a certain distance and then turn at the correct angle. Can you calculate the angles for each turn?”
“Try to combine multiple shapes. Can your robot draw a house by connecting squares and triangles?”
Teacher’s Role:
- Encourage creativity and problem-solving.
- Help students visualise how angles and distances translate into robot movements.
- Allow students to experiment freely while providing guidance as needed.
Learning Outcome:
- Students practice logical thinking by breaking down complex shapes into smaller movements.
- Students improve problem-solving skills by connecting math and coding.
- Encourages independent experimentation and creativity.
6. Conclusion and Wrap-Up (5 minutes)
Activity:
Reflect on what students learned and reinforce curiosity for future sessions.
Wrap-Up Summary:
“Today, you learned how to control the robot using blocks and math! You made the robot move forward, turn, and solve math problems. Next time, we’ll learn even more cool ways to make the robot do what you want.”
“What else would you like your robot to do in the future? Think big!”
Learning Outcome:
By the end of the session, students will:
- Have a basic understanding of Scratch.
- Be able to control the robot’s movements using block coding.
- Apply math to programming tasks in a fun and interactive way.










