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.

    This lesson is part of the Ari Applied AI Career Kit curriculum and is designed to be taught using the kit materials.

    For more information on getting started with Ari, visit https://ozobot.com/pages/ari-resources

    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

    Understanding the AI System (10 minutes)

    Have students turn to Module 2, Lesson 5 in their Field Notebooks and begin on the <a href="https://docs.google.com/document/d/1kD1sVlrot3gr-rwe5XYA31gDBvEZL-eLaukZAT4mec/edit?usp=sharing">Planning & Coding Your AI System_ page. They will use this page to record their work throughout the lesson.

    Today students are building a complete AI crop monitoring system using what they learned in previous lessons. This system brings together how AI analyzes images, how programs use AI outputs to make decisions, and how robots move through an environment to complete a task.

    We previously learned about how autonomous vehicles use cameras and AI to detect their surroundings and make navigation decisions, as well as how AI tools use a Region of Interest (ROI) to focus on one specific area at a time. Instead of analyzing everything at once, these systems break down large tasks into smaller steps, allowing them to work more efficiently and accurately.

    In this lesson, students apply these same ideas to agriculture. Their goal is to program a system that collects data about the crop health across an entire field. As the robot moves from one location to the next, it uses AI to identify each crop’s condition and track the results. This mirrors real-world systems that provide farmers with important data, helping them make informed decisions about what actions to take next, such as watering, treating, or removing crops.

    Instruction

    Explain the Coding Challenge (10 minutes)

    The Challenge: Students will create a program that autonomously moves Ari through all eight crop locations and records data on each crop’s condition using AI and a camera.

    Overview

    1. This lesson uses section C of the Agriculture Mat.
    2. Explain that Ari will travel counterclockwise along the black track.
    3. Show students the green, blue, and red crop cards. Place one crop card in each box.
    4. Model placing the camera above the mat so the AI system can clearly see all eight boxes.

    Guide a discussion around how the AI system will work using Input → Processing → Output → Action. Encourage students to define the roles of humans and AI using precise language.

    1. Input: The program sends a prompt to the AI asking it to analyze each crop, such as identifying the color of the plant in a specific numbered location.
    2. Processing: The AI system analyzes the camera image and detects visual patterns, such as color, to determine the crop’s condition.
    3. Output: The AI outputs a classification for each crop (healthy, dehydrated, or dead).
    4. Action: The program uses that output to change the robot’s top light color, record the result using variables, and continue navigating to the next crop.

    Instruction

    Group Strategy & Planning (10 minutes)

    Students move into their groups and examine the mat. Ask students to discuss how their AI system should work and talk through possible program structures before coding.

    Discussion prompts:

    • What will the AI detect at each crop location? What output will the AI give you?
    • What should Ari do for each type of crop (healthy, dehydrated, dead)?
    • How will your program keep track of each crop’s condition?
    • How will the robot move from one location to the next?
    • How will your system repeat this process for all eight crops? How will it know when to stop?

    Students should write their steps in pseudocode or sketch their program flow before coding. Groups should leave this step with a clear plan for how their program will work.

    Instruction

    Setup (5 minutes)

    1. Turn on Ari and open the Computer Science folder. Open the Blockly app.
    2. Place the mat on a flat surface.
    3. Launch the Editor on a coding device.
    4. Connect the camera to the coding device and position it above the mat section.
    5. Open the saved Share Code from the previous lesson.
    6. Under Devices, connect the camera, Ari and LLM bot.
    7. Place a crop card in each of the eight boxes.
    8. Check the camera preview to make sure it is aligned correctly.

    Instruction

    Code, Test, Iterate, and Improve (30 minutes)

    Students move to the Ozobot Editor and begin building their program. Each student codes their own version of the solution based on their group discussion.

    • Make sure students open their saved program from the previous lesson using the Share Code. To begin building a new program, have them drag the section of code connected to the Program Start block to the side to disable it.

    Students run their programs on the mat and observe the results. If the system does not behave as expected, students revise their code and test again. Encourage multiple iterations to improve system accuracy.

    By the end of the lesson, students should have a working version of their AI system that completes the challenge.

    Student Deliverables:

    1. Field Data Collection: Students need to record the data their AI crop monitoring system generated by taking a screenshot of the console output or recording the results on paper. This data will be used in the AI System Capstone.
    2. Final Share Code: Students need to record the 7-digit Share Code to submit their final program to the teacher.

    Explanation of Possible Solution

    The steps below outline one possible program that completes the objective. Because coding allows for many valid approaches, students’ programs may look different. Use the breakdown below if you would like to guide students through this example solution.

    Share Code: yvjt6s6

    1. Set the AI system rules. Type in an initial prompt, such as “There are three types of crop cards: red crop cards, blue crop cards, and green crop cards. The bot moves counterclockwise along the long black line, starting at the top left corner at box 1 and moving consecutively through box 8.”
    2. Check for previous variables. Check that the variables used in previous lessons have been created:
      1. “boxNumber”
      2. “promptText”
      3. “cropColor”
    3. Create new variables. To collect data on the healthy, dehydrated, and dead crops, we need to create three new variables titled:
      1. “healthyCrop”
      2. “dehydratedCrop”
      3. “deadCrop”
    4. Initialize variables. Set “boxNumber” to 1, which will start off analyzing box 1. Then set “healthyCrop,” “dehydratedCrop,” and “deadCrop,” to 0.
    5. Set Ari’s speed. Set the line-following speed to an appropriate value.
    6. Begin the loop. Use a repeat forever loop to continuously run the system. The next few steps are repeated code from lesson 3.
    7. Move to the next crop location. Add a pick direction straight block to continue moving forward. Then a line navigation block to follow the line to the next intersection.
    8. Build a dynamic prompt. Set the “promptText” variable to a text block. Write in the prompt “What color crop is closest to number” leaving the sentence open ended.
      1. Add the box number to the text. Connect a “promptText” append text block to a “boxNumber” variable block. This uses the variable counter to finish the sentence with numbers 1-8.
      2. Display the prompt. Print “promptText” to the console for visibility.
    9. Use AI to process the image. Use an LLM block with the camera enabled. Ask for a surface color output, which limits responses to: red, blue, green, black. Add the “promptText” variable as the prompt to ask what color crop is in each box.
      1. Store the AI output. Set the “cropColor” variable to the LLM response.
      2. Display the AI result. Print “cropColor” to the console. Run the program to check your work.
    10. Create conditions based on crop health. Add an if/do logic block with a compare block. Set the condition to if “cropColor” equals surface color green. For the do:
      1. Set the top light color to green.
      2. Print “Healthy Crop” to the console.
      3. Increase the “healthyCrop” variable by 1. This adds to our final count.
      4. Wait 1 second.
      5. Turn the top light off.
    11. Repeat for other crop types. Use the same steps for each condition:
      1. If “cropColor” = blue → follow the same steps using “Dehydrated Crop” and increase “dehydratedCrop” by 1.
      2. If “cropColor” = red → follow the same steps using “Dead Crop” and increase “deadCrop” by 1.
    12. Check for completion. Add a condition that checks if “boxNumber” = 8, which means the robot has reached the final crop location. If this condition is met, break out of the loop so the program stops repeating and moves on to display the final results.
    13. Update the location. If the program has not reached the final crop, increase boxNumber by 1 so the system moves on to analyze the next crop location in the sequence.
    14. Output the final data. After the loop ends, print the total number of each crop type to the console. Display the values stored in “healthyCrop,” “dehydratedCrop,” and “deadCrop” so the system provides a complete summary of the crop conditions across the field.

    Instruction

    Exit Ticket - Explain Your Thinking (10 minutes)

    Conclude the lesson by presenting the “Explain Your Thinking” question and having students independently complete a written response in their Field Notebook.

    Explain Your Thinking:

    Your AI system identified crop conditions across the field. What could the AI system determine from the data, and what could it not determine without human interpretation? Why is the farmer still necessary in this system?

    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

    Students will work in the same group of four throughout the module. 

    • Groups will share an Ari, camera, mat, and accessories.
    • Students may share a coding device or work independently on their own devices.
    • Each student will record their work in the corresponding pages of their Field Notebook.

    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

    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-2-ap-11 csta-2-da-08

      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