1 of 18

The Arizona STEM Acceleration Project

Autonomous Robot Series:

Using Color Sensors in Reaction to Lines

2 of 18

Using Color Sensors in Reaction to Lines

A 6-8 Grade STEM Lesson

Michael Allen

5-14-2024

3 of 18

Notes for Teachers

Preparation and Setup

  • Ensure all materials are ready:
    • Verify that the LEGO® SPIKE™ App is installed and updated on student devices.
    • Prepare the black line on a white or light surface using one of the suggested methods.
    • Have spare black axle elements from the LEGO SPIKE Core Set available.
  • Review the student material in advance:
    • Familiarize yourself with the programming stacks and their functions.

General Tips

  • Encourage experimentation:
    • Allow students to try different approaches and learn from their mistakes.
  • Provide encouragement and support:
    • Celebrate small successes to build confidence and motivation.
  • Adapt to classroom dynamics:
    • Adjust the lesson pace based on student comprehension and engagement levels.

By following these notes, teachers can effectively guide their students through the lesson, ensuring a comprehensive understanding of using the Color Sensor to make the Driving Base autonomous.

List of Materials

  • LEGO Spike Prime kits

  • Tablets with LEGO Mindstorms software

  • Projector for demonstrations and explanations

  • Printed handout 1 with basic block code templates for detecting, and following a line path.
  • Printed handout 2 with basic block code templates for detecting, and following a line path.

  • Build Instruction for the Spike Prime Robot

  • 1 Color sensor

4 of 18

Standards

NGSS�MS-ETS1-4�Develop a model to generate data for iterative testing and modification of a proposed object, tool, or process such that an optimal design can be achieved.

CSTA�2-AP-12 6-8�Design and iteratively develop programs that combine control structures, including nested loops and compound conditionals.

CCSS.ELA-LITERACY.SL.6.4Present claims and findings, sequencing ideas logically and using pertinent descriptions, facts, and details to accentuate main ideas or themes; use appropriate eye contact, adequate volume, and clear pronunciation.

CCSS.MATH.CONTENT.6.NS.C.7.AInterpret statements of inequality as statements about the relative position of two numbers on a number line diagram. For example, interpret -3 > -7 as a statement that -3 is located to the right of -7 on a number line oriented from left to right.

Ai generated image

5 of 18

Arizona Standards

Computer Science (AZ 2018)

  • 6-8.AP.C.1: Develop programs that combine control structures, including nested loops and compound conditionals.
    • Connection: Students create algorithms using "Forever" loops and "If/Else" statements to control the robot based on sensor readings.
  • 6-8.AP.PD.3: Systematically test and refine programs using a range of test cases.
    • Connection: Students run the robot on a line, observe failures (driving off-course), and refine the code parameters.
  • 6-8.AP.M.1: Decompose problems and subproblems into parts to facilitate the design, implementation, and review of programs.
    • Connection: The challenge is broken down into discrete steps: sensing color, making a decision, and executing a motor command.

Science (AZ 2018)

  • 6.P4U1.4: Develop and use a model to predict and/or describe phenomena.
    • Connection: The robot acts as a physical model demonstrating input-output relationships (light intensity to motion).
  • Engineering Practice (ETS1): Constructing Explanations and Designing Solutions.
    • Connection: Students design a solution to the "maneuverability" challenge and optimize their specific code for the best results.

Mathematics (AZ Grade 6)

  • 6.NS.C.7: Understand ordering and absolute value of rational numbers.
    • Connection: Students apply inequalities (e.g., Light Intensity < 50) to determine threshold values for the sensor.
  • MP1: Make sense of problems and persevere in solving them.
    • Connection: Debugging the robot's movement requires logical analysis and persistence through multiple trial-and-error attempts.

English Language Arts (AZ 2016)

  • 6.SL.1: Engage effectively in a range of collaborative discussions with diverse partners.
    • Connection: Students collaborate in pairs during the "Guided Practice" and share insights during the "Reflection" discussion.

6 of 18

Objective

This lesson involves writing programs using the Color Sensor to make the Driving Base autonomous. It is designed for beginner students in grades 6-8 and takes approximately 30-45 minutes.

Ai generated image

7 of 18

Agenda: 30-45 min. class period

1. Engage (5-10 minutes)

Objective: Start with a discussion and video to introduce the lesson, sparking student interest and understanding of objectives.

2. Explore (20 minutes)

Objective: Students build and program the Driving Base, observing its interaction with a black line.

3. Explain (5minutes)

Objective: Discuss how the Color Sensor detects lines, explaining the principles behind the programs.

4. Elaborate (Extension/Enrichment) (15 minutes)

Objective: Students optimize their line-following programs, improving accuracy and performance.

5. Evaluate

Assessment: Assess student performance with rubrics, and encourage self and peer evaluations for constructive feedback.

8 of 18

Engage: 5-10 minutes

Objective: The objective of the Engage section is to capture students' interest and introduce them to the lesson's key concepts. This initial engagement sets the context for the activities and helps students understand the relevance of the lesson.

Activity: Initiate a Discussion (5 Minutes):

  • Objective: Stimulate curiosity and encourage students to think about the practical applications of line-following robots.
    • Activity: Ask questions to ignite a discussion about how robots use sensors in various fields, such as competitions, industry, and everyday life.
      • Example Questions:
        • How do robots use sensors to navigate?
        • Can you think of any places where robots might need to follow lines?
        • Why do you think precise line-following is important for robots?

Show a Video (5 Minutes):

  • Connecting to Real-World Applications:
    • Objective: Help students see the relevance of what they are about to learn.
    • Activity: Discuss real-world applications where line-following robots are used, such as in warehouses for moving goods, in hospitals for delivering supplies, or in competitions like LEGO robotics challenges.

  • Objective: Provide a visual introduction to the lesson's concepts and objectives, making it easier for students to grasp what they will be doing.
    • Activity: Play a video (many on YouTube) that explains how the Color Sensor and Driving Base will be used to follow lines.
    • Ensure the video clearly demonstrates the tasks and outcomes expected in the lesson.
    • After the video, briefly recap the key points to reinforce understanding.

By the end of the Engage section, students should be curious, understand the importance of the lesson, and be eager to begin the hands-on activities.

9 of 18

Engage: 5-10 minutes (continued)

Ai generated image

Discussion: Ask students Why do you think precise line following is important for robots?

10 of 18

Explore: 30 minutes

Objective: The objective of the Explore section is to provide students with hands-on experience in building and programming the Driving Base with the Color Sensor. This section encourages collaboration, experimentation, and practical application of concepts introduced during the Engage phase.

Activity:

1. Building the Driving Base (10 minutes):

  • Objective: Students will work in pairs to build the Driving Base with the Color Sensor, following the provided instructions.
  • Activity:
    • Distribute the necessary LEGO SPIKE Prime components and building instructions to each pair of students.
    • Encourage students to follow the instructions carefully, ensuring they attach the Color Sensor correctly.
    • Walk the room to offer assistance and check for any building errors.

2. Initial Programming Stack (10 minutes):

  • Objective: Students will learn to program the Driving Base to move forward and stop perpendicular to a black line using the first programming stack.
  • Activity:
    • Guide students to replicate the programming stack on their tablets or computers.
    • Have students run their programs to observe the Driving Base move forward and stop at the black line.
    • Encourage students to make observations about how the Color Sensor interacts with the black line.

3. Experimenting with the Second Programming Stack (10 minutes):

  • Objective: Students will experiment with a second programming stack to observe different behaviors of the Driving Base.
  • Activity:
    • Introduce the second programming stack and explain its purpose.
    • Have students run the new program and observe how the Driving Base behaves differently compared to the first program.
    • Encourage students to describe what happens and discuss any differences or similarities they notice.
    • Prompt students to think about why the Driving Base behaves differently with each program.

11 of 18

Explore: 30 minutes (continued)

4. Collaborative Learning and Troubleshooting (5 minutes):

  • Objective: Students will collaborate and troubleshoot any issues with their programs or builds.
  • Activity:
    • Allow students to share their experiences and solutions with each other.
    • Encourage peer-to-peer assistance for troubleshooting and refining their programs.
    • Facilitate a short discussion on common issues and effective solutions.

By the end of the Explore section, students should have a functional Driving Base equipped with a Color Sensor, and they should understand how different programming stacks affect the robot's behavior. This hands-on experience will prepare them for the Explain and Elaborate phases, where they will delve deeper into the principles and optimization of their programs.

Ai generated image

12 of 18

Explain: 20 minutes

Objective

The objective of the Explain section is to deepen students' understanding of how the Color Sensor works and how it interacts with the programming stacks to control the Driving Base.

Activity

1. Facilitated Discussion on Color Sensor Mechanics (10 minutes):

  • Objective: Help students understand how the Color Sensor detects and differentiates between colors and light intensities.

  • Activity:
    1. Introduction: Start by asking students what they observed during the Explore phase. Encourage them to share their experiences and initial thoughts.
    2. Explanation: Explain how the Color Sensor works, including its ability to detect different colors and light intensities. Use visual aids, such as diagrams or slides, to illustrate the sensor's functionality.
    3. Examples: Provide examples of how the sensor's data is used in the programming stacks to make the Driving Base react to the black line. Show code snippets to highlight key points.

Ai generated image

13 of 18

Elaborate (Extension/Enrichment) 30 minutes

Objective

The objective of the Explore section is to give students hands-on experience in building and programming the Driving Base with the Color Sensor. This phase encourages collaboration, experimentation, and practical application of concepts introduced during the Engage phase.

Activity

1. Building the Driving Base (10 minutes):

  • Objective: Students will work in pairs to construct the Driving Base with the Color Sensor using the provided instructions.
  • Activity:
    • Distribute Materials: Provide each pair with the necessary LEGO SPIKE Prime components and building guides.
    • Guide Construction: Ensure students follow the instructions to correctly attach the Color Sensor.
    • Monitor Progress: Move around the room to offer help and check for any building errors.

2. Initial Programming Stack (10 minutes):

  • Objective: Students will program the Driving Base to move forward and stop at a black line using the first programming stack.
  • Activity:
    • Introduction to Programming Environment: Demonstrate how to access the programming environment in the LEGO SPIKE Prime app.
    • Explain the First Programming Stack: Show the first programming stack and explain its purpose.
    • Student Implementation: Guide students to replicate the programming stack on their tablets or computers.
    • Run and Observe: Have students run their programs to observe the Driving Base moving forward and stopping at the black line.
    • Encourage Observations: Ask students to note how the Color Sensor interacts with the black line.

14 of 18

Elaborate 30 minutes (continued)

3. Collaborative Learning and Troubleshooting (5 minutes):

  • Objective: Students will work together to troubleshoot and refine their programs or builds.
  • Activity:
    • Share Experiences: Allow students to share their experiences and solutions with each other.
    • Peer Assistance: Encourage peer-to-peer assistance for troubleshooting and refining their programs.
    • Facilitate Discussion: Lead a short discussion on common issues and effective solutions.

4. Optimization Challenge (5 minutes):

  • Objective: Students will optimize their line-following programs for better performance.
  • Activity:
    • Optimization Task: Challenge students to enhance their programs for speed and accuracy.
    • Testing and Refining: Allow students to test their optimized programs and make adjustments.
    • Performance Comparison: Have students compare their optimized programs with their initial attempts.

By the end of the Explore section, students should have a functional Driving Base equipped with a Color Sensor and a deeper understanding of how different programming stacks affect the robot's behavior. This hands-on experience will prepare them for the Explain and Elaborate phases, where they will delve deeper into the principles and optimization of their programs.

Ai generated image

15 of 18

Extension/Enrichment

Language Arts Extension

Writing Assignments for the Lesson

Reflective Journal

Objective: Encourage students to reflect on their learning experiences and articulate their thoughts and understanding of the concepts taught in the lesson.

Prompt: Write a one-page journal entry reflecting on today’s lesson. Include the following points:

  1. What did you learn about the Color Sensor and its role in making the Driving Base autonomous?

  1. Describe any challenges you faced while building or programming the Driving Base and how you overcame them.

  1. What was the most interesting part of the lesson for you and why?

  1. How do you think these concepts could be applied in real-world scenarios?

Language Arts Extension

Writing Assignments for the Lesson

Creative Writing - Future Applications

Objective: Encourage creative thinking by having students envision future applications of the technology they are learning about.

Prompt: Imagine a future where autonomous robots with Color Sensors are a common part of everyday life. Write a short story (1-2 pages) that explores one specific application of this technology. Consider the following points:

  1. Describe the setting and the problem that the robot is designed to solve.
  2. Explain how the robot’s Color Sensor helps it navigate and perform its tasks.
  3. Highlight the benefits and potential challenges of using such technology in your chosen scenario.
  4. Include characters and dialogue to make your story engaging.

These assignments will help students deepen their understanding of the lesson's concepts, practice their writing skills, and think critically about the applications and implications of the technology they are studying.

16 of 18

Evaluate: 20 minutes

Assessment

Rubric: Students demonstrate their robot's ability to complete the simple maze through a series of turns, and explain the code they used. Students will be assess with a rubric for the following categories, research, create, test.

Objective: Assess both the students’ understanding of the concepts and their ability to apply them.

Activity: Conduct a classroom competition where each group demonstrates their robot's abilities on the competition field. Provide a rubric that assesses their use of color sensors, the complexity of their programming, problem-solving skills, and teamwork. Additionally, have students complete an Exit Ticket on what they learned about sensors and motors and how they might use this knowledge in future projects.

17 of 18

Robotics Performance Rubric

Instructions for Use:

  • Scoring: Each category is scored on a scale from 1 to 4, where 1 is the lowest (Beginning) and 4 is the highest (Exemplary). Total the scores for a comprehensive evaluation.
  • Feedback: Provide specific comments on each criterion to guide students on how to improve their skills.
  • Reflection: Encourage students to discuss what they learned from the activity and how they can apply this knowledge in future projects.

18 of 18

Differentiation

1. For Advanced Students:

- Challenge Task: Provide these students with minimal guidance and encourage them to explore additional programming concepts, such as loops or conditional statements, to enhance the robot's maneuverability.

- Extension Activities: Encourage them to create more complex follow-line tasks for the robot, like programming it to follow a specific pattern.

2. For Students Requiring More Support:

- Scaffolded Code Templates: Offer templates with partial code already filled in, where students need to complete only certain parts to make the robot turn. This helps them focus on understanding the impact of specific changes without being overwhelmed.

- Guided Practice: Pair these students with a more experienced peer or provide additional teacher guidance. Use step-by-step walkthroughs of the code to explain how each part influences the robot’s follow-line abilities.

Ai generated image

These strategies are designed to personalize learning and ensure that all students are engaged and appropriately challenged during the "Explore" stage of the lesson.