Ozobot Classroom

Lesson Creator

  • Preparation
  • Direct Instruction
  • Student Practice
  • Supplements
  • Review

1. Tell Us About Your Lesson

All fields are required unless marked as optional

A. Lesson Overview


Students will

B. Lesson Details

Lesson Duration (minutes)The time (minutes) to complete the whole lesson.

Grade LevelsSelect all that apply


Subjects/TopicsChoose the most relevant subject(s). Select up to 3.


    Coding Styles


    Product Lessons


    Tested With

    2. Preparation

    This helps the teacher prepare for the lesson before the class session

    A. Student Materials

    B. Background Knowledge (Optional)

    C. Lesson Tips (Optional)

    Add tips for the educator that don't fit into Direct Instruction or Student Practice. You can always return to this page to add more.

    Game Mechanic: winning

    Map Style: free movement

    Groups of 2-3 students are recommended for this lesson, but a 1:1 student-to-robot ratio works also.

    If you can't print in color, use markers to recreate the mazes. Maintain the line thickness of 5mm, which is optimal for the bot to follow. Remember to calibrate Ozobot to the black circle before starting making your bot able to see the colors properly. You don't need to calibrate again unless your bot isn't seeing the colors properly.

    This lesson is planned for 50 minutes. If your classes are short (30 minutes), split the lesson in half; do the demo and code explanation first, and the code editing and playing second (with a little refresher on the program).

    If you are using Evo, create your program at https://ozoblockly.com/editor. The sample solution can be accessed here:

    https://ozo.bot/line-end-search-game and

    https://ozo.bot/line-end-search-hardcoded

    If you are using Ari, create your program at https://editor.ozobot.com/blockly The sample solution can be accessed here:

    https://editor.ozobot.com/blockly?programId=cr292c7

    https://editor.ozobot.com/blockly?programId=2v5fjdq

    3. Direct Instruction (Teacher-Facing Instructions)

    These are the steps the educator will read. Include any front loading, modeling or explicit instruction before students work independently or in groups.

    Instruction

    To show how the logic of this program works, print the game's map and black out the red. You will run Ozobot on the map and see how it will continue through the map forever. The shape of the maze is the reason that a program like this works. It is called a binary tree because every branch splits in two. Next, you will play the program on an unedited first map to show how the program helps Ozobot end on red. After students see how Line-End Search is played, the class will compare the actions of the bot to the program itself.

    Instruction

    Lesson Outline

    Have one map, a device for Ozobot Blockly with the program loaded, and an Ozobot to demonstrate the game. Find the program at https://ozo.bot/line-end-search-game

    1. Organize your students into pairs.
    2. Explain that you'll be playing a preprogrammed game with Ozobot, then discover how it was programmed. The game makes the bot walk in a maze until it finds the winning color.
    3. Hand out one activity sheet to each student.
    4. Demonstrate the game on a map with the red line segment covered with black marker. Then demonstrate on a map with one red line end. Explain how the game is played, ie. Start the program and set Ozobot on the start line. Ozobot will follow the line until it lands on a red line segment.
    5. Students then complete sections A and B of the activity sheet.
    6. Compare what the students wrote on the activity sheet to the Ozobot Blockly program.
    7. Discuss how the program works (see below).
    8. To get students to make meaningful changes to the program, have students use the second maze map called Challenge. Point out that there is now a blue line end on the second branch from the top.
    9. Ask students what changes to the original program are needed to make Ozobot go straight to that line and see blue. Either give the answers or have students discuss and test in groups. ANSWER: Change if there is a way right and pick direction right both to left. Change the line-end color to blue. Change if there is a way left, pick straight to if there is a way right, pick straight. Remember this is a backup code whose importance will be more apparent if and when students make their own binary tree maps.
    10. Have students gather materials they need: Computer/tablet, Ozobot, and both maps.
    11. Students open the program: https://ozo.bot/line-end-search-game and test it on the original map first. Then make changes to the program for the Challenge Map.
    12. Students adjust the program, trying to get Ozobot to the blue line more directly and end the program.
    13. Once the Challenge Map program has been completed, students draw their own binary tree maze with different colored line ends and program Ozobot to reach the different colors.
    14. Have groups exchange maps and solve a new challenge.

    Instruction

    Discuss How the Program Works

    1. Open the Ozobot Blockly program found at https://ozo.bot/line-end-search-game on your main classroom display.
    2. Point out the Line Navigation blocks.

    a. These blocks program Ozobot to follow lines. Be sure to remind students that Ozobot Blockly uses sequential programming. When using the Line Navigation blocks, Ozobot follows a line and looks for an intersection or line-end before it will run the next block of code.

    b. Point out that L-shaped turns on the map are not seen as intersections but as the continuation of the line. To be an intersection, there must be a choice of directions to go.

    1. Point out the blocks that make Ozobot choose actions. Explain the Program Logic for the instructions if there is a way right, left, or straight.
    2. Point out the codes that make Ozobot walk around by itself, the Loops. The program can run forever because it will loop through a line-follow code and a decision at an intersection or line-end over and over. Provide an optional demo of placing Ozobot on a large hand-drawn plus sign. It will walk on the lines counter-clockwise forever.
    3. Point out the blocks after the loop: the victory dance.

    a. A victory dance can be lights, movements, and sounds. Put lights before movement.

    b. Light animations (rainbow, disco, etc) can go anywhere in the victory dance.

    1. Optional: Show the alternative program that is hard-coded. https://ozo.bot/line-end-search-hardcoded. This program is what new students might make to solve this maze from scratch. It is correct, but it isn't autonomous and leaves room for error.
    2. Lead students in asking questions and discussing how the programs work.
    3. Summarize the program to remind students that they can now code autonomous movement, surface color reactions, and the game mechanic of Winning!

    Instruction

    Explanation of Loops

    Loops allow a section of code to be repeated either a certain number of times or until a 'break' code is called. In this program, use a break to tell Ozobot when to end the loop.

    Ozobot will run the 'break' code when it stops at a line-end or intersection and sees that the line color is red. The bot will not stop as soon as it walks on the red, because it only executes code once it knows it is at a line-end or intersection.

    Instruction

    Explanation of Conditional Logic

    In programming, sometimes we want certain code to run only in a specific situation, or 'condition'. Programming languages make this easy by giving us if statements.

    Just like in Part 1 - Color Search, Ozobot can be programmed to check conditions in its sensor after performing a movement. Last time, Ozobot ran the if statement after a forward step. In this lesson, Ozobot runs it at a line-end or intersection. We can also check what type of intersection Ozobot has reached.

    In Level 3 of Ozobot Blockly, there are blocks for checking line color and for checking surface color - be sure to notice the difference when building or editing a program!

    PROGRAM LOGIC: This program is organized so that taking a right turn when possible is always first and Ozobot will return to the top of the loop to follow the new line. The second priority is when Ozobot needs to walk back on a line. We want it to go straight in those conditions. Last is the end of the line reaction. We prioritize checking if it's red; if it is, end the loop, and if it is not, do nothing. Then choose to go back.

    Instruction

    Line Navigation

    Line Navigation codes are unique to Ozobot. Use them to tell Ozobot to follow a line and what to do at an intersection or line-end. There are some important things to know about Line Navigation codes:

    a. You can only tell Ozobot what to do at an intersection or a line-end, and NOT while it is walking on a line. That means it cannot see the color of a line unless it is an intersection or a line-end. It also cannot make a turn off the line like using a Line Switch Color Code.

    b. A right angled turn (or any turn) is not an intersection; Ozobot sees it as the same line continuing.

    c. An intersection can be a plus (+) or T shape.

    d. You can't mix LIne Navigation movement (orange blocks) with Free Movement (yellow blocks) unless you are transitioning between the two movement types. You can't use steps on a line.

    e. If Ozobot doesn't see a line when a Line Navigation code runs, it will stop and end the program. To be most successful, place the bot on the line, then click Run Program.

    The game Line-end Search repeats the follow line to next intersection or line end code block and an if statement for what to do at an intersection. Using a follow line code block with an if statement about what to do at an intersection within a loop creates autonomous line-following behavior.

    4. Student Practice (Student-Facing Instructions)

    These are step-by-step instructions delivered directly to the students as they work independently or in groups

    Student Instructions

    Instruction

    You will be playing a programmed game for Ozobot, then discovering how it was coded. You will then edit the program to explore it, learning loops, breaks, if/else and line navigation codes that make Ozobot following lines on its own and win. Your teacher may demonstrate the game program, and explain how the game is played: Ozobot will search a maze of drawn lines until it reaches a certain color of line-end. When it finds the specified line end it will do a victory dance and stop.

    Set Ozobot on Start, click Run Program, and observe how it moves along the lines. Make notes during the demonstration and complete sections A and B on the Activity Sheet.

    Please upload any student resources, videos, etc. (Max. size: 512 MB videos, 10 MB all other files)

    Goal

    Instruction

    Next, compare your answers to how the program is written. Open the program found at https://ozo.bot/line-end-search-game

    Look at your notes on the activity sheet and compare them to the program.

    Please upload any student resources, videos, etc. (Max. size: 512 MB videos, 10 MB all other files)

    Goal

    Instruction

    Once you understand how the blocks in the program work, make changes to the program to enhance how Ozobot reacts. Update the victory dance outside the loop at the end of the program.

    Please upload any student resources, videos, etc. (Max. size: 512 MB videos, 10 MB all other files)

    Goal

    Instruction

    Test your program. Make further adjustments as needed.

    Please upload any student resources, videos, etc. (Max. size: 512 MB videos, 10 MB all other files)

    Goal

    Instruction

    Now, find the Line End Search Challenge activity sheet. Notice that there is a blue line-end. What changes need to be made to the original program to make Ozobot go straight to that line and see blue? Make adjustments to the program and run your bot to test. Make adjustments as needed.

    Please upload any student resources, videos, etc. (Max. size: 512 MB videos, 10 MB all other files)

    Goal

    Lesson Extension (Optional)

    Add student instructions for a lesson extension.

    Instruction

    Once you've finished the Challenge, draw your own binary tree maze with different colored line ends, and program Ozobot to reach the different colors. Exchange maps with another group and program Ozobot to complete this new challenge.

    Please upload any student resources, videos, etc. (Max. size: 512 MB videos, 10 MB all other files)

    Goal

    5. Supplements

    A. Lesson Closure (Optional)
    Give tips for how to wrap up the lesson and assess student learning. (Want to add an attachment? Use Part C, below.)

    B. Academic Standards (At least one standard required)
    Choose a category from the dropdown on the left. In the blank on the right, begin typing the number of the standard.

      csta-1a-ap-11 csta-1a-ap-12 csta-2-ap-13 csta-2-ap-16 iste-1-c iste-4-c

      C. Add Other Attachments (Optional)
      Please upload any student handouts, videos, sample solutions, etc. (Max. size: 1 GB videos, 10 MB all other files)

      Add Cover Image

      Review

      Please review your lesson before submitting.

      Save Draft

      Please login or create an account to access this content and more!

      Login / Create account