Hands-on Activity: Line-Follower Challenge

Contributed by: GK-12 Program, Computational Neurobiology Center, College of Engineering, University of Missouri

A photograph shows six students in a circle watching two LEGO EV3 robots travel an oval line on the floor made with black tape.
Students test their EV3 robots
copyright
Copyright © 2013 Computational Neurobiology Center, College of Engineering, University of Missouri

Summary

Student groups are challenged to program robots with color sensors to follow a black line. Learning both the logic and skills behind programming robots for this challenge helps students improve their understanding of how robots "think" and widens their appreciation for the complexity involved in programming LEGO® MINDSTORMS® EV3 robots to do what appears to be a simple task. They test their ideas for approaches to solve the problem and ultimately learn a (provided) working programming solution. They think of real-world applications for line-follower robots that use sensor input. A PowerPoint® presentation and pre/post quizzes are provided.
This engineering curriculum meets Next Generation Science Standards (NGSS).

Engineering Connection

Engineers incorporate sensors into machines in order to make them perform complex, precise and/or tedious tasks. For example, engineers who work for car manufacturers design robots that paint car parts, such as car bodies, hoods and doors. To achieve an even coat of paint, these robots must maintain a consistent distance between the paint applicator and the part. The robots use sensors to determine the distance between the paint applicator and the surface to be painted. The line-follower concept shown in this activity has applications for running mass transit systems and autonomous cars on highways, as well to deliver mail in office buildings, move items through factory assembly lines, and deliver medications in hospitals.

Pre-Req Knowledge

Complete the previous units (1-4) and the earlier lessons and activities of unit 5 prior to this activity.

Learning Objectives

After this activity, students should be able to:

  • Explain how a color sensor works.
  • Develop and explain the logic behind programs that instruct robots to use color sensor readings to make decisions.

More Curriculum Like This

How Does a Color Sensor Work?

Students learn more about how color sensors work, reinforcing their similarities to the human sense of sight. This lesson and its associated activity enable students to gain a deeper understanding of how robots can take sensor input and use it to make decisions via programming.

How Do You Make a Program Wait?

Building on the programming basics learned so far in the unit, students next learn how to program using sensors rather than by specifying exact durations. Working with the LEGO® MINDSTORMS® EV3 robots and software, they learn about wait blocks and how to use them in conjunction with move blocks set ...

How Does an Ultrasonic Sensor Work?

Students learn about how ultrasonic sensors work, reinforcing the connection between this sensor and how humans, bats and dolphins estimate distance. They learn the echolocation process—sound waves transmitted, bounced back and received, with the time difference used to calculate the distance of obj...

How Does a Touch Sensor Work?

Students learn about how touch sensors work, while reinforcing their similarities to the human sense of touch. They look at human senses and their electronic imitators, with special focus on the nervous system, skin and touch sensors.

Educational Standards

Each TeachEngineering lesson or activity is correlated to one or more K-12 science, technology, engineering or math (STEM) educational standards.

All 100,000+ K-12 STEM standards covered in TeachEngineering are collected, maintained and packaged by the Achievement Standards Network (ASN), a project of D2L (www.achievementstandards.org).

In the ASN, standards are hierarchically structured: first by source; e.g., by state; within source by type; e.g., science or mathematics; within type by subtype, then by grade, etc.

  • Define a simple design problem reflecting a need or a want that includes specified criteria for success and constraints on materials, time, or cost. (Grades 3 - 5) More Details

    View aligned curriculum

    Do you agree with this alignment?

    This standard focuses on the following Three Dimensional Learning aspects of NGSS:
    Science & Engineering Practices Disciplinary Core Ideas Crosscutting Concepts
    Define a simple design problem that can be solved through the development of an object, tool, process, or system and includes several criteria for success and constraints on materials, time, or cost.Possible solutions to a problem are limited by available materials and resources (constraints). The success of a designed solution is determined by considering the desired features of a solution (criteria). Different proposals for solutions can be compared on the basis of how well each one meets the specified criteria for success or how well each takes the constraints into account.People's needs and wants change over time, as do their demands for new and improved technologies.
  • Generate and compare multiple possible solutions to a problem based on how well each is likely to meet the criteria and constraints of the problem. (Grades 3 - 5) More Details

    View aligned curriculum

    Do you agree with this alignment?

    This standard focuses on the following Three Dimensional Learning aspects of NGSS:
    Science & Engineering Practices Disciplinary Core Ideas Crosscutting Concepts
    Generate and compare multiple solutions to a problem based on how well they meet the criteria and constraints of the design problem.Research on a problem should be carried out before beginning to design a solution. Testing a solution involves investigating how well it performs under a range of likely conditions.At whatever stage, communicating with peers about proposed solutions is an important part of the design process, and shared ideas can lead to improved designs.Engineers improve existing technologies or develop new ones to increase their benefits, to decrease known risks, and to meet societal demands.
  • Plan and carry out fair tests in which variables are controlled and failure points are considered to identify aspects of a model or prototype that can be improved. (Grades 3 - 5) More Details

    View aligned curriculum

    Do you agree with this alignment?

    This standard focuses on the following Three Dimensional Learning aspects of NGSS:
    Science & Engineering Practices Disciplinary Core Ideas Crosscutting Concepts
    Plan and conduct an investigation collaboratively to produce data to serve as the basis for evidence, using fair tests in which variables are controlled and the number of trials considered.Tests are often designed to identify failure points or difficulties, which suggest the elements of the design that need to be improved.Different solutions need to be tested in order to determine which of them best solves the problem, given the criteria and the constraints.
  • Define the criteria and constraints of a design problem with sufficient precision to ensure a successful solution, taking into account relevant scientific principles and potential impacts on people and the natural environment that may limit possible solutions. (Grades 6 - 8) More Details

    View aligned curriculum

    Do you agree with this alignment?

    This standard focuses on the following Three Dimensional Learning aspects of NGSS:
    Science & Engineering Practices Disciplinary Core Ideas Crosscutting Concepts
    Define a design problem that can be solved through the development of an object, tool, process or system and includes multiple criteria and constraints, including scientific knowledge that may limit possible solutions.The more precisely a design task's criteria and constraints can be defined, the more likely it is that the designed solution will be successful. Specification of constraints includes consideration of scientific principles and other relevant knowledge that is likely to limit possible solutions.All human activity draws on natural resources and has both short and long-term consequences, positive as well as negative, for the health of people and the natural environment.The uses of technologies and any limitations on their use are driven by individual or societal needs, desires, and values; by the findings of scientific research; and by differences in such factors as climate, natural resources, and economic conditions.
  • Evaluate competing design solutions using a systematic process to determine how well they meet the criteria and constraints of the problem. (Grades 6 - 8) More Details

    View aligned curriculum

    Do you agree with this alignment?

    This standard focuses on the following Three Dimensional Learning aspects of NGSS:
    Science & Engineering Practices Disciplinary Core Ideas Crosscutting Concepts
    Evaluate competing design solutions based on jointly developed and agreed-upon design criteria.There are systematic processes for evaluating solutions with respect to how well they meet the criteria and constraints of a problem.
  • Analyze data from tests to determine similarities and differences among several design solutions to identify the best characteristics of each that can be combined into a new solution to better meet the criteria for success. (Grades 6 - 8) More Details

    View aligned curriculum

    Do you agree with this alignment?

    This standard focuses on the following Three Dimensional Learning aspects of NGSS:
    Science & Engineering Practices Disciplinary Core Ideas Crosscutting Concepts
    Analyze and interpret data to determine similarities and differences in findings.There are systematic processes for evaluating solutions with respect to how well they meet the criteria and constraints of a problem.Sometimes parts of different solutions can be combined to create a solution that is better than any of its predecessors.Although one design may not perform the best across all tests, identifying the characteristics of the design that performed the best in each test can provide useful information for the redesign process—that is, some of the characteristics may be incorporated into the new design.
  • 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. (Grades 6 - 8) More Details

    View aligned curriculum

    Do you agree with this alignment?

    This standard focuses on the following Three Dimensional Learning aspects of NGSS:
    Science & Engineering Practices Disciplinary Core Ideas Crosscutting Concepts
    Develop a model to generate data to test ideas about designed systems, including those representing inputs and outputs.Models of all kinds are important for testing solutions.The iterative process of testing the most promising solutions and modifying what is proposed on the basis of the test results leads to greater refinement and ultimately to an optimal solution.
  • Students will develop an understanding of the characteristics and scope of technology. (Grades K - 12) More Details

    View aligned curriculum

    Do you agree with this alignment?

  • Students will develop an understanding of the relationships among technologies and the connections between technology and other fields of study. (Grades K - 12) More Details

    View aligned curriculum

    Do you agree with this alignment?

  • Students will develop an understanding of the attributes of design. (Grades K - 12) More Details

    View aligned curriculum

    Do you agree with this alignment?

  • Students will develop abilities to apply the design process. (Grades K - 12) More Details

    View aligned curriculum

    Do you agree with this alignment?

  • Designed objects are used to do things better or more easily and to do some things that could not otherwise be done at all (Grades K - 5) More Details

    View aligned curriculum

    Do you agree with this alignment?

Suggest an alignment not listed above

Materials List

Each group needs:

To share with the entire class:

  • Line-Follower Challenge Presentation, Microsoft® PowerPoint® file
  • computer and projector, to show the presentation
  • measuring tape or ruler, to measure the tape
  • black electrical tape, to mark the oval course, ~5 ft per oval
  • (optional, if floor is dark-colored) large sheet of white paper or plywood, on which to tape ovals

Note: This activity can also be conducted with the older (and no longer sold) LEGO MINDSTORMS NXT set instead of EV3; see below for those supplies:

  • LEGO MINDSTORMS NXT robot, such as the NXT Base Set
  • LEGO MINDSTORMS Education NXT Software 2.1
  • computer, loaded with NXT 2.1 software

Introduction/Motivation

Today's challenge involves making a robot follow a line using its color sensor. Let's first look at how a color sensor works using the TRY ME option on the LEGO EV3 intelligent brick.

Then, each group will develop a program to make its robot follow a black line. How will you do that? Here's a tip: Use your color sensor as the robot's "eye." With input provided from its "eye" sensor, the brick/computer stays informed of when it is on the tape and when it is not. When the brick/computer has this information, it can decide how to move the robot's motor so that the color sensor is directed at the tape. Doing this ensures that the robot follows the line.

Vocabulary/Definitions

design: Loosely defined, the art of creating something that does not exist.

engineering: The use of science and mathematics to solve problems to improve the world around us.

Procedure

Before the Activity

  • Gather materials and make copies of the Line-Follower Challenge Pre-Quiz and Line-Follower Challenge Post-Quiz, one each per student. The quizzes and their answers are also embedded in the presentation, so they can be presented to the class as a whole, if desired.
  • Assemble the LEGO MINDSTORMS EV3 taskbots by following instructions in the core set or at https://www.youtube.com/watch?v=Dhe2jXi3Fc4.
  • Find a clear space on a smooth floor for one (or more) oval-shaped track(s) created with ~5 feet of black tape. Place the tape on the floor to create the track. Prepare according to details on slide 7. So the black tape provides high contrast, light-colored floors are best. If your floor is dark, then lay down a large sheet of white paper or wooden plywood over the floor to tape onto.
  • Use the Line-Follower Challenge Presentation, a PowerPoint® file, to teach and conduct the activity. Set up a computer/projector to show the presentation to the class.
  • Review the solution program on slides 8-14 to make sure you fully understand the logic used in this program, so as to be able to explain it to students after they have had a chance to try developing their own programs.
  • Arrange for enough computers so you have one for each student group. Make sure each computer has the LEGO software loaded.

With the Students: Line-Follower Challenge

  1. Administer the pre-quiz (also slide 2 with answers on slide 3) and discuss the answers as a class after students have filled out the sheets.
  2. Use slide 4 to introduce the line-follower design challenge: To have the robot follow a black line. To do this, the robots will use color sensors as their "eyes."
  3. (slides 5-6) Before students begin the design challenge, provide a refresher on how the color sensor works. Explain reflectivity of light and have students explore the TRY ME option on the LEGO intelligent brick and determine the color sensor readings for different surfaces. Refer to the How Does the Light Sensor Work? lesson in unit 4: How Do Sensors Work? for numbers related to the color sensor readings for different surfaces. In general, higher numbers indicate brighter light (as a percentage of light that is the maximum the sensor can read), and lower numbers indicate a lower brightness of light. Explain that colors close to white reflect more light and colors close to black reflect less light.
  4. Show students the oval-shaped course(s) created on the floor with black tape, prepared as described on slide 7.
  5. Divide the class into groups of three students each. Give the groups 15-20 minutes to create their line-follower programs.
  • Direct groups to begin by brainstorming the logic for program that instruct the robot to successfully follow the line. Encourage students to use what they have learned about programming from previous activities.
  • Provide each group with a LEGO taskbot and have students download their programs onto the EV3 intelligent bricks.
  1. Give the groups 20-30 minutes to test their robots on the track and make changes to their program designs. To test a line-follower program, position the robot's color sensor over the line and start the program. The testing and redesign steps of the engineering design process are when engineers test their ideas to see if they meet the challenge, and re-design, as necessary.
  2. Gather the class together so each group can demonstrate the performance of its robot and designed program.
  3. Once students have attempted to complete the line-follower challenge, walk them through the logic of the complex solution (on slides 8-13) and explain how to generate the program step by step.
  4. Once groups have prepared the provided program, direct them to download it to their EV3 intelligent bricks. Provide each group with a chance to test to see if the program is successful. Note the troubleshooting tips on slide 14.
  5. As a class, discuss the activity, particularly what students learned and any issues or problems. Ask students: How many groups experienced some unsuccessful program design attempts? What were some of your programming design ideas that did not work? Did the successful program design surprise you? Can you understand how sometimes engineers say they learn more from failures than successes?
  6. Administer the post-quiz (also on slide 15 with answers on slide 16) and review the answers as a class. Slide 17 presents vocabulary words and definitions.

Worksheets and Attachments

Troubleshooting Tips

Providing more than one track helps in the testing phase so groups spend less time waiting for a turn at the track.

If the robot does not follow a black line, check for these common problems:

  • The black line may need to be thicker; if the line is very thin, the color sensor response time might be too slow.
  • The light level used in the switch statement (step 2) might need to be raised or lowered, depending on the surface color/reflectivity of the black line. It is often helpful for debugging to view the output of the color sensor directly from the EV3, via the View menu option.
  • Make sure the sensors/motors are connected to the correct ports.
  • Read back through the instructions and make sure all the properties for the commands are set correctly.

Assessment

Pre-Activity Assessment

Pre-Quiz: Before starting the activity, administer the two-question Line-Follower Challenge Pre-Quiz by handing out paper copies (also on slide 2). Use the pre-quiz to assess students' prior knowledge of how color sensors work and encourage them to brainstorm how a program for this challenge could include the robot turning. The answers are provided on the Line-Follower Challenge Pre-Quiz Answer Key (and slide 3).

Activity Embedded Assessment

Line-Follower Challenge: Assess each group's performance in the line-follower challenge using the following rubric (maximum 30 points).

  • The LEGO robot designs were appropriate, with correct color sensor attachment (10 points maximum)
  • The program logic was correct. (10 points maximum) (Note: Refer to solution on slides 8-13.)
  • The group iterated several times and improved its design. (10 points maximum)

Post-Activity Assessment

Concluding Discussion: At activity end, lead a class discussion so students can share their observations, difficulties, questions and conclusions. How many unsuccessful program design attempts did you team go through? What were some of your programming design ideas that did not work? Did the successful program design surprise you? Mention that sometimes engineers say they learn more from failures than successes. Use this opportunity to gauge student comprehension.

Post-Quiz: At activity end, administer the two-question Line-Follower Challenge Post-Quiz by handing out paper copies (also slide 15). Review students' answers to assess their individual understanding of the logic in the program solution for this challenge and ability to relate this logic to real-world engineering problems. Answers are provided on the Line-Follower Challenge Post-Quiz Answer Key (and slide 16).

Activity Scaling

  • For more advanced students, add more explanatory material on the topics of sensors and transducers.

Additional Multimedia Support

Instructions to assemble the LEGO "5 Minute Bot" at https://www.youtube.com/watch?v=Dhe2jXi3Fc4

Contributors

Sachin Nair, Pranit Samarth, Satish S. Nair

Copyright

© 2014 by Regents of the University of Colorado; original © 2013 Curators of the University of Missouri

Supporting Program

GK-12 Program, Computational Neurobiology Center, College of Engineering, University of Missouri

Acknowledgements

This curriculum was developed under National Science Foundation GK-12 grant no. DGE 0440524. However, these contents do not necessarily represent the policies of the National Science Foundation, and you should not assume endorsement by the federal government.

Last modified: February 8, 2019

Comments